aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/acer-wmi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/platform/x86/acer-wmi.c')
-rw-r--r--drivers/platform/x86/acer-wmi.c54
1 files changed, 30 insertions, 24 deletions
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index bbf78b2d6d93..96a0b75c52c9 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -96,7 +96,7 @@ enum acer_wmi_event_ids {
96 WMID_ACCEL_EVENT = 0x5, 96 WMID_ACCEL_EVENT = 0x5,
97}; 97};
98 98
99static const struct key_entry acer_wmi_keymap[] = { 99static const struct key_entry acer_wmi_keymap[] __initconst = {
100 {KE_KEY, 0x01, {KEY_WLAN} }, /* WiFi */ 100 {KE_KEY, 0x01, {KEY_WLAN} }, /* WiFi */
101 {KE_KEY, 0x03, {KEY_WLAN} }, /* WiFi */ 101 {KE_KEY, 0x03, {KEY_WLAN} }, /* WiFi */
102 {KE_KEY, 0x04, {KEY_WLAN} }, /* WiFi */ 102 {KE_KEY, 0x04, {KEY_WLAN} }, /* WiFi */
@@ -294,7 +294,7 @@ struct quirk_entry {
294 294
295static struct quirk_entry *quirks; 295static struct quirk_entry *quirks;
296 296
297static void set_quirks(void) 297static void __init set_quirks(void)
298{ 298{
299 if (!interface) 299 if (!interface)
300 return; 300 return;
@@ -306,7 +306,7 @@ static void set_quirks(void)
306 interface->capability |= ACER_CAP_BRIGHTNESS; 306 interface->capability |= ACER_CAP_BRIGHTNESS;
307} 307}
308 308
309static int dmi_matched(const struct dmi_system_id *dmi) 309static int __init dmi_matched(const struct dmi_system_id *dmi)
310{ 310{
311 quirks = dmi->driver_data; 311 quirks = dmi->driver_data;
312 return 1; 312 return 1;
@@ -337,7 +337,7 @@ static struct quirk_entry quirk_lenovo_ideapad_s205 = {
337}; 337};
338 338
339/* The Aspire One has a dummy ACPI-WMI interface - disable it */ 339/* The Aspire One has a dummy ACPI-WMI interface - disable it */
340static struct dmi_system_id acer_blacklist[] = { 340static const struct dmi_system_id acer_blacklist[] __initconst = {
341 { 341 {
342 .ident = "Acer Aspire One (SSD)", 342 .ident = "Acer Aspire One (SSD)",
343 .matches = { 343 .matches = {
@@ -355,7 +355,7 @@ static struct dmi_system_id acer_blacklist[] = {
355 {} 355 {}
356}; 356};
357 357
358static struct dmi_system_id acer_quirks[] = { 358static const struct dmi_system_id acer_quirks[] __initconst = {
359 { 359 {
360 .callback = dmi_matched, 360 .callback = dmi_matched,
361 .ident = "Acer Aspire 1360", 361 .ident = "Acer Aspire 1360",
@@ -530,14 +530,15 @@ static struct dmi_system_id acer_quirks[] = {
530 {} 530 {}
531}; 531};
532 532
533static int video_set_backlight_video_vendor(const struct dmi_system_id *d) 533static int __init
534video_set_backlight_video_vendor(const struct dmi_system_id *d)
534{ 535{
535 interface->capability &= ~ACER_CAP_BRIGHTNESS; 536 interface->capability &= ~ACER_CAP_BRIGHTNESS;
536 pr_info("Brightness must be controlled by generic video driver\n"); 537 pr_info("Brightness must be controlled by generic video driver\n");
537 return 0; 538 return 0;
538} 539}
539 540
540static const struct dmi_system_id video_vendor_dmi_table[] = { 541static const struct dmi_system_id video_vendor_dmi_table[] __initconst = {
541 { 542 {
542 .callback = video_set_backlight_video_vendor, 543 .callback = video_set_backlight_video_vendor,
543 .ident = "Acer TravelMate 4750", 544 .ident = "Acer TravelMate 4750",
@@ -582,7 +583,7 @@ static const struct dmi_system_id video_vendor_dmi_table[] = {
582}; 583};
583 584
584/* Find which quirks are needed for a particular vendor/ model pair */ 585/* Find which quirks are needed for a particular vendor/ model pair */
585static void find_quirks(void) 586static void __init find_quirks(void)
586{ 587{
587 if (!force_series) { 588 if (!force_series) {
588 dmi_check_system(acer_quirks); 589 dmi_check_system(acer_quirks);
@@ -749,7 +750,7 @@ static acpi_status AMW0_set_u32(u32 value, u32 cap)
749 return wmab_execute(&args, NULL); 750 return wmab_execute(&args, NULL);
750} 751}
751 752
752static acpi_status AMW0_find_mailled(void) 753static acpi_status __init AMW0_find_mailled(void)
753{ 754{
754 struct wmab_args args; 755 struct wmab_args args;
755 struct wmab_ret ret; 756 struct wmab_ret ret;
@@ -781,16 +782,16 @@ static acpi_status AMW0_find_mailled(void)
781 return AE_OK; 782 return AE_OK;
782} 783}
783 784
784static int AMW0_set_cap_acpi_check_device_found; 785static int AMW0_set_cap_acpi_check_device_found __initdata;
785 786
786static acpi_status AMW0_set_cap_acpi_check_device_cb(acpi_handle handle, 787static acpi_status __init AMW0_set_cap_acpi_check_device_cb(acpi_handle handle,
787 u32 level, void *context, void **retval) 788 u32 level, void *context, void **retval)
788{ 789{
789 AMW0_set_cap_acpi_check_device_found = 1; 790 AMW0_set_cap_acpi_check_device_found = 1;
790 return AE_OK; 791 return AE_OK;
791} 792}
792 793
793static const struct acpi_device_id norfkill_ids[] = { 794static const struct acpi_device_id norfkill_ids[] __initconst = {
794 { "VPC2004", 0}, 795 { "VPC2004", 0},
795 { "IBM0068", 0}, 796 { "IBM0068", 0},
796 { "LEN0068", 0}, 797 { "LEN0068", 0},
@@ -798,7 +799,7 @@ static const struct acpi_device_id norfkill_ids[] = {
798 { "", 0}, 799 { "", 0},
799}; 800};
800 801
801static int AMW0_set_cap_acpi_check_device(void) 802static int __init AMW0_set_cap_acpi_check_device(void)
802{ 803{
803 const struct acpi_device_id *id; 804 const struct acpi_device_id *id;
804 805
@@ -808,7 +809,7 @@ static int AMW0_set_cap_acpi_check_device(void)
808 return AMW0_set_cap_acpi_check_device_found; 809 return AMW0_set_cap_acpi_check_device_found;
809} 810}
810 811
811static acpi_status AMW0_set_capabilities(void) 812static acpi_status __init AMW0_set_capabilities(void)
812{ 813{
813 struct wmab_args args; 814 struct wmab_args args;
814 struct wmab_ret ret; 815 struct wmab_ret ret;
@@ -1184,7 +1185,7 @@ static acpi_status wmid_v2_set_u32(u32 value, u32 cap)
1184 return wmid3_set_device_status(value, device); 1185 return wmid3_set_device_status(value, device);
1185} 1186}
1186 1187
1187static void type_aa_dmi_decode(const struct dmi_header *header, void *dummy) 1188static void __init type_aa_dmi_decode(const struct dmi_header *header, void *d)
1188{ 1189{
1189 struct hotkey_function_type_aa *type_aa; 1190 struct hotkey_function_type_aa *type_aa;
1190 1191
@@ -1209,7 +1210,7 @@ static void type_aa_dmi_decode(const struct dmi_header *header, void *dummy)
1209 commun_fn_key_number = type_aa->commun_fn_key_number; 1210 commun_fn_key_number = type_aa->commun_fn_key_number;
1210} 1211}
1211 1212
1212static acpi_status WMID_set_capabilities(void) 1213static acpi_status __init WMID_set_capabilities(void)
1213{ 1214{
1214 struct acpi_buffer out = {ACPI_ALLOCATE_BUFFER, NULL}; 1215 struct acpi_buffer out = {ACPI_ALLOCATE_BUFFER, NULL};
1215 union acpi_object *obj; 1216 union acpi_object *obj;
@@ -1658,7 +1659,7 @@ static ssize_t show_bool_threeg(struct device *dev,
1658 u32 result; \ 1659 u32 result; \
1659 acpi_status status; 1660 acpi_status status;
1660 1661
1661 pr_info("This threeg sysfs will be removed in 2012 - used by: %s\n", 1662 pr_info("This threeg sysfs will be removed in 2014 - used by: %s\n",
1662 current->comm); 1663 current->comm);
1663 status = get_u32(&result, ACER_CAP_THREEG); 1664 status = get_u32(&result, ACER_CAP_THREEG);
1664 if (ACPI_SUCCESS(status)) 1665 if (ACPI_SUCCESS(status))
@@ -1671,7 +1672,7 @@ static ssize_t set_bool_threeg(struct device *dev,
1671{ 1672{
1672 u32 tmp = simple_strtoul(buf, NULL, 10); 1673 u32 tmp = simple_strtoul(buf, NULL, 10);
1673 acpi_status status = set_u32(tmp, ACER_CAP_THREEG); 1674 acpi_status status = set_u32(tmp, ACER_CAP_THREEG);
1674 pr_info("This threeg sysfs will be removed in 2012 - used by: %s\n", 1675 pr_info("This threeg sysfs will be removed in 2014 - used by: %s\n",
1675 current->comm); 1676 current->comm);
1676 if (ACPI_FAILURE(status)) 1677 if (ACPI_FAILURE(status))
1677 return -EINVAL; 1678 return -EINVAL;
@@ -1683,7 +1684,7 @@ static DEVICE_ATTR(threeg, S_IRUGO | S_IWUSR, show_bool_threeg,
1683static ssize_t show_interface(struct device *dev, struct device_attribute *attr, 1684static ssize_t show_interface(struct device *dev, struct device_attribute *attr,
1684 char *buf) 1685 char *buf)
1685{ 1686{
1686 pr_info("This interface sysfs will be removed in 2012 - used by: %s\n", 1687 pr_info("This interface sysfs will be removed in 2014 - used by: %s\n",
1687 current->comm); 1688 current->comm);
1688 switch (interface->type) { 1689 switch (interface->type) {
1689 case ACER_AMW0: 1690 case ACER_AMW0:
@@ -1777,7 +1778,7 @@ static void acer_wmi_notify(u32 value, void *context)
1777 } 1778 }
1778} 1779}
1779 1780
1780static acpi_status 1781static acpi_status __init
1781wmid3_set_lm_mode(struct lm_input_params *params, 1782wmid3_set_lm_mode(struct lm_input_params *params,
1782 struct lm_return_value *return_value) 1783 struct lm_return_value *return_value)
1783{ 1784{
@@ -1811,7 +1812,7 @@ wmid3_set_lm_mode(struct lm_input_params *params,
1811 return status; 1812 return status;
1812} 1813}
1813 1814
1814static int acer_wmi_enable_ec_raw(void) 1815static int __init acer_wmi_enable_ec_raw(void)
1815{ 1816{
1816 struct lm_return_value return_value; 1817 struct lm_return_value return_value;
1817 acpi_status status; 1818 acpi_status status;
@@ -1834,7 +1835,7 @@ static int acer_wmi_enable_ec_raw(void)
1834 return status; 1835 return status;
1835} 1836}
1836 1837
1837static int acer_wmi_enable_lm(void) 1838static int __init acer_wmi_enable_lm(void)
1838{ 1839{
1839 struct lm_return_value return_value; 1840 struct lm_return_value return_value;
1840 acpi_status status; 1841 acpi_status status;
@@ -2043,6 +2044,7 @@ static int acer_platform_remove(struct platform_device *device)
2043 return 0; 2044 return 0;
2044} 2045}
2045 2046
2047#ifdef CONFIG_PM_SLEEP
2046static int acer_suspend(struct device *dev) 2048static int acer_suspend(struct device *dev)
2047{ 2049{
2048 u32 value; 2050 u32 value;
@@ -2083,6 +2085,10 @@ static int acer_resume(struct device *dev)
2083 2085
2084 return 0; 2086 return 0;
2085} 2087}
2088#else
2089#define acer_suspend NULL
2090#define acer_resume NULL
2091#endif
2086 2092
2087static SIMPLE_DEV_PM_OPS(acer_pm, acer_suspend, acer_resume); 2093static SIMPLE_DEV_PM_OPS(acer_pm, acer_suspend, acer_resume);
2088 2094
@@ -2120,7 +2126,7 @@ static int remove_sysfs(struct platform_device *device)
2120 return 0; 2126 return 0;
2121} 2127}
2122 2128
2123static int create_sysfs(void) 2129static int __init create_sysfs(void)
2124{ 2130{
2125 int retval = -ENOMEM; 2131 int retval = -ENOMEM;
2126 2132
@@ -2149,7 +2155,7 @@ static void remove_debugfs(void)
2149 debugfs_remove(interface->debug.root); 2155 debugfs_remove(interface->debug.root);
2150} 2156}
2151 2157
2152static int create_debugfs(void) 2158static int __init create_debugfs(void)
2153{ 2159{
2154 interface->debug.root = debugfs_create_dir("acer-wmi", NULL); 2160 interface->debug.root = debugfs_create_dir("acer-wmi", NULL);
2155 if (!interface->debug.root) { 2161 if (!interface->debug.root) {