Commit 605f884d authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86

Pull x86 platform driver updates from Matthew Garrett:
 "A moderate number of changes, but nothing awfully significant.

  A lot of const cleanups, some reworking and additions to the rfkill
  quirks in the asus driver, a new driver for generating falling laptop
  events on Toshibas and some misc fixes.

  Maybe vendors have stopped inventing things"

* 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86: (41 commits)
  platform/x86: Enable build support for toshiba_haps
  Documentation: Add file about toshiba_haps module
  platform/x86: Toshiba HDD Active Protection Sensor
  asus-nb-wmi: Add wapf4 quirk for the U32U
  alienware-wmi: make hdmi_mux enabled on case-by-case basis
  ideapad-laptop: Constify DMI table and other r/o variables
  asus-nb-wmi.c: Rename x401u quirk to wapf4
  compal-laptop: correct invalid hwmon name
  toshiba_acpi: Add Qosmio X75-A to the alt keymap dmi list
  toshiba_acpi: Add extra check to backlight code
  Fix log message about future removal of interface
  ideapad-laptop: Disable touchpad interface on Yoga models
  asus-nb-wmi: Add wapf4 quirk for the X550CC
  intel_ips: Make ips_mcp_limits variables static
  thinkpad_acpi: Mark volume_alsa_control_{vol,mute} as __initdata
  fujitsu-laptop: Mark fujitsu_dmi_table[] DMI table as __initconst
  hp-wmi: Add missing __init annotations to initialization code
  hp_accel: Constify ACPI and DMI tables
  fujitsu-tablet: Mark DMI callbacks as __init code
  dell-laptop: Mark dell_quirks[] DMI table as __initconst
  ...
