diff options
-rw-r--r-- | drivers/platform/x86/acer-wmi.c | 2 | ||||
-rw-r--r-- | drivers/platform/x86/apple-gmux.c | 24 | ||||
-rw-r--r-- | drivers/platform/x86/asus-laptop.c | 10 | ||||
-rw-r--r-- | drivers/platform/x86/asus-wmi.c | 4 | ||||
-rw-r--r-- | drivers/platform/x86/eeepc-laptop.c | 10 | ||||
-rw-r--r-- | drivers/platform/x86/samsung-laptop.c | 4 | ||||
-rw-r--r-- | drivers/platform/x86/thinkpad_acpi.c | 13 |
7 files changed, 31 insertions, 36 deletions
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c index 3782e1cd3697..934d861a3235 100644 --- a/drivers/platform/x86/acer-wmi.c +++ b/drivers/platform/x86/acer-wmi.c | |||
@@ -2196,10 +2196,8 @@ static int __init acer_wmi_init(void) | |||
2196 | interface->capability &= ~ACER_CAP_BRIGHTNESS; | 2196 | interface->capability &= ~ACER_CAP_BRIGHTNESS; |
2197 | pr_info("Brightness must be controlled by acpi video driver\n"); | 2197 | pr_info("Brightness must be controlled by acpi video driver\n"); |
2198 | } else { | 2198 | } else { |
2199 | #ifdef CONFIG_ACPI_VIDEO | ||
2200 | pr_info("Disabling ACPI video driver\n"); | 2199 | pr_info("Disabling ACPI video driver\n"); |
2201 | acpi_video_unregister(); | 2200 | acpi_video_unregister(); |
2202 | #endif | ||
2203 | } | 2201 | } |
2204 | 2202 | ||
2205 | if (wmi_has_guid(WMID_GUID3)) { | 2203 | if (wmi_has_guid(WMID_GUID3)) { |
diff --git a/drivers/platform/x86/apple-gmux.c b/drivers/platform/x86/apple-gmux.c index dfb1a92ce949..db8f63841b42 100644 --- a/drivers/platform/x86/apple-gmux.c +++ b/drivers/platform/x86/apple-gmux.c | |||
@@ -101,7 +101,7 @@ static void gmux_pio_write32(struct apple_gmux_data *gmux_data, int port, | |||
101 | 101 | ||
102 | for (i = 0; i < 4; i++) { | 102 | for (i = 0; i < 4; i++) { |
103 | tmpval = (val >> (i * 8)) & 0xff; | 103 | tmpval = (val >> (i * 8)) & 0xff; |
104 | outb(tmpval, port + i); | 104 | outb(tmpval, gmux_data->iostart + port + i); |
105 | } | 105 | } |
106 | } | 106 | } |
107 | 107 | ||
@@ -142,8 +142,9 @@ static u8 gmux_index_read8(struct apple_gmux_data *gmux_data, int port) | |||
142 | u8 val; | 142 | u8 val; |
143 | 143 | ||
144 | mutex_lock(&gmux_data->index_lock); | 144 | mutex_lock(&gmux_data->index_lock); |
145 | outb((port & 0xff), gmux_data->iostart + GMUX_PORT_READ); | ||
146 | gmux_index_wait_ready(gmux_data); | 145 | gmux_index_wait_ready(gmux_data); |
146 | outb((port & 0xff), gmux_data->iostart + GMUX_PORT_READ); | ||
147 | gmux_index_wait_complete(gmux_data); | ||
147 | val = inb(gmux_data->iostart + GMUX_PORT_VALUE); | 148 | val = inb(gmux_data->iostart + GMUX_PORT_VALUE); |
148 | mutex_unlock(&gmux_data->index_lock); | 149 | mutex_unlock(&gmux_data->index_lock); |
149 | 150 | ||
@@ -166,8 +167,9 @@ static u32 gmux_index_read32(struct apple_gmux_data *gmux_data, int port) | |||
166 | u32 val; | 167 | u32 val; |
167 | 168 | ||
168 | mutex_lock(&gmux_data->index_lock); | 169 | mutex_lock(&gmux_data->index_lock); |
169 | outb((port & 0xff), gmux_data->iostart + GMUX_PORT_READ); | ||
170 | gmux_index_wait_ready(gmux_data); | 170 | gmux_index_wait_ready(gmux_data); |
171 | outb((port & 0xff), gmux_data->iostart + GMUX_PORT_READ); | ||
172 | gmux_index_wait_complete(gmux_data); | ||
171 | val = inl(gmux_data->iostart + GMUX_PORT_VALUE); | 173 | val = inl(gmux_data->iostart + GMUX_PORT_VALUE); |
172 | mutex_unlock(&gmux_data->index_lock); | 174 | mutex_unlock(&gmux_data->index_lock); |
173 | 175 | ||
@@ -461,18 +463,22 @@ static int __devinit gmux_probe(struct pnp_dev *pnp, | |||
461 | ver_release = gmux_read8(gmux_data, GMUX_PORT_VERSION_RELEASE); | 463 | ver_release = gmux_read8(gmux_data, GMUX_PORT_VERSION_RELEASE); |
462 | if (ver_major == 0xff && ver_minor == 0xff && ver_release == 0xff) { | 464 | if (ver_major == 0xff && ver_minor == 0xff && ver_release == 0xff) { |
463 | if (gmux_is_indexed(gmux_data)) { | 465 | if (gmux_is_indexed(gmux_data)) { |
466 | u32 version; | ||
464 | mutex_init(&gmux_data->index_lock); | 467 | mutex_init(&gmux_data->index_lock); |
465 | gmux_data->indexed = true; | 468 | gmux_data->indexed = true; |
469 | version = gmux_read32(gmux_data, | ||
470 | GMUX_PORT_VERSION_MAJOR); | ||
471 | ver_major = (version >> 24) & 0xff; | ||
472 | ver_minor = (version >> 16) & 0xff; | ||
473 | ver_release = (version >> 8) & 0xff; | ||
466 | } else { | 474 | } else { |
467 | pr_info("gmux device not present\n"); | 475 | pr_info("gmux device not present\n"); |
468 | ret = -ENODEV; | 476 | ret = -ENODEV; |
469 | goto err_release; | 477 | goto err_release; |
470 | } | 478 | } |
471 | pr_info("Found indexed gmux\n"); | ||
472 | } else { | ||
473 | pr_info("Found gmux version %d.%d.%d\n", ver_major, ver_minor, | ||
474 | ver_release); | ||
475 | } | 479 | } |
480 | pr_info("Found gmux version %d.%d.%d [%s]\n", ver_major, ver_minor, | ||
481 | ver_release, (gmux_data->indexed ? "indexed" : "classic")); | ||
476 | 482 | ||
477 | memset(&props, 0, sizeof(props)); | 483 | memset(&props, 0, sizeof(props)); |
478 | props.type = BACKLIGHT_PLATFORM; | 484 | props.type = BACKLIGHT_PLATFORM; |
@@ -505,9 +511,7 @@ static int __devinit gmux_probe(struct pnp_dev *pnp, | |||
505 | * Disable the other backlight choices. | 511 | * Disable the other backlight choices. |
506 | */ | 512 | */ |
507 | acpi_video_dmi_promote_vendor(); | 513 | acpi_video_dmi_promote_vendor(); |
508 | #if defined (CONFIG_ACPI_VIDEO) || defined (CONFIG_ACPI_VIDEO_MODULE) | ||
509 | acpi_video_unregister(); | 514 | acpi_video_unregister(); |
510 | #endif | ||
511 | apple_bl_unregister(); | 515 | apple_bl_unregister(); |
512 | 516 | ||
513 | gmux_data->power_state = VGA_SWITCHEROO_ON; | 517 | gmux_data->power_state = VGA_SWITCHEROO_ON; |
@@ -593,9 +597,7 @@ static void __devexit gmux_remove(struct pnp_dev *pnp) | |||
593 | kfree(gmux_data); | 597 | kfree(gmux_data); |
594 | 598 | ||
595 | acpi_video_dmi_demote_vendor(); | 599 | acpi_video_dmi_demote_vendor(); |
596 | #if defined (CONFIG_ACPI_VIDEO) || defined (CONFIG_ACPI_VIDEO_MODULE) | ||
597 | acpi_video_register(); | 600 | acpi_video_register(); |
598 | #endif | ||
599 | apple_bl_register(); | 601 | apple_bl_register(); |
600 | } | 602 | } |
601 | 603 | ||
diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c index e38f91be0b10..4b568df56643 100644 --- a/drivers/platform/x86/asus-laptop.c +++ b/drivers/platform/x86/asus-laptop.c | |||
@@ -85,7 +85,7 @@ static char *wled_type = "unknown"; | |||
85 | static char *bled_type = "unknown"; | 85 | static char *bled_type = "unknown"; |
86 | 86 | ||
87 | module_param(wled_type, charp, 0444); | 87 | module_param(wled_type, charp, 0444); |
88 | MODULE_PARM_DESC(wlan_status, "Set the wled type on boot " | 88 | MODULE_PARM_DESC(wled_type, "Set the wled type on boot " |
89 | "(unknown, led or rfkill). " | 89 | "(unknown, led or rfkill). " |
90 | "default is unknown"); | 90 | "default is unknown"); |
91 | 91 | ||
@@ -863,9 +863,9 @@ static ssize_t show_infos(struct device *dev, | |||
863 | * The significance of others is yet to be found. | 863 | * The significance of others is yet to be found. |
864 | * If we don't find the method, we assume the device are present. | 864 | * If we don't find the method, we assume the device are present. |
865 | */ | 865 | */ |
866 | rv = acpi_evaluate_integer(asus->handle, "HRWS", NULL, &temp); | 866 | rv = acpi_evaluate_integer(asus->handle, "HWRS", NULL, &temp); |
867 | if (!ACPI_FAILURE(rv)) | 867 | if (!ACPI_FAILURE(rv)) |
868 | len += sprintf(page + len, "HRWS value : %#x\n", | 868 | len += sprintf(page + len, "HWRS value : %#x\n", |
869 | (uint) temp); | 869 | (uint) temp); |
870 | /* | 870 | /* |
871 | * Another value for userspace: the ASYM method returns 0x02 for | 871 | * Another value for userspace: the ASYM method returns 0x02 for |
@@ -1751,9 +1751,9 @@ static int asus_laptop_get_info(struct asus_laptop *asus) | |||
1751 | * The significance of others is yet to be found. | 1751 | * The significance of others is yet to be found. |
1752 | */ | 1752 | */ |
1753 | status = | 1753 | status = |
1754 | acpi_evaluate_integer(asus->handle, "HRWS", NULL, &hwrs_result); | 1754 | acpi_evaluate_integer(asus->handle, "HWRS", NULL, &hwrs_result); |
1755 | if (!ACPI_FAILURE(status)) | 1755 | if (!ACPI_FAILURE(status)) |
1756 | pr_notice(" HRWS returned %x", (int)hwrs_result); | 1756 | pr_notice(" HWRS returned %x", (int)hwrs_result); |
1757 | 1757 | ||
1758 | if (!acpi_check_handle(asus->handle, METHOD_WL_STATUS, NULL)) | 1758 | if (!acpi_check_handle(asus->handle, METHOD_WL_STATUS, NULL)) |
1759 | asus->have_rsts = true; | 1759 | asus->have_rsts = true; |
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index 2eb9fe8e8efd..c0e9ff489b24 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c | |||
@@ -47,9 +47,7 @@ | |||
47 | #include <linux/thermal.h> | 47 | #include <linux/thermal.h> |
48 | #include <acpi/acpi_bus.h> | 48 | #include <acpi/acpi_bus.h> |
49 | #include <acpi/acpi_drivers.h> | 49 | #include <acpi/acpi_drivers.h> |
50 | #ifdef CONFIG_ACPI_VIDEO | ||
51 | #include <acpi/video.h> | 50 | #include <acpi/video.h> |
52 | #endif | ||
53 | 51 | ||
54 | #include "asus-wmi.h" | 52 | #include "asus-wmi.h" |
55 | 53 | ||
@@ -1704,10 +1702,8 @@ static int asus_wmi_add(struct platform_device *pdev) | |||
1704 | if (asus->driver->quirks->wmi_backlight_power) | 1702 | if (asus->driver->quirks->wmi_backlight_power) |
1705 | acpi_video_dmi_promote_vendor(); | 1703 | acpi_video_dmi_promote_vendor(); |
1706 | if (!acpi_video_backlight_support()) { | 1704 | if (!acpi_video_backlight_support()) { |
1707 | #ifdef CONFIG_ACPI_VIDEO | ||
1708 | pr_info("Disabling ACPI video driver\n"); | 1705 | pr_info("Disabling ACPI video driver\n"); |
1709 | acpi_video_unregister(); | 1706 | acpi_video_unregister(); |
1710 | #endif | ||
1711 | err = asus_wmi_backlight_init(asus); | 1707 | err = asus_wmi_backlight_init(asus); |
1712 | if (err && err != -ENODEV) | 1708 | if (err && err != -ENODEV) |
1713 | goto fail_backlight; | 1709 | goto fail_backlight; |
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c index dab91b48d22c..5ca264179f4e 100644 --- a/drivers/platform/x86/eeepc-laptop.c +++ b/drivers/platform/x86/eeepc-laptop.c | |||
@@ -610,12 +610,12 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc, acpi_handle handle) | |||
610 | 610 | ||
611 | if (!bus) { | 611 | if (!bus) { |
612 | pr_warn("Unable to find PCI bus 1?\n"); | 612 | pr_warn("Unable to find PCI bus 1?\n"); |
613 | goto out_unlock; | 613 | goto out_put_dev; |
614 | } | 614 | } |
615 | 615 | ||
616 | if (pci_bus_read_config_dword(bus, 0, PCI_VENDOR_ID, &l)) { | 616 | if (pci_bus_read_config_dword(bus, 0, PCI_VENDOR_ID, &l)) { |
617 | pr_err("Unable to read PCI config space?\n"); | 617 | pr_err("Unable to read PCI config space?\n"); |
618 | goto out_unlock; | 618 | goto out_put_dev; |
619 | } | 619 | } |
620 | 620 | ||
621 | absent = (l == 0xffffffff); | 621 | absent = (l == 0xffffffff); |
@@ -627,7 +627,7 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc, acpi_handle handle) | |||
627 | absent ? "absent" : "present"); | 627 | absent ? "absent" : "present"); |
628 | pr_warn("skipped wireless hotplug as probably " | 628 | pr_warn("skipped wireless hotplug as probably " |
629 | "inappropriate for this model\n"); | 629 | "inappropriate for this model\n"); |
630 | goto out_unlock; | 630 | goto out_put_dev; |
631 | } | 631 | } |
632 | 632 | ||
633 | if (!blocked) { | 633 | if (!blocked) { |
@@ -635,7 +635,7 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc, acpi_handle handle) | |||
635 | if (dev) { | 635 | if (dev) { |
636 | /* Device already present */ | 636 | /* Device already present */ |
637 | pci_dev_put(dev); | 637 | pci_dev_put(dev); |
638 | goto out_unlock; | 638 | goto out_put_dev; |
639 | } | 639 | } |
640 | dev = pci_scan_single_device(bus, 0); | 640 | dev = pci_scan_single_device(bus, 0); |
641 | if (dev) { | 641 | if (dev) { |
@@ -650,6 +650,8 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc, acpi_handle handle) | |||
650 | pci_dev_put(dev); | 650 | pci_dev_put(dev); |
651 | } | 651 | } |
652 | } | 652 | } |
653 | out_put_dev: | ||
654 | pci_dev_put(port); | ||
653 | } | 655 | } |
654 | 656 | ||
655 | out_unlock: | 657 | out_unlock: |
diff --git a/drivers/platform/x86/samsung-laptop.c b/drivers/platform/x86/samsung-laptop.c index c1ca7bcebb66..dd90d15f5210 100644 --- a/drivers/platform/x86/samsung-laptop.c +++ b/drivers/platform/x86/samsung-laptop.c | |||
@@ -26,9 +26,7 @@ | |||
26 | #include <linux/seq_file.h> | 26 | #include <linux/seq_file.h> |
27 | #include <linux/debugfs.h> | 27 | #include <linux/debugfs.h> |
28 | #include <linux/ctype.h> | 28 | #include <linux/ctype.h> |
29 | #ifdef CONFIG_ACPI_VIDEO | ||
30 | #include <acpi/video.h> | 29 | #include <acpi/video.h> |
31 | #endif | ||
32 | 30 | ||
33 | /* | 31 | /* |
34 | * This driver is needed because a number of Samsung laptops do not hook | 32 | * This driver is needed because a number of Samsung laptops do not hook |
@@ -1558,9 +1556,7 @@ static int __init samsung_init(void) | |||
1558 | samsung->handle_backlight = false; | 1556 | samsung->handle_backlight = false; |
1559 | } else if (samsung->quirks->broken_acpi_video) { | 1557 | } else if (samsung->quirks->broken_acpi_video) { |
1560 | pr_info("Disabling ACPI video driver\n"); | 1558 | pr_info("Disabling ACPI video driver\n"); |
1561 | #ifdef CONFIG_ACPI_VIDEO | ||
1562 | acpi_video_unregister(); | 1559 | acpi_video_unregister(); |
1563 | #endif | ||
1564 | } | 1560 | } |
1565 | #endif | 1561 | #endif |
1566 | 1562 | ||
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 80e377949314..52daaa816e53 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c | |||
@@ -545,7 +545,7 @@ TPACPI_HANDLE(hkey, ec, "\\_SB.HKEY", /* 600e/x, 770e, 770x */ | |||
545 | */ | 545 | */ |
546 | 546 | ||
547 | static int acpi_evalf(acpi_handle handle, | 547 | static int acpi_evalf(acpi_handle handle, |
548 | void *res, char *method, char *fmt, ...) | 548 | int *res, char *method, char *fmt, ...) |
549 | { | 549 | { |
550 | char *fmt0 = fmt; | 550 | char *fmt0 = fmt; |
551 | struct acpi_object_list params; | 551 | struct acpi_object_list params; |
@@ -606,7 +606,7 @@ static int acpi_evalf(acpi_handle handle, | |||
606 | success = (status == AE_OK && | 606 | success = (status == AE_OK && |
607 | out_obj.type == ACPI_TYPE_INTEGER); | 607 | out_obj.type == ACPI_TYPE_INTEGER); |
608 | if (success && res) | 608 | if (success && res) |
609 | *(int *)res = out_obj.integer.value; | 609 | *res = out_obj.integer.value; |
610 | break; | 610 | break; |
611 | case 'v': /* void */ | 611 | case 'v': /* void */ |
612 | success = status == AE_OK; | 612 | success = status == AE_OK; |
@@ -7386,17 +7386,18 @@ static int fan_get_status(u8 *status) | |||
7386 | * Add TPACPI_FAN_RD_ACPI_FANS ? */ | 7386 | * Add TPACPI_FAN_RD_ACPI_FANS ? */ |
7387 | 7387 | ||
7388 | switch (fan_status_access_mode) { | 7388 | switch (fan_status_access_mode) { |
7389 | case TPACPI_FAN_RD_ACPI_GFAN: | 7389 | case TPACPI_FAN_RD_ACPI_GFAN: { |
7390 | /* 570, 600e/x, 770e, 770x */ | 7390 | /* 570, 600e/x, 770e, 770x */ |
7391 | int res; | ||
7391 | 7392 | ||
7392 | if (unlikely(!acpi_evalf(gfan_handle, &s, NULL, "d"))) | 7393 | if (unlikely(!acpi_evalf(gfan_handle, &res, NULL, "d"))) |
7393 | return -EIO; | 7394 | return -EIO; |
7394 | 7395 | ||
7395 | if (likely(status)) | 7396 | if (likely(status)) |
7396 | *status = s & 0x07; | 7397 | *status = res & 0x07; |
7397 | 7398 | ||
7398 | break; | 7399 | break; |
7399 | 7400 | } | |
7400 | case TPACPI_FAN_RD_TPEC: | 7401 | case TPACPI_FAN_RD_TPEC: |
7401 | /* all except 570, 600e/x, 770e, 770x */ | 7402 | /* all except 570, 600e/x, 770e, 770x */ |
7402 | if (unlikely(!acpi_ec_read(fan_status_offset, &s))) | 7403 | if (unlikely(!acpi_ec_read(fan_status_offset, &s))) |