aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/eeepc-wmi.c
Commit message (Collapse)AuthorAgeFilesLines
* eeepc: Use pr_warnJoe Perches2011-05-271-7/+7
| | | | | | | | Just a trivial pr_warning to pr_warn conversion while adding a few missing newlines. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: add keys found on EeePC 1215TCorentin Chary2011-04-011-0/+2
| | | | | Signed-off-by: Corentin Chary <corentin.chary@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: set the touchpad toggle key code to KEY_TOUCHPAD_TOGGLEKeng-Yu Lin2011-03-281-1/+1
| | | | | Signed-off-by: Keng-Yu Lin <keng-yu.lin@canonical.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: restore KEY_CAMERA_* keys lost in 190ca27Corentin Chary2011-03-281-0/+6
| | | | | Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* asus-wmi: minor cleanupsCorentin Chary2011-03-281-1/+1
| | | | | Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: asus generic asus-wmi.ko moduleCorentin Chary2011-03-281-0/+162
| | | | | | | | | | | | | | | | | | | New Asus notebooks are using a WMI device similar to the one used in Eee PCs. Since we don't want to load eeepc-wmi module on Asus notebooks, and we want to keep the eeepc-wmi module for backward compatibility, this patch introduce a new module, named asus-wmi, that will be used by eeepc-wmi and the new Asus Notebook WMI Driver. eeepc-wmi's input device strings (device name and phys) are kept, but rfkill and led names are changed (s/eeepc/asus/). This should not break anything since rfkill are used by type or index, not by name, and the eeepc::touchpad led wasn't working correctly before 2.6.39 anyway. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* asus-wmi: move generic code to asus-wmiCorentin Chary2011-03-281-1454/+0
| | | | | | | | | | New Asus notebooks are using a WMI device similar to the one used in Eee PCs. Since we don't want to load a module named eeepc-laptop on Asus Notebooks, start by copying all the code to asus-wmi.c. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: add camera keysCorentin Chary2011-03-281-0/+7
| | | | | | | | | These keys are supposed to be handled by any software using the camera (like webKam or cheese...). They can also be used to actually move the camera when possible. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: reorder device idsCorentin Chary2011-03-281-0/+11
| | | | | | | Each device seems to be in a "group" (devid >> 16 & 0xFF). Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: add touchpad sysfs fileCorentin Chary2011-03-281-0/+5
| | | | | Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: comments keymap to clarify the meaning of some keysCorentin Chary2011-03-281-3/+3
| | | | | | | Found while checking PDF manuals... Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: real touchpad led device id is 0x001000012Corentin Chary2011-03-281-6/+6
| | | | | Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: respect wireless_hotplug settingCorentin Chary2011-03-281-0/+3
| | | | | Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: support backlight power (bl_power) attributeCorentin Chary2011-03-281-14/+61
| | | | | Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: set the right key code for 0xe9Corentin Chary2011-03-281-1/+1
| | | | | | | | This key should power off the backlight, not the display, it is also used in acpi/video.c to do the same thing. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: add wimax supportCorentin Chary2011-03-281-1/+19
| | | | | Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: add camera and card reader supportCorentin Chary2011-03-281-1/+88
| | | | | Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: use the presence bit correctlyCorentin Chary2011-03-281-8/+5
| | | | | | | | | | I checked some more DSDT, and it seems that I wasn't totally right about the meaning of DSTS return value. Bit 0 is clearly the status of the device, and I discovered that bit 16 is set when the device is present. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: reorder definesCorentin Chary2011-03-281-9/+9
| | | | | Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: switch to platform_create_bundle()Corentin Chary2011-03-281-53/+22
| | | | | | | This allow to remove ~30 lines of code. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: add hibernate/resume callbacksCorentin Chary2011-03-281-0/+49
| | | | | Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: add an helper using simple return codesCorentin Chary2011-03-281-57/+39
| | | | | | | | | | eeepc_wmi_get_devstate returns an acpi_status, so each call need extra logic to handle the return code. This patch add a simple getter, returning a boolean (or a negative error code). Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: return proper error code in eeepc_rfkill_set()Corentin Chary2011-03-281-1/+7
| | | | | Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: serialize access to wmi methodCorentin Chary2011-03-281-6/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | \AMW0.WMBC, which is the main method that we use, is not reentrant. When wireless hotpluging is enabled, toggling the status of the wireless device using WMBC will trigger a notification and the notification handler need to call WMBC again to get the new status of the device, this will trigger the following error: ACPI Error (dswload-0802): [_T_0] Namespace lookup failure, AE_ALREADY_EXISTS ACPI Exception: AE_ALREADY_EXISTS, During name lookup/catalog (20100428/psloop-231) ACPI Error (psparse-0537): Method parse/execution failed [\AMW0.WMBC] (Node f7023b88), AE_ALREADY_EXISTS ACPI: Marking method WMBC as Serialized because of AE_ALREADY_EXISTS error Since there is currently no way to tell the acpi subsystem to mark a method as serialized, we do it in eeepc-wmi. Of course, we could let the first call fail, and then it would work, but it doesn't seems really clean, and it will make the first WMBC call return a random value. This patch was tested on EeePc 1000H with a RaLink RT2860 wireless card using the rt2800pci driver. rt2860sta driver seems to deadlock when we remove the pci device... Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: add hotplug code for Eeepc 1000HCorentin Chary2011-03-281-1/+273
| | | | | | | | | | | | | | Implement wireless like hotplug handling (code stolen from eeepc-laptop). Reminder: on some models rfkill is implemented by logically unplugging the wireless card from the PCI bus. Despite sending ACPI notifications, this does not appear to be implemented using standard ACPI hotplug - nor does the firmware provide the _OSC method required to support native PCIe hotplug. The only sensible choice appears to be to handle the hotplugging directly in the platform driver. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: add wlan key found on 1015PCorentin Chary2011-03-281-0/+1
| | | | | Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: reorder keymapCorentin Chary2011-03-281-7/+7
| | | | | Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: never load if legacy device is enabledCorentin Chary2011-01-071-0/+33
| | | | | | | | | | | | | | If legacy device (SB.ATKD - ASUS010) used by eeepc-laptop is enabled, don't allow eeepc-wmi to load because: - eeepc-laptop may be loaded, and can conflict with eeepc-wmi (they both try to register eeepc::touchpad led for example). - the WMI interface is inteded to be used when the OS is not detected as Win 7. And when this is the case, the ASUS010 device is disabled. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: remove unneeded staticCorentin Chary2011-01-071-3/+3
| | | | | Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: claim eeepc-wmi maintainershipCorentin Chary2011-01-071-0/+1
| | | | | | | | Since eeepc-wmi has currently no official maintainer, I claim maintainership of this driver, and add it to the acpi4asus project. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: fix confusion between ctrl_param and retvalCorentin Chary2011-01-071-17/+17
| | | | | Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: add debugfs entriesCorentin Chary2011-01-071-6/+164
| | | | | | | | | | | | | | eeepc-wmi/ - debugfs root directory dev_id - current dev_id ctrl_param - current ctrl_param devs - call DEVS(dev_id, ctrl_param) and print result dsts - call DSTS(dev_id) and print result DEVS and DSTS are the main functions used in eeepc-wmi, this will allow to test new features without patching the drivers. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: use attribute group to manage attributesCorentin Chary2011-01-071-12/+11
| | | | | Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: add rfkill support for wlan, bluetooth and 3gCorentin Chary2011-01-071-0/+138
| | | | | | | | | | wimax support is missing because I don't have any DSDT with WMI and wimax support. Most of the code comes from eeepc-laptop. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: add touchpad led supportCorentin Chary2011-01-071-0/+113
| | | | | | | Most of the code comes from eeepc-laptop. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: rework eeepc_wmi_init and eeepc_wmi_exitCorentin Chary2011-01-071-56/+79
| | | | | | | | | | | | | | | | | The old code was using platform_driver.probe to initialize eeepc_wmi context. That's a mistake because if probe fail, eeepc_platform_register() won't tell anyone, and chaos will happen. Wrap add and remove code inside eeepc_wmi_add() / eeepc_wmi_remove(), and try to use the static platform_device only in eeepc_wmi_init() and eeepc_wmi_exit() The code is now very similar to eeepc-laptop, except eeepc_laptop_add and eeepc_laptop_remove are called from acpi_driver, not module init/exit functions, but WMI doesn't provide such functionalities (yet ?). Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: fix compiler warningDmitry Torokhov2010-11-241-2/+2
| | | | | | | | | | This fixes the following: CC [M] drivers/platform/x86/eeepc-wmi.o drivers/platform/x86/eeepc-wmi.c:322: warning: initialization from incompatible pointer type Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: Add cpufv sysfs interfaceChris Bagwell2010-10-211-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | eeepc-laptop provides a sysfs interface to read and control what it calls cpufv. When WMI is enabled, the ACPI interface changes slightly and becames a write-only control with 3 valid values. Expose cpufv again to allow for user space utils that can extended battery life noticably and come a little closer to parity with eeepc-laptop. Write-only is OK for most user space apps because read status was mostly used to prevent unneeded mode changes. Since this same check to ignore changes to same mode also exists in the DSDT then it was wasted ACPI call. acpi_osi="!Windows 2009" can be used for get back eeepc-laptop's read support of cpufv for debugging things such as behaviour during resume. This patch was tested with EEE PC 1005PE by monitoring powertop output while writing values of "0", "1", and "2" and by reviewing the decompiled DSDT of an 1201NL and comparing it to 1005PE's DSDT. Signed-off-by: Chris Bagwell <chris@cnpbagwell.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: add additional hotkeysChris Bagwell2010-10-211-0/+5
| | | | | | | | | | | | | Added 4 hotkeys using same keymap values as eeepc-latop. These are mousepad toggle, resolution change, screen off, and task manager. These were tested on 1005PE and are the Fn-F3, F4, F7, and F9, respectively. Also, added a new hot key for power toggles (Fn-Space on 1005PE) and is meant to drive cpufv interface from userspace. Signed-off-by: Chris Bagwell <chris@cnpbagwell.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* drivers/platform/x86/eeepc-wmi.c: fix build warningDaniel Mack2010-05-201-1/+1
| | | | | | | | | | | | | | | | drivers/platform/x86/eeepc-wmi.c: In function ‘eeepc_wmi_notify’: drivers/platform/x86/eeepc-wmi.c:209: warning: ‘new’ may be used uninitialized in this function drivers/platform/x86/eeepc-wmi.c:209: note: ‘new’ was declared here Signed-off-by: Daniel Mack <daniel@caiaq.de> Cc: Matthew Garrett <mjg@redhat.com> Cc: Yong Wang <yong.y.wang@intel.com> Cc: Corentin Chary <corentincj@iksaif.net> Cc: Dmitry Torokhov <dtor@mail.ru> Cc: Tejun Heo <tj@kernel.org> Cc: platform-driver-x86@vger.kernel.org Acked-By: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: add backlight supportYong Wang2010-04-121-35/+197
| | | | | | | | Add backlight support for WMI based Eee PC laptops. Signed-off-by: Yong Wang <yong.y.wang@intel.com> Signed-off-by: Matthew Garrett <mjg@redhat.com> Reviewed-by: Corentin Chary <corentincj@iksaif.net>
* eeepc-wmi: use a platform device as parent device of all sub-devicesYong Wang2010-04-121-16/+86
| | | | | | | | Add a platform device and use it as the parent device of all sub-devices. Signed-off-by: Yong Wang <yong.y.wang@intel.com> Signed-off-by: Matthew Garrett <mjg@redhat.com> Reviewed-by: Corentin Chary <corentincj@iksaif.net>
* eeepc-wmi: add an eeepc_wmi context structureYong Wang2010-04-121-23/+46
| | | | | | | | | Add an eeepc_wmi context structure to manage all the sub-devices that will be implemented later on. Put input device into it first. Signed-off-by: Yong Wang <yong.y.wang@intel.com> Signed-off-by: Matthew Garrett <mjg@redhat.com> Reviewed-by: Corentin Chary <corentincj@iksaif.net>
* eeepc-wmi: include slab.hTejun Heo2010-04-051-0/+1
| | | | | | | eeepc-wmi uses kfree() but doesn't include slab.h. Include it. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Yong Wang <yong.y.wang@intel.com>
* eeepc-wmi: new driver for WMI based hotkeys on Eee PC laptopsYong Wang2010-03-311-0/+157
Add a WMI driver for Eee PC laptops. Currently it only supports hotkeys. Signed-off-by: Yong Wang <yong.y.wang@intel.com> Signed-off-by: Matthew Garrett <mjg@redhat.com> Acked-by: Dmitry Torokhov <dtor@mail.ru>