aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/sony-laptop.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/platform/x86/sony-laptop.c')
-rw-r--r--drivers/platform/x86/sony-laptop.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index 9363969ad07a..daaddec68def 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -140,7 +140,10 @@ MODULE_PARM_DESC(kbd_backlight_timeout,
140 "1 for 30 seconds, 2 for 60 seconds and 3 to disable timeout " 140 "1 for 30 seconds, 2 for 60 seconds and 3 to disable timeout "
141 "(default: 0)"); 141 "(default: 0)");
142 142
143#ifdef CONFIG_PM_SLEEP
143static void sony_nc_kbd_backlight_resume(void); 144static void sony_nc_kbd_backlight_resume(void);
145static void sony_nc_thermal_resume(void);
146#endif
144static int sony_nc_kbd_backlight_setup(struct platform_device *pd, 147static int sony_nc_kbd_backlight_setup(struct platform_device *pd,
145 unsigned int handle); 148 unsigned int handle);
146static void sony_nc_kbd_backlight_cleanup(struct platform_device *pd); 149static void sony_nc_kbd_backlight_cleanup(struct platform_device *pd);
@@ -151,7 +154,6 @@ static void sony_nc_battery_care_cleanup(struct platform_device *pd);
151 154
152static int sony_nc_thermal_setup(struct platform_device *pd); 155static int sony_nc_thermal_setup(struct platform_device *pd);
153static void sony_nc_thermal_cleanup(struct platform_device *pd); 156static void sony_nc_thermal_cleanup(struct platform_device *pd);
154static void sony_nc_thermal_resume(void);
155 157
156static int sony_nc_lid_resume_setup(struct platform_device *pd); 158static int sony_nc_lid_resume_setup(struct platform_device *pd);
157static void sony_nc_lid_resume_cleanup(struct platform_device *pd); 159static void sony_nc_lid_resume_cleanup(struct platform_device *pd);
@@ -1431,6 +1433,7 @@ static void sony_nc_function_cleanup(struct platform_device *pd)
1431 sony_nc_handles_cleanup(pd); 1433 sony_nc_handles_cleanup(pd);
1432} 1434}
1433 1435
1436#ifdef CONFIG_PM_SLEEP
1434static void sony_nc_function_resume(void) 1437static void sony_nc_function_resume(void)
1435{ 1438{
1436 unsigned int i, result, bitmask, arg; 1439 unsigned int i, result, bitmask, arg;
@@ -1508,6 +1511,7 @@ static int sony_nc_resume(struct device *dev)
1508 1511
1509 return 0; 1512 return 0;
1510} 1513}
1514#endif
1511 1515
1512static SIMPLE_DEV_PM_OPS(sony_nc_pm, NULL, sony_nc_resume); 1516static SIMPLE_DEV_PM_OPS(sony_nc_pm, NULL, sony_nc_resume);
1513 1517
@@ -1872,6 +1876,7 @@ static void sony_nc_kbd_backlight_cleanup(struct platform_device *pd)
1872 } 1876 }
1873} 1877}
1874 1878
1879#ifdef CONFIG_PM_SLEEP
1875static void sony_nc_kbd_backlight_resume(void) 1880static void sony_nc_kbd_backlight_resume(void)
1876{ 1881{
1877 int ignore = 0; 1882 int ignore = 0;
@@ -1888,6 +1893,7 @@ static void sony_nc_kbd_backlight_resume(void)
1888 (kbdbl_ctl->base + 0x200) | 1893 (kbdbl_ctl->base + 0x200) |
1889 (kbdbl_ctl->timeout << 0x10), &ignore); 1894 (kbdbl_ctl->timeout << 0x10), &ignore);
1890} 1895}
1896#endif
1891 1897
1892struct battery_care_control { 1898struct battery_care_control {
1893 struct device_attribute attrs[2]; 1899 struct device_attribute attrs[2];
@@ -2210,6 +2216,7 @@ static void sony_nc_thermal_cleanup(struct platform_device *pd)
2210 } 2216 }
2211} 2217}
2212 2218
2219#ifdef CONFIG_PM_SLEEP
2213static void sony_nc_thermal_resume(void) 2220static void sony_nc_thermal_resume(void)
2214{ 2221{
2215 unsigned int status = sony_nc_thermal_mode_get(); 2222 unsigned int status = sony_nc_thermal_mode_get();
@@ -2217,6 +2224,7 @@ static void sony_nc_thermal_resume(void)
2217 if (status != th_handle->mode) 2224 if (status != th_handle->mode)
2218 sony_nc_thermal_mode_set(th_handle->mode); 2225 sony_nc_thermal_mode_set(th_handle->mode);
2219} 2226}
2227#endif
2220 2228
2221/* resume on LID open */ 2229/* resume on LID open */
2222struct snc_lid_resume_control { 2230struct snc_lid_resume_control {
@@ -4287,6 +4295,7 @@ err_free_resources:
4287 return result; 4295 return result;
4288} 4296}
4289 4297
4298#ifdef CONFIG_PM_SLEEP
4290static int sony_pic_suspend(struct device *dev) 4299static int sony_pic_suspend(struct device *dev)
4291{ 4300{
4292 if (sony_pic_disable(to_acpi_device(dev))) 4301 if (sony_pic_disable(to_acpi_device(dev)))
@@ -4300,6 +4309,7 @@ static int sony_pic_resume(struct device *dev)
4300 spic_dev.cur_ioport, spic_dev.cur_irq); 4309 spic_dev.cur_ioport, spic_dev.cur_irq);
4301 return 0; 4310 return 0;
4302} 4311}
4312#endif
4303 4313
4304static SIMPLE_DEV_PM_OPS(sony_pic_pm, sony_pic_suspend, sony_pic_resume); 4314static SIMPLE_DEV_PM_OPS(sony_pic_pm, sony_pic_suspend, sony_pic_resume);
4305 4315