summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* asus-nb-wmi: Asus Notebooks WMI DriverCorentin Chary2011-03-284-28/+117
| | | | | | | | | | | | | | | | Introduce a new driver for Asus Notebooks shipped with a WMI device instead of the old ACPI device. The WMI device is almost the same as the one present in Eee PC, but the event guid and the keymap are different. The keymap comes from asus-laptop module. On Asus notebooks, when you call the WMI device, you always need a 64bit buffer, even if you only want to get the state of a device (tested on a G73). Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* asus-wmi: allow debugfs interface to call arbitrary methodCorentin Chary2011-03-281-2/+45
| | | | | | | Also add some # format flags to debugfs output. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* asus-wmi: add calls to INIT, SPEC and SFUN on initCorentin Chary2011-03-281-0/+28
| | | | | | | | | INIT() call is needed to enable hotkeys on G73 SPEC() and SFUN() allow us to know more about available features. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* asus-wmi: fix and clean backlight codeCorentin Chary2011-03-281-15/+29
| | | | | Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* asus-wmi: try to guess the right DSTS methodsCorentin Chary2011-03-281-33/+66
| | | | | | | | | | | | | | | | This is tricky, new WMI aware notebooks seems to use 0x53545344 while Eee PCs are using 0x53544344. But there is no way to know if there is an Eee PC in that wild that is using 0x53545344 or a notebook using 0x53544344. So the driver try to guess the available DSTS method ... But most Eee PCs never return 0xFFFFFFFE when a method is not available, they return 0 instead (and that's useless). So, first, try 0x53544344 then 0x53545344. We will find a better way when we got more data. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* asus-wmi: factorise wmi_evaluate_method callCorentin Chary2011-03-281-97/+65
| | | | | | | | | | | | | | This patch create a single function to call the WMI methods. This function handle inexistent methods (when implemented by the WMI devices, and this is not the case on Eee PCs), ACPI errors, etc.. Also pack struct bios_arg, and make sure that we always send a 64bit buffer when calling a WMI method, because this is needed on Asus notebooks. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* asus-wmi: handle "unknown status" bitCorentin Chary2011-03-281-0/+6
| | | | | Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* asus-wmi: introduce struct asus_rfkillCorentin Chary2011-03-281-56/+59
| | | | | | | | | First, this allow use to remove the custom asusrfkill_wlan_query, but this will also allow us to give struct asus_wmi * to get_devstate/set_devstate later. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* asus-wmi: minor cleanupsCorentin Chary2011-03-282-18/+18
| | | | | 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-286-498/+681
| | | | | | | | | | | | | | | | | | | 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-282-1/+1
| | | | | | | | | | 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>
* medfield: Add Thermal DriverDurgadoss R2011-03-283-1/+584
| | | | | | | | | | This is the basic thermal sensor driver for Intel MID platform using the Medfield chipset. It plugs in via the thermal drivers and provides sensor readings for the device sensors. Signed-off-by: Durgadoss R <durgadoss.r@intel.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* hp-wmi: add rfkill support for wireless query 0x1bAnssi Hannula2011-03-281-1/+187
| | | | | | | | | Some recent HP laptops use a new wireless query command type 0x1b. Add support for it. Tested on HP Mini 5102. Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* hp-wmi: make rfkill initialization failure non-fatalAnssi Hannula2011-03-281-3/+1
| | | | | | | | hp_wmi_rfkill_setup cleans up after itself now, so failing completely is no longer necessary. Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* hp-wmi: clear rfkill device pointers when appropriateAnssi Hannula2011-03-281-0/+8
| | | | | | | | | | | NULLify rfkill pointers during initialization. This prevents dereference of invalid pointer in case the driver is rebound and some rfkill device isn't detected anymore. Clear them also in hp_wmi_rfkill_setup failure path so that an rfkill initialization failure doesn't need to be fatal for the whole driver. Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* hp-wmi: split rfkill initialization out of hp_wmi_bios_setupAnssi Hannula2011-03-281-17/+29
| | | | | | | | | Split initialization of rfkill devices from hp_wmi_bios_setup() to hp_wmi_rfkill_setup(). This makes the code somewhat cleaner, especially with the future command 0x1b rfkill support. Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* hp-wmi: allow setting input and output buffer sizes separatelyAnssi Hannula2011-03-281-24/+39
| | | | | | | | | | | | | | | | Split buffersize parameter of hp_wmi_perform_query to insize and outsize. Existing callers are changed to use the same value for insize and outsize to avoid any regressions, with the exception of hp_wmi_set_block where the output buffer is unused and therefore outsize is set to 0 (this change is not seen by BIOS code). The maximum input buffer size is kept at 4 bytes as per struct bios_args. Some commands exist that take longer buffers, but they haven't been implemented. The data portion of bios_args can be trivially made dynamically allocated later when such larger buffers become needed. Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* hp-wmi: remove a variable that is never readAnssi Hannula2011-03-281-2/+1
| | | | | | | | | | Remove the status variable from hp_wmi_perform_query which holds the return value from wmi_evaluate_method(). It is never checked as the function bails out if the output buffer hasn't been allocated which indicates the call failed. Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* hp-wmi: check query return value in hp_wmi_perform_queryAnssi Hannula2011-03-281-0/+16
| | | | | | | | | Check BIOS provided return value code in hp_wmi_perform_query and print a warning on error. Printing is suppressed for HPWMI_RET_UNKNOWN_CMDTYPE which is returned when the command type is unsupported. Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* sony-laptop: implement new backlight control methodMattia Dongili2011-03-281-30/+79
| | | | | | | | | | Reasonably recent Vaios have a 0x12f or 0x137 handler that exposes a fine lid backlight regulation with values ranging from 0 to 255. The patch is based on findings and code from Javier Achirica <achirica@gmail.com> and Marco Chiappero <marco@absence.it> Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* sony-laptop: implement keyboard backlight supportMattia Dongili2011-03-281-1/+175
| | | | | | | | | | | Recent Vaios have the opportunity to control the keyboard backlight via ACPI calls to the SNC device. Introduce two module parameters to control how keyboard backlight should be set at module loading (default to on and with 10 seconds timeout). Tested-by: Marco Chiappero <marco@absence.it> Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* sony-laptop: cache handles and report them via sysfsMattia Dongili2011-03-281-16/+81
| | | | | | | | | | Avoid calling into acpi each time we need to lookup a method handle and report the available handles to ease collection of information when debugging issues. Also move initialization of the platform driver earlier to allow adding files from other setup functions. Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* sony-laptop: remove unused Type4 defineMattia Dongili2011-03-281-1/+0
| | | | | Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* sony-laptop: use pr_<level> for messagesMattia Dongili2011-03-281-54/+46
| | | | | Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* sony-laptop: ignore hard switch rfkill events (SPIC)Mattia Dongili2011-03-282-3/+6
| | | | | | | | | | There is not much use for these events in userspace and handling the events themselves seems to get in the way of the actual activation of the rf devices. The SNC device doesn't expose them already. https://bugzilla.kernel.org/show_bug.cgi?id=15303 Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* sony-laptop: documentation updatesMattia Dongili2011-03-281-7/+30
| | | | | Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* sony-laptop: add some debug printk useful for bug reportsMattia Dongili2011-03-281-3/+11
| | | | | Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* platform/x86: intel_mid_powerbutton needs INPUTRandy Dunlap2011-03-281-1/+1
| | | | | | | | | | | | | | | | intel_mid_powerbtn.c uses input interfaces, so it should depend on INPUT to fix build errors when CONFIG_INPUT is not enabled: intel_mid_powerbtn.c:(.text+0x56ca8f): undefined reference to `input_event' intel_mid_powerbtn.c:(.devinit.text+0x2e7b4): undefined reference to `input_allocate_device' intel_mid_powerbtn.c:(.devinit.text+0x2e7ff): undefined reference to `input_set_capability' intel_mid_powerbtn.c:(.devinit.text+0x2e84a): undefined reference to `input_register_device' intel_mid_powerbtn.c:(.devinit.text+0x2e88b): undefined reference to `input_free_device' intel_mid_powerbtn.c:(.devexit.text+0x42f0): undefined reference to `input_unregister_device' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Cc: Hong Liu <hong.liu@intel.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* Enable Dell All-In-One volume up/down keysColin Ian King2011-03-283-0/+185
| | | | | | | | | | | | | | | | Enable volume up and down hotkeys on WMI events GUID 284A0E6B-380E-472A-921F-E52786257FB4 and GUID 02314822-307C-4F66-bf0E-48AEAEB26CC8. Also works around a firmware bug where the _WED method should return an integer containing the key code and in fact the method returns the key code in element zero of a buffer. BugLink: http://bugs.launchpad.net/bugs/701530 BugLink: http://bugs.launchpad.net/bugs/676997 Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* intel_mid_powerbtn: add power button driver for Medfield platform (#3)Hong Liu2011-03-283-0/+157
| | | | | | | | | | | The power button is connected to MSIC on Medfield, we will get two interrupts from IOAPIC when pressing or releasing the power button. Signed-off-by: Hong Liu <hong.liu@intel.com> [Minor fixes as noted by Dmitry] Signed-off-by: Alan Cox <alan@linux.intel.com> Acked-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* eeepc-wmi: add camera keysCorentin Chary2011-03-282-0/+14
| | | | | | | | | 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-282-0/+12
| | | | | Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* asus-laptop: remove deprecated interfaces (lcd_switch and display_get)Corentin Chary2011-03-281-160/+3
| | | | | | | | | | | | | | | | | | | | | I should have done that one year ago, so it's more than time to do it. These two features use non-standard interfaces. There are the only features that really need multiple path to guess what's the right method name on a specific laptop. Removing them allow to remove a lot of code an significantly clean the driver. This will affect the backlight code which won't be able to know if the backlight is on or off. The platform display file will also be write only (like the one in eeepc-laptop). Signed-off-by: Corentin Chary <corentin.chary@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* asus-laptop: let WLED alone on L1400BCorentin Chary2011-03-281-0/+17
| | | | | | | | | | | | Asus took the DSDT from another model (L84F), made some change to make it work, but forgot to remove WLED method (the laptop doesn't have a wireless card). They even didn't change the model name. ref: https://bugzilla.kernel.org/show_bug.cgi?id=25712 Signed-off-by: Corentin Chary <corentin.chary@gmail.com> 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-282-1/+102
| | | | | 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>
OpenPOWER on IntegriCloud