parents 49899007 186e4e89
......@@ -18,3 +18,5 @@ sonypi.txt
- info on Linux Sony Programmable I/O Device support.
thinkpad-acpi.txt
- information on the (IBM and Lenovo) ThinkPad ACPI Extras driver.
toshiba_haps.txt
- information on the Toshiba HDD Active Protection Sensor driver.
Kernel driver toshiba_haps
Toshiba HDD Active Protection Sensor
====================================
Author: Azael Avalos <coproscefalo@gmail.com>
0. Contents
-----------
1. Description
2. Interface
3. Accelerometer axes
4. Supported devices
5. Usage
1. Description
--------------
This driver provides support for the accelerometer found in various Toshiba
laptops, being called "Toshiba HDD Protection - Shock Sensor" officialy,
and detects laptops automatically with this device.
On Windows, Toshiba provided software monitors this device and provides
automatic HDD protection (head unload) on sudden moves or harsh vibrations,
however, this driver only provides a notification via a sysfs file to let
userspace tools or daemons act accordingly, as well as providing a sysfs
file to set the desired protection level or sensor sensibility.
2. Interface
------------
This device comes with 3 methods:
_STA - Checks existence of the device, returning Zero if the device does not
exists or is not supported.
PTLV - Sets the desired protection level.
RSSS - Shuts down the HDD protection interface for a few seconds,
then restores normal operation.
Note:
The presence of Solid State Drives (SSD) can make this driver to fail loading,
given the fact that such drives have no movable parts, and thus, not requiring
any "protection" as well as failing during the evaluation of the _STA method
found under this device.
3. Accelerometer axes
---------------------
This device does not report any axes, however, to query the sensor position
a couple HCI (Hardware Configuration Interface) calls (0x6D and 0xA6) are
provided to query such information, handled by the kernel module toshiba_acpi
since kernel version 3.15.
4. Supported devices
--------------------
This driver binds itself to the ACPI device TOS620A, and any Toshiba laptop
with this device is supported, given the fact that they have the presence of
conventional HDD and not only SSD, or a combination of both HDD and SSD.
5. Usage
--------
The sysfs files under /sys/devices/LNXSYSTM:00/LNXSYBUS:00/TOS620A:00/ are:
protection_level - The protection_level is readable and writeable, and
provides a way to let userspace query the current protection
level, as well as set the desired protection level, the
available protection levels are:
0 - Disabled | 1 - Low | 2 - Medium | 3 - High
reset_protection - The reset_protection entry is writeable only, being "1"
the only parameter it accepts, it is used to trigger
a reset of the protection interface.
......@@ -10017,7 +10017,7 @@ F: arch/x86/
X86 PLATFORM DRIVERS
M: Matthew Garrett <matthew.garrett@nebula.com>
L: platform-driver-x86@vger.kernel.org
T: git git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platform-drivers-x86.git
T: git git://cavan.codon.org.uk/platform-drivers-x86.git
S: Maintained
F: drivers/platform/x86/
......
......@@ -652,6 +652,25 @@ config TOSHIBA_BT_RFKILL
If you have a modern Toshiba laptop with a Bluetooth and an
RFKill switch (such as the Portege R500), say Y.
config TOSHIBA_HAPS
tristate "Toshiba HDD Active Protection Sensor"
depends on ACPI
---help---
This driver adds support for the built-in accelerometer
found on recent Toshiba laptops equiped with HID TOS620A
device.
This driver receives ACPI notify events 0x80 when the sensor
detects a sudden move or a harsh vibration, as well as an
ACPI notify event 0x81 whenever the movement or vibration has
been stabilized.
Also provides sysfs entries to get/set the desired protection
level and reseting the HDD protection interface.
If you have a recent Toshiba laptop with a built-in accelerometer
device, say Y.
config ACPI_CMPC
tristate "CMPC Laptop Extras"
depends on X86 && ACPI
......
......@@ -38,6 +38,7 @@ obj-$(CONFIG_TOPSTAR_LAPTOP) += topstar-laptop.o
obj-$(CONFIG_ACPI_TOSHIBA) += toshiba_acpi.o
obj-$(CONFIG_TOSHIBA_BT_RFKILL) += toshiba_bluetooth.o
obj-$(CONFIG_TOSHIBA_HAPS) += toshiba_haps.o
obj-$(CONFIG_INTEL_SCU_IPC) += intel_scu_ipc.o
obj-$(CONFIG_INTEL_SCU_IPC_UTIL) += intel_scu_ipcutil.o
obj-$(CONFIG_INTEL_MFLD_THERMAL) += intel_mid_thermal.o
......
......@@ -96,7 +96,7 @@ enum acer_wmi_event_ids {
WMID_ACCEL_EVENT = 0x5,
};
static const struct key_entry acer_wmi_keymap[] = {
static const struct key_entry acer_wmi_keymap[] __initconst = {
{KE_KEY, 0x01, {KEY_WLAN} }, /* WiFi */
{KE_KEY, 0x03, {KEY_WLAN} }, /* WiFi */
{KE_KEY, 0x04, {KEY_WLAN} }, /* WiFi */
......@@ -294,7 +294,7 @@ struct quirk_entry {
static struct quirk_entry *quirks;
static void set_quirks(void)
static void __init set_quirks(void)
{
if (!interface)
return;
......@@ -306,7 +306,7 @@ static void set_quirks(void)
interface->capability |= ACER_CAP_BRIGHTNESS;
}
static int dmi_matched(const struct dmi_system_id *dmi)
static int __init dmi_matched(const struct dmi_system_id *dmi)
{
quirks = dmi->driver_data;
return 1;
......@@ -337,7 +337,7 @@ static struct quirk_entry quirk_lenovo_ideapad_s205 = {
};
/* The Aspire One has a dummy ACPI-WMI interface - disable it */
static struct dmi_system_id acer_blacklist[] = {
static const struct dmi_system_id acer_blacklist[] __initconst = {
{
.ident = "Acer Aspire One (SSD)",
.matches = {
......@@ -355,7 +355,7 @@ static struct dmi_system_id acer_blacklist[] = {
{}
};
static struct dmi_system_id acer_quirks[] = {
static const struct dmi_system_id acer_quirks[] __initconst = {
{
.callback = dmi_matched,
.ident = "Acer Aspire 1360",
......@@ -530,14 +530,15 @@ static struct dmi_system_id acer_quirks[] = {
{}
};
static int video_set_backlight_video_vendor(const struct dmi_system_id *d)
static int __init
video_set_backlight_video_vendor(const struct dmi_system_id *d)
{
interface->capability &= ~ACER_CAP_BRIGHTNESS;
pr_info("Brightness must be controlled by generic video driver\n");
return 0;
}
static const struct dmi_system_id video_vendor_dmi_table[] = {
static const struct dmi_system_id video_vendor_dmi_table[] __initconst = {
{
.callback = video_set_backlight_video_vendor,
.ident = "Acer TravelMate 4750",
......@@ -582,7 +583,7 @@ static const struct dmi_system_id video_vendor_dmi_table[] = {
};
/* Find which quirks are needed for a particular vendor/ model pair */
static void find_quirks(void)
static void __init find_quirks(void)
{
if (!force_series) {
dmi_check_system(acer_quirks);
......@@ -749,7 +750,7 @@ static acpi_status AMW0_set_u32(u32 value, u32 cap)
return wmab_execute(&args, NULL);
}
static acpi_status AMW0_find_mailled(void)
static acpi_status __init AMW0_find_mailled(void)
{
struct wmab_args args;
struct wmab_ret ret;
......@@ -781,16 +782,16 @@ static acpi_status AMW0_find_mailled(void)
return AE_OK;
}
static int AMW0_set_cap_acpi_check_device_found;
static int AMW0_set_cap_acpi_check_device_found __initdata;
static acpi_status AMW0_set_cap_acpi_check_device_cb(acpi_handle handle,
static acpi_status __init AMW0_set_cap_acpi_check_device_cb(acpi_handle handle,
u32 level, void *context, void **retval)
{
AMW0_set_cap_acpi_check_device_found = 1;
return AE_OK;
}
static const struct acpi_device_id norfkill_ids[] = {
static const struct acpi_device_id norfkill_ids[] __initconst = {
{ "VPC2004", 0},
{ "IBM0068", 0},
{ "LEN0068", 0},
......@@ -798,7 +799,7 @@ static const struct acpi_device_id norfkill_ids[] = {
{ "", 0},
};
static int AMW0_set_cap_acpi_check_device(void)
static int __init AMW0_set_cap_acpi_check_device(void)
{
const struct acpi_device_id *id;
......@@ -808,7 +809,7 @@ static int AMW0_set_cap_acpi_check_device(void)
return AMW0_set_cap_acpi_check_device_found;
}
static acpi_status AMW0_set_capabilities(void)
static acpi_status __init AMW0_set_capabilities(void)
{
struct wmab_args args;
struct wmab_ret ret;
......@@ -1184,7 +1185,7 @@ static acpi_status wmid_v2_set_u32(u32 value, u32 cap)
return wmid3_set_device_status(value, device);
}
static void type_aa_dmi_decode(const struct dmi_header *header, void *dummy)
static void __init type_aa_dmi_decode(const struct dmi_header *header, void *d)
{
struct hotkey_function_type_aa *type_aa;
......@@ -1209,7 +1210,7 @@ static void type_aa_dmi_decode(const struct dmi_header *header, void *dummy)
commun_fn_key_number = type_aa->commun_fn_key_number;
}
static acpi_status WMID_set_capabilities(void)
static acpi_status __init WMID_set_capabilities(void)
{
struct acpi_buffer out = {ACPI_ALLOCATE_BUFFER, NULL};
union acpi_object *obj;
......@@ -1658,7 +1659,7 @@ static ssize_t show_bool_threeg(struct device *dev,
u32 result; \
acpi_status status;
pr_info("This threeg sysfs will be removed in 2012 - used by: %s\n",
pr_info("This threeg sysfs will be removed in 2014 - used by: %s\n",
current->comm);
status = get_u32(&result, ACER_CAP_THREEG);
if (ACPI_SUCCESS(status))
......@@ -1671,7 +1672,7 @@ static ssize_t set_bool_threeg(struct device *dev,
{
u32 tmp = simple_strtoul(buf, NULL, 10);
acpi_status status = set_u32(tmp, ACER_CAP_THREEG);
pr_info("This threeg sysfs will be removed in 2012 - used by: %s\n",
pr_info("This threeg sysfs will be removed in 2014 - used by: %s\n",
current->comm);
if (ACPI_FAILURE(status))
return -EINVAL;
......@@ -1683,7 +1684,7 @@ static DEVICE_ATTR(threeg, S_IRUGO | S_IWUSR, show_bool_threeg,
static ssize_t show_interface(struct device *dev, struct device_attribute *attr,
char *buf)
{
pr_info("This interface sysfs will be removed in 2012 - used by: %s\n",
pr_info("This interface sysfs will be removed in 2014 - used by: %s\n",
current->comm);
switch (interface->type) {
case ACER_AMW0:
......@@ -1777,7 +1778,7 @@ static void acer_wmi_notify(u32 value, void *context)
}
}
static acpi_status
static acpi_status __init
wmid3_set_lm_mode(struct lm_input_params *params,
struct lm_return_value *return_value)
{
......@@ -1811,7 +1812,7 @@ wmid3_set_lm_mode(struct lm_input_params *params,
return status;
}
static int acer_wmi_enable_ec_raw(void)
static int __init acer_wmi_enable_ec_raw(void)
{
struct lm_return_value return_value;
acpi_status status;
......@@ -1834,7 +1835,7 @@ static int acer_wmi_enable_ec_raw(void)
return status;
}
static int acer_wmi_enable_lm(void)
static int __init acer_wmi_enable_lm(void)
{
struct lm_return_value return_value;
acpi_status status;
......@@ -2043,6 +2044,7 @@ static int acer_platform_remove(struct platform_device *device)
return 0;
}
#ifdef CONFIG_PM_SLEEP
static int acer_suspend(struct device *dev)
{
u32 value;
......@@ -2083,6 +2085,10 @@ static int acer_resume(struct device *dev)
return 0;
}
#else
#define acer_suspend NULL
#define acer_resume NULL
#endif
static SIMPLE_DEV_PM_OPS(acer_pm, acer_suspend, acer_resume);
......@@ -2120,7 +2126,7 @@ static int remove_sysfs(struct platform_device *device)
return 0;
}
static int create_sysfs(void)
static int __init create_sysfs(void)
{
int retval = -ENOMEM;
......@@ -2149,7 +2155,7 @@ static void remove_debugfs(void)
debugfs_remove(interface->debug.root);
}
static int create_debugfs(void)
static int __init create_debugfs(void)
{
interface->debug.root = debugfs_create_dir("acer-wmi", NULL);
if (!interface->debug.root) {
......
......@@ -59,25 +59,33 @@ enum WMAX_CONTROL_STATES {
struct quirk_entry {
u8 num_zones;
u8 hdmi_mux;
};
static struct quirk_entry *quirks;
static struct quirk_entry quirk_unknown = {
.num_zones = 2,
.hdmi_mux = 0,
};
static struct quirk_entry quirk_x51_family = {
.num_zones = 3,
.hdmi_mux = 0.
};
static int dmi_matched(const struct dmi_system_id *dmi)
static struct quirk_entry quirk_asm100 = {
.num_zones = 2,
.hdmi_mux = 1,
};
static int __init dmi_matched(const struct dmi_system_id *dmi)
{
quirks = dmi->driver_data;
return 1;
}
static struct dmi_system_id alienware_quirks[] = {
static const struct dmi_system_id alienware_quirks[] __initconst = {
{
.callback = dmi_matched,
.ident = "Alienware X51 R1",
......@@ -96,6 +104,15 @@ static struct dmi_system_id alienware_quirks[] = {
},
.driver_data = &quirk_x51_family,
},
{
.callback = dmi_matched,
.ident = "Alienware ASM100",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
DMI_MATCH(DMI_PRODUCT_NAME, "ASM100"),
},
.driver_data = &quirk_asm100,
},
{}
};
......@@ -537,7 +554,8 @@ static struct attribute_group hdmi_attribute_group = {
static void remove_hdmi(struct platform_device *dev)
{
sysfs_remove_group(&dev->dev.kobj, &hdmi_attribute_group);
if (quirks->hdmi_mux > 0)
sysfs_remove_group(&dev->dev.kobj, &hdmi_attribute_group);
}
static int create_hdmi(struct platform_device *dev)
......@@ -583,7 +601,7 @@ static int __init alienware_wmi_init(void)
if (ret)
goto fail_platform_device2;
if (interface == WMAX) {
if (quirks->hdmi_mux > 0) {
ret = create_hdmi(platform_device);
if (ret)
goto fail_prep_hdmi;
......
......@@ -70,17 +70,35 @@ static struct quirk_entry quirk_asus_x55u = {
.no_display_toggle = true,
};
static struct quirk_entry quirk_asus_x401u = {
static struct quirk_entry quirk_asus_wapf4 = {
.wapf = 4,
};
static struct quirk_entry quirk_asus_x200ca = {
.wapf = 2,
};
static int dmi_matched(const struct dmi_system_id *dmi)
{
quirks = dmi->driver_data;
return 1;
}
static struct dmi_system_id asus_quirks[] = {
static const struct dmi_system_id asus_quirks[] = {
{
.callback = dmi_matched,
.ident = "ASUSTeK COMPUTER INC. U32U",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."),
DMI_MATCH(DMI_PRODUCT_NAME, "U32U"),
},
/*
* Note this machine has a Brazos APU, and most Brazos Asus
* machines need quirk_asus_x55u / wmi_backlight_power but
* here acpi-video seems to work fine for backlight control.
*/
.driver_data = &quirk_asus_wapf4,
},
{
.callback = dmi_matched,
.ident = "ASUSTeK COMPUTER INC. X401U",
......@@ -97,7 +115,7 @@ static struct dmi_system_id asus_quirks[] = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "X401A"),
},
.driver_data = &quirk_asus_x401u,
.driver_data = &quirk_asus_wapf4,
},
{
.callback = dmi_matched,
......@@ -106,7 +124,7 @@ static struct dmi_system_id asus_quirks[] = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "X401A1"),
},
.driver_data = &quirk_asus_x401u,
.driver_data = &quirk_asus_wapf4,
},
{
.callback = dmi_matched,
......@@ -124,7 +142,7 @@ static struct dmi_system_id asus_quirks[] = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "X501A"),
},
.driver_data = &quirk_asus_x401u,
.driver_data = &quirk_asus_wapf4,
},
{
.callback = dmi_matched,
......@@ -133,7 +151,7 @@ static struct dmi_system_id asus_quirks[] = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "X501A1"),
},
.driver_data = &quirk_asus_x401u,
.driver_data = &quirk_asus_wapf4,
},
{
.callback = dmi_matched,
......@@ -142,7 +160,25 @@ static struct dmi_system_id asus_quirks[] = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "X550CA"),
},
.driver_data = &quirk_asus_x401u,
.driver_data = &quirk_asus_wapf4,
},
{
.callback = dmi_matched,
.ident = "ASUSTeK COMPUTER INC. X550CC",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "X550CC"),
},
.driver_data = &quirk_asus_wapf4,
},
{
.callback = dmi_matched,
.ident = "ASUSTeK COMPUTER INC. X550CL",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "X550CL"),
},
.driver_data = &quirk_asus_wapf4,
},
{
.callback = dmi_matched,
......@@ -151,7 +187,7 @@ static struct dmi_system_id asus_quirks[] = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "X55A"),
},
.driver_data = &quirk_asus_x401u,
.driver_data = &quirk_asus_wapf4,
},
{
.callback = dmi_matched,
......@@ -160,7 +196,7 @@ static struct dmi_system_id asus_quirks[] = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "X55C"),
},
.driver_data = &quirk_asus_x401u,
.driver_data = &quirk_asus_wapf4,
},
{
.callback = dmi_matched,
......@@ -178,7 +214,7 @@ static struct dmi_system_id asus_quirks[] = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "X55VD"),
},
.driver_data = &quirk_asus_x401u,
.driver_data = &quirk_asus_wapf4,
},
{
.callback = dmi_matched,
......@@ -187,7 +223,16 @@ static struct dmi_system_id asus_quirks[] = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "X75A"),
},
.driver_data = &quirk_asus_x401u,
.driver_data = &quirk_asus_wapf4,
},
{
.callback = dmi_matched,
.ident = "ASUSTeK COMPUTER INC. X75VBP",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "X75VBP"),
},
.driver_data = &quirk_asus_wapf4,
},
{
.callback = dmi_matched,
......@@ -196,7 +241,7 @@ static struct dmi_system_id asus_quirks[] = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "1015E"),
},
.driver_data = &quirk_asus_x401u,
.driver_data = &quirk_asus_wapf4,
},
{
.callback = dmi_matched,
......@@ -205,7 +250,16 @@ static struct dmi_system_id asus_quirks[] = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "1015U"),
},
.driver_data = &quirk_asus_x401u,
.driver_data = &quirk_asus_wapf4,
},
{
.callback = dmi_matched,
.ident = "ASUSTeK COMPUTER INC. X200CA",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "X200CA"),
},
.driver_data = &quirk_asus_x200ca,
},
{},
};
......
......@@ -46,6 +46,7 @@
#include <linux/platform_device.h>
#include <linux/thermal.h>
#include <linux/acpi.h>
#include <linux/dmi.h>
#include <acpi/video.h>
#include "asus-wmi.h"
......@@ -554,7 +555,7 @@ static int asus_wmi_led_init(struct asus_wmi *asus)
goto error;
}
if (wlan_led_presence(asus) && (asus->driver->quirks->wapf == 4)) {
if (wlan_led_presence(asus) && (asus->driver->quirks->wapf > 0)) {
INIT_WORK(&asus->wlan_led_work, wlan_led_update);
asus->wlan_led.name = "asus::wlan";
......@@ -884,7 +885,7 @@ static int asus_new_rfkill(struct asus_wmi *asus,
return -EINVAL;
if ((dev_id == ASUS_WMI_DEVID_WLAN) &&
(asus->driver->quirks->wapf == 4))
(asus->driver->quirks->wapf > 0))
rfkill_set_led_trigger_name(*rfkill, "asus-wlan");
rfkill_init_sw_state(*rfkill, !result);
......@@ -1270,10 +1271,7 @@ static int asus_wmi_backlight_init(struct asus_wmi *asus)
int power;
max = read_brightness_max(asus);
if (max == -ENODEV)
max = 0;
else if (max < 0)
if (max < 0)
return max;
power = read_backlight_power(asus);
......@@ -1734,6 +1732,7 @@ static int asus_wmi_add(struct platform_device *pdev)
struct platform_driver *pdrv = to_platform_driver(pdev->dev.driver);
struct asus_wmi_driver *wdrv = to_asus_wmi_driver(pdrv);
struct asus_wmi *asus;
const char *chassis_type;
acpi_status status;