aboutsummaryrefslogtreecommitdiff
path: root/drivers/platform/x86/hp-wmi.c
AgeCommit message (Collapse)Author
2009-09-19Merge branch 'misc-2.6.32' into releaseLen Brown
Conflicts: drivers/pci/dmar.c Signed-off-by: Len Brown <len.brown@intel.com>
2009-09-19hp-wmi: fix rfkill memory leak on unloadCorentin Chary
rfkill_unregister() should always be followed by rfkill_destroy() In this case, rfkill_destroy was called two times on wifi_rfkill and never on bluetooth_rfkill. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Acked-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Len Brown <len.brown@intel.com>
2009-09-14hp-wmi: Switch driver to dev_pm_opsFrans Pop
Gets rid of the following warning: Platform driver 'hp-wmi' needs updating - please use dev_pm_ops I tested that the resume handler still works on my HP 2510p notebook. [rjw: Fixed up the definition of hp_wmi_pm_ops.] Signed-off-by: Frans Pop <elendil@planet.nl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2009-07-30hp-wmi: check that an input device exists in resume handlerFrans Pop
Some systems may not support input events, or registering the input handler may have failed. So check that an input device exists before trying to set the docking and tablet mode state during resume. Fixes: http://bugzilla.kernel.org/show_bug.cgi?id=13865 Reported-and-tested-by: Cédric Godin <cedric@belbone.be> Signed-off-by: Frans Pop <elendil@planet.nl> Acked-by: Matthew Garrett <mjg59@srcf.ucam.org> Signed-off-by: Len Brown <len.brown@intel.com>
2009-07-07hp-wmi: fix rfkill bugJohannes Berg
Fix the third (I think) polarity error I accidentally introduced in the rfkill rewrite to make wireless work again on (certain?) HP laptops. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Tested-by: Maciej Rutecki <maciej.rutecki@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-06-24Merge branches 'acerhdf', 'acpi-pci-bind', 'bjorn-pci-root', ↵Len Brown
'bugzilla-12904', 'bugzilla-13121', 'bugzilla-13396', 'bugzilla-13533', 'bugzilla-13612', 'c3_lock', 'hid-cleanups', 'misc-2.6.31', 'pdc-leak-fix', 'pnpacpi', 'power_nocheck', 'thinkpad_acpi', 'video' and 'wmi' into release
2009-06-17hp-wmi: Add support for reporting tablet stateMatthew Garrett
HP tablets send a WMI event when a tablet state change occurs, but use the same method as is used for reporting docking and undocking. The same query is used to obtain the state of the hardware. Bit 0 indicates the docking state, while bit 2 indicates the tablet state. This patch breaks these out and sends separate input events for tablet and dock state changes. An additional sysfs file is added to report the tablet state. Signed-off-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Len Brown <len.brown@intel.com>
2009-06-10rfkill: remove set_global_sw_stateAlan Jenkins
rfkill_set_global_sw_state() (previously rfkill_set_default()) will no longer be exported by the rewritten rfkill core. Instead, platform drivers which can provide persistent soft-rfkill state across power-down/reboot should indicate their initial state by calling rfkill_set_sw_state() before registration. Otherwise, they will be initialized to a default value during registration by a set_block call. We remove existing calls to rfkill_set_sw_state() which happen before registration, since these had no effect in the old model. If these drivers do have persistent state, the calls can be put back (subject to testing :-). This affects hp-wmi and acer-wmi. Drivers with persistent state will affect the global state only if rfkill-input is enabled. This is required, otherwise booting with wireless soft-blocked and pressing the wireless-toggle key once would have no apparent effect. This special case will be removed in future along with rfkill-input, in favour of a more flexible userspace daemon (see Documentation/feature-removal-schedule.txt). Now rfkill_global_states[n].def is only used to preserve global states over EPO, it is renamed to ".sav". Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-06-03rfkill: rewriteJohannes Berg
This patch completely rewrites the rfkill core to address the following deficiencies: * all rfkill drivers need to implement polling where necessary rather than having one central implementation * updating the rfkill state cannot be done from arbitrary contexts, forcing drivers to use schedule_work and requiring lots of code * rfkill drivers need to keep track of soft/hard blocked internally -- the core should do this * the rfkill API has many unexpected quirks, for example being asymmetric wrt. alloc/free and register/unregister * rfkill can call back into a driver from within a function the driver called -- this is prone to deadlocks and generally should be avoided * rfkill-input pointlessly is a separate module * drivers need to #ifdef rfkill functions (unless they want to depend on or select RFKILL) -- rfkill should provide inlines that do nothing if it isn't compiled in * the rfkill structure is not opaque -- drivers need to initialise it correctly (lots of sanity checking code required) -- instead force drivers to pass the right variables to rfkill_alloc() * the documentation is hard to read because it always assumes the reader is completely clueless and contains way TOO MANY CAPS * the rfkill code needlessly uses a lot of locks and atomic operations in locked sections * fix LED trigger to actually change the LED when the radio state changes -- this wasn't done before Tested-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> [thinkpad] Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-04-22rfkill: remove user_claim stuffJohannes Berg
Almost all drivers do not support user_claim, so remove it completely and always report -EOPNOTSUPP to userspace. Since userspace cannot really drive rfkill _anyway_ (due to the odd restrictions imposed by the documentation) having this code is just pointless. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-03-15hp-wmi: notify of a potential docking state change on resumeFrans Pop
It is possible that the system gets docked or undocked while it's suspended. Generate an input event on resume to notify user space if there was a state change. As it is a switch, we can generate the event unconditionally; the input layer will only pass it on if there is an actual change. Signed-off-by: Frans Pop <elendil@planet.nl> Cc: Matthew Garrett <mjg59@srcf.ucam.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
2009-02-05hp-wmi: fix error path in hp_wmi_bios_setup()Andrew Morton
The error-path code can call rfkill_unregister() with a pointer which does not contain the result of a call to rfkill_register(). It goes BUG(). Addresses http://bugzilla.kernel.org/show_bug.cgi?id=12560. Cc: Frans Pop <elendil@planet.nl> Cc: Larry Finger <Larry.Finger@lwfinger.net> Cc: Len Brown <lenb@kernel.org> Acked-by: Matthew Garrett <mjg@redhat.com> Reported-by: Helge Deller <deller@gmx.de> Testted-by: Helge Deller <deller@gmx.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-29hp-wmi: set initial docking stateFrans Pop
If the initial state is not set when the input device is set up, the first docking event after the module is loaded will be lost. Signed-off-by: Frans Pop <elendil@planet.nl> Acked-by: Matthew Garrett <mjg59@srcf.ucam.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-29hp-wmi: fix regressions caused by missing if statementFrans Pop
Error was introduced in commit fe8e4e039dc3 ("hp-wmi: handle rfkill_register() failure"). Signed-off-by: Frans Pop <elendil@planet.nl> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Acked-by: Matthew Garrett <mjg@redhat.com> Cc: Matthew Garrett <mjg59@srcf.ucam.org> Cc: Len Brown <lenb@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-09hp-wmi: handle rfkill_register() failureLarry Finger
Compilation of the HP WMI hotkeys code results in the following: CC [M] drivers/platform/x86/hp-wmi.o drivers/platform/x86/hp-wmi.c: In function hp_wmi_bios_setup: drivers/platform/x86/hp-wmi.c:431: warning: ignoring return value of rfkill_register, declared with attribute warn_unused_result drivers/platform/x86/hp-wmi.c:441: warning: ignoring return value of rfkill_register, declared with attribute warn_unused_result drivers/platform/x86/hp-wmi.c:450: warning: ignoring return value of rfkill_register, declared with attribute warn_unused_result Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: Matthew Garrett <mjg59@srcf.ucam.org> Cc: Len Brown <lenb@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-12-19create drivers/platform/x86/ from drivers/misc/Len Brown
Move x86 platform specific drivers from drivers/misc/ to a new home under drivers/platform/x86/. The community has been maintaining x86 vendor-specific platform specific drivers under /drivers/misc/ for a few years. The oldest ones started life under drivers/acpi. They moved out of drivers/acpi/ because they don't actually implement the ACPI specification, but either simply use ACPI, or implement vendor-specific ACPI extensions. In the future we anticipate... drivers/misc/ will go away. other architectures will create drivers/platform/<arch> Signed-off-by: Len Brown <len.brown@intel.com>