37
37
#include "pinctrl-utils.h"
38
38
#include "pinctrl-amd.h"
39
39
40
+ #ifdef CONFIG_SUSPEND
40
41
static struct amd_gpio * pinctrl_dev ;
42
+ #endif
41
43
42
44
static int amd_gpio_get_direction (struct gpio_chip * gc , unsigned offset )
43
45
{
@@ -892,7 +894,7 @@ static void amd_gpio_irq_init(struct amd_gpio *gpio_dev)
892
894
}
893
895
}
894
896
895
- #ifdef CONFIG_PM_SLEEP
897
+ #ifdef CONFIG_SUSPEND
896
898
static bool amd_gpio_should_save (struct amd_gpio * gpio_dev , unsigned int pin )
897
899
{
898
900
const struct pin_desc * pd = pin_desc_get (gpio_dev -> pctrl , pin );
@@ -969,7 +971,9 @@ static int amd_gpio_suspend_hibernate_common(struct device *dev, bool is_suspend
969
971
970
972
static int amd_gpio_suspend (struct device * dev )
971
973
{
974
+ #ifdef CONFIG_SUSPEND
972
975
pinctrl_dev = dev_get_drvdata (dev );
976
+ #endif
973
977
return amd_gpio_suspend_hibernate_common (dev , true);
974
978
}
975
979
@@ -1143,7 +1147,7 @@ static int amd_gpio_probe(struct platform_device *pdev)
1143
1147
if (gpio_dev -> irq < 0 )
1144
1148
return gpio_dev -> irq ;
1145
1149
1146
- #ifdef CONFIG_PM_SLEEP
1150
+ #ifdef CONFIG_SUSPEND
1147
1151
gpio_dev -> saved_regs = devm_kcalloc (& pdev -> dev , amd_pinctrl_desc .npins ,
1148
1152
sizeof (* gpio_dev -> saved_regs ),
1149
1153
GFP_KERNEL );
@@ -1209,7 +1213,7 @@ static int amd_gpio_probe(struct platform_device *pdev)
1209
1213
1210
1214
platform_set_drvdata (pdev , gpio_dev );
1211
1215
acpi_register_wakeup_handler (gpio_dev -> irq , amd_gpio_check_wake , gpio_dev );
1212
- #ifdef CONFIG_ACPI
1216
+ #if defined( CONFIG_ACPI ) && defined( CONFIG_SUSPEND )
1213
1217
acpi_register_lps0_dev (& pinctrl_amd_s2idle_dev_ops );
1214
1218
#endif
1215
1219
@@ -1230,7 +1234,7 @@ static void amd_gpio_remove(struct platform_device *pdev)
1230
1234
1231
1235
gpiochip_remove (& gpio_dev -> gc );
1232
1236
acpi_unregister_wakeup_handler (amd_gpio_check_wake , gpio_dev );
1233
- #ifdef CONFIG_ACPI
1237
+ #if defined( CONFIG_ACPI ) && defined( CONFIG_SUSPEND )
1234
1238
acpi_unregister_lps0_dev (& pinctrl_amd_s2idle_dev_ops );
1235
1239
#endif
1236
1240
}
@@ -1249,7 +1253,7 @@ static struct platform_driver amd_gpio_driver = {
1249
1253
.driver = {
1250
1254
.name = "amd_gpio" ,
1251
1255
.acpi_match_table = ACPI_PTR (amd_gpio_acpi_match ),
1252
- #ifdef CONFIG_PM_SLEEP
1256
+ #ifdef CONFIG_SUSPEND
1253
1257
.pm = & amd_gpio_pm_ops ,
1254
1258
#endif
1255
1259
},
0 commit comments