diff options
Diffstat (limited to 'drivers/platform/x86/asus-wmi.c')
-rw-r--r-- | drivers/platform/x86/asus-wmi.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index 3c6ccedc82b6..21fc932da3a1 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c | |||
@@ -46,6 +46,7 @@ | |||
46 | #include <linux/platform_device.h> | 46 | #include <linux/platform_device.h> |
47 | #include <linux/thermal.h> | 47 | #include <linux/thermal.h> |
48 | #include <linux/acpi.h> | 48 | #include <linux/acpi.h> |
49 | #include <linux/dmi.h> | ||
49 | #include <acpi/video.h> | 50 | #include <acpi/video.h> |
50 | 51 | ||
51 | #include "asus-wmi.h" | 52 | #include "asus-wmi.h" |
@@ -554,7 +555,7 @@ static int asus_wmi_led_init(struct asus_wmi *asus) | |||
554 | goto error; | 555 | goto error; |
555 | } | 556 | } |
556 | 557 | ||
557 | if (wlan_led_presence(asus) && (asus->driver->quirks->wapf == 4)) { | 558 | if (wlan_led_presence(asus) && (asus->driver->quirks->wapf > 0)) { |
558 | INIT_WORK(&asus->wlan_led_work, wlan_led_update); | 559 | INIT_WORK(&asus->wlan_led_work, wlan_led_update); |
559 | 560 | ||
560 | asus->wlan_led.name = "asus::wlan"; | 561 | asus->wlan_led.name = "asus::wlan"; |
@@ -884,7 +885,7 @@ static int asus_new_rfkill(struct asus_wmi *asus, | |||
884 | return -EINVAL; | 885 | return -EINVAL; |
885 | 886 | ||
886 | if ((dev_id == ASUS_WMI_DEVID_WLAN) && | 887 | if ((dev_id == ASUS_WMI_DEVID_WLAN) && |
887 | (asus->driver->quirks->wapf == 4)) | 888 | (asus->driver->quirks->wapf > 0)) |
888 | rfkill_set_led_trigger_name(*rfkill, "asus-wlan"); | 889 | rfkill_set_led_trigger_name(*rfkill, "asus-wlan"); |
889 | 890 | ||
890 | rfkill_init_sw_state(*rfkill, !result); | 891 | rfkill_init_sw_state(*rfkill, !result); |
@@ -1270,10 +1271,7 @@ static int asus_wmi_backlight_init(struct asus_wmi *asus) | |||
1270 | int power; | 1271 | int power; |
1271 | 1272 | ||
1272 | max = read_brightness_max(asus); | 1273 | max = read_brightness_max(asus); |
1273 | 1274 | if (max < 0) | |
1274 | if (max == -ENODEV) | ||
1275 | max = 0; | ||
1276 | else if (max < 0) | ||
1277 | return max; | 1275 | return max; |
1278 | 1276 | ||
1279 | power = read_backlight_power(asus); | 1277 | power = read_backlight_power(asus); |
@@ -1734,6 +1732,7 @@ static int asus_wmi_add(struct platform_device *pdev) | |||
1734 | struct platform_driver *pdrv = to_platform_driver(pdev->dev.driver); | 1732 | struct platform_driver *pdrv = to_platform_driver(pdev->dev.driver); |
1735 | struct asus_wmi_driver *wdrv = to_asus_wmi_driver(pdrv); | 1733 | struct asus_wmi_driver *wdrv = to_asus_wmi_driver(pdrv); |
1736 | struct asus_wmi *asus; | 1734 | struct asus_wmi *asus; |
1735 | const char *chassis_type; | ||
1737 | acpi_status status; | 1736 | acpi_status status; |
1738 | int err; | 1737 | int err; |
1739 | u32 result; | 1738 | u32 result; |
@@ -1770,6 +1769,11 @@ static int asus_wmi_add(struct platform_device *pdev) | |||
1770 | if (err) | 1769 | if (err) |
1771 | goto fail_rfkill; | 1770 | goto fail_rfkill; |
1772 | 1771 | ||
1772 | /* Some Asus desktop boards export an acpi-video backlight interface, | ||
1773 | stop this from showing up */ | ||
1774 | chassis_type = dmi_get_system_info(DMI_CHASSIS_TYPE); | ||
1775 | if (chassis_type && !strcmp(chassis_type, "3")) | ||
1776 | acpi_video_dmi_promote_vendor(); | ||
1773 | if (asus->driver->quirks->wmi_backlight_power) | 1777 | if (asus->driver->quirks->wmi_backlight_power) |
1774 | acpi_video_dmi_promote_vendor(); | 1778 | acpi_video_dmi_promote_vendor(); |
1775 | if (!acpi_video_backlight_support()) { | 1779 | if (!acpi_video_backlight_support()) { |