aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/platform/x86')
-rw-r--r--drivers/platform/x86/eeepc-laptop.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
index df68ae6a55d5..1c948604af94 100644
--- a/drivers/platform/x86/eeepc-laptop.c
+++ b/drivers/platform/x86/eeepc-laptop.c
@@ -150,10 +150,19 @@ struct eeepc_hotk {
150static struct eeepc_hotk *ehotk; 150static struct eeepc_hotk *ehotk;
151 151
152/* Platform device/driver */ 152/* Platform device/driver */
153static int eeepc_hotk_thaw(struct device *device);
154static int eeepc_hotk_restore(struct device *device);
155
156static struct dev_pm_ops eeepc_pm_ops = {
157 .thaw = eeepc_hotk_thaw,
158 .restore = eeepc_hotk_restore,
159};
160
153static struct platform_driver platform_driver = { 161static struct platform_driver platform_driver = {
154 .driver = { 162 .driver = {
155 .name = EEEPC_HOTK_FILE, 163 .name = EEEPC_HOTK_FILE,
156 .owner = THIS_MODULE, 164 .owner = THIS_MODULE,
165 .pm = &eeepc_pm_ops,
157 } 166 }
158}; 167};
159 168
@@ -192,7 +201,6 @@ static struct key_entry eeepc_keymap[] = {
192 */ 201 */
193static int eeepc_hotk_add(struct acpi_device *device); 202static int eeepc_hotk_add(struct acpi_device *device);
194static int eeepc_hotk_remove(struct acpi_device *device, int type); 203static int eeepc_hotk_remove(struct acpi_device *device, int type);
195static int eeepc_hotk_resume(struct acpi_device *device);
196static void eeepc_hotk_notify(struct acpi_device *device, u32 event); 204static void eeepc_hotk_notify(struct acpi_device *device, u32 event);
197 205
198static const struct acpi_device_id eeepc_device_ids[] = { 206static const struct acpi_device_id eeepc_device_ids[] = {
@@ -209,7 +217,6 @@ static struct acpi_driver eeepc_hotk_driver = {
209 .ops = { 217 .ops = {
210 .add = eeepc_hotk_add, 218 .add = eeepc_hotk_add,
211 .remove = eeepc_hotk_remove, 219 .remove = eeepc_hotk_remove,
212 .resume = eeepc_hotk_resume,
213 .notify = eeepc_hotk_notify, 220 .notify = eeepc_hotk_notify,
214 }, 221 },
215}; 222};
@@ -821,7 +828,7 @@ error_slot:
821 return ret; 828 return ret;
822} 829}
823 830
824static int eeepc_hotk_resume(struct acpi_device *device) 831static int eeepc_hotk_thaw(struct device *device)
825{ 832{
826 if (ehotk->wlan_rfkill) { 833 if (ehotk->wlan_rfkill) {
827 bool wlan; 834 bool wlan;
@@ -829,14 +836,20 @@ static int eeepc_hotk_resume(struct acpi_device *device)
829 /* 836 /*
830 * Work around bios bug - acpi _PTS turns off the wireless led 837 * Work around bios bug - acpi _PTS turns off the wireless led
831 * during suspend. Normally it restores it on resume, but 838 * during suspend. Normally it restores it on resume, but
832 * we should kick it ourselves in case suspend is aborted. 839 * we should kick it ourselves in case hibernation is aborted.
833 */ 840 */
834 wlan = get_acpi(CM_ASL_WLAN); 841 wlan = get_acpi(CM_ASL_WLAN);
835 set_acpi(CM_ASL_WLAN, wlan); 842 set_acpi(CM_ASL_WLAN, wlan);
843 }
844
845 return 0;
846}
836 847
837 /* Refresh both rfkill state and pci hotplug */ 848static int eeepc_hotk_restore(struct device *device)
849{
850 /* Refresh both wlan rfkill state and pci hotplug */
851 if (ehotk->wlan_rfkill)
838 eeepc_rfkill_hotplug(); 852 eeepc_rfkill_hotplug();
839 }
840 853
841 if (ehotk->bluetooth_rfkill) 854 if (ehotk->bluetooth_rfkill)
842 rfkill_set_sw_state(ehotk->bluetooth_rfkill, 855 rfkill_set_sw_state(ehotk->bluetooth_rfkill,