Commit Graph

9 Commits (c03b26a5a5597a59b2e247d005d5901430109a8a)

Author SHA1 Message Date
Len Brown fda11e61ff dell-wmi, hp-wmi, msi-wmi: check wmi_get_event_data() return value
When acpi_evaluate_object() is passed ACPI_ALLOCATE_BUFFER,
the caller must kfree the returned buffer if AE_OK is returned.

The callers of wmi_get_event_data() pass ACPI_ALLOCATE_BUFFER,
and thus must check its return value before accessing
or kfree() on the buffer.

Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-30 02:48:52 -05:00
Len Brown abb631bfe2 dell-wmi: sys_init_module: 'dell_wmi'->init suspiciously returned 21, it should
follow 0/-E convention

wmi_install_notify_handler() returns an acpi_error,
but dell_wmi_init() needs return a -errno style error.

Tested-by: Paul Rolland <rol@as2917.net>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-30 02:48:38 -05:00
Dmitry Torokhov 1fdd407f4e dell-wmi: do not keep driver loaded on unsupported boxes
There is no point in having the driver loaded in memory if we fail
to locate particular WMI GUID.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Acked-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-24 00:44:46 -05:00
Anisse Astier 3e9b988e4e wmi: Free the allocated acpi objects through wmi_get_event_data
These function allocate an acpi object by calling wmi_get_event_data, which
then calls acpi_evaluate_object, and it is not freed afterwards.

And kernel doc is fixed for parameters of wmi_get_event_data.

Signed-off-by: Anisse Astier <anisse@astier.eu>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-24 00:42:00 -05:00
Rezwanul Kabir 5ea2559726 dell-wmi: Add support for new Dell systems
Newer Dell systems support HotKey features differently from legacy
systems.  A new vendor specifc HotKey SMBIOS table (Type 0xB2) is
defined. This table contains a mapping between scancode and the
corresponding predefined keyfunction ( i.e. keycode).. Also, a new
ACPI-WMI event type (called KeyIDList) with a value of 0x0010 is
defined. Any BIOS containing 0xB2 table will send hotkey notifications
using KeyIDList event.

This is Rezwanul's patch, updated to ensure that brightness events are
not sent if the backlight is controlled via ACPI and with the default
keycode for the display output switching altered to match desktop
expectations.

Signed-off-by: Rezwanul Kabir <Rezwanul_Kabir@dell.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-10 00:19:36 -05:00
Matthew Garrett db18b040af dell-wmi: don't generate errors on empty messages
There's no point in generating kernel messages if we didn't receive a
parsable keyboard event - only do so if there appeared to be a scancode.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-06-17 23:44:22 -04:00
Mario Limonciello 5cab009817 dell-wmi: add additional keyboard events
Upcoming Dell hardware will send more keyboard events via WMI.  Add
support for them.

Signed-off-by: Mario Limonciello <mario_limonciello@dell.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-06-17 23:44:15 -04:00
Mario Limonciello 75d71c40dd dell-wmi: mask off upper bytes of event response
In debugging with some future machines that actually contain BIOS level
support for dell-wmi, I've determined that the upper half of the data that
comes back from wmi_get_event_data may sometimes contain extra information
that isn't currently relevant when pulling scan codes out of the data.
This causes dell-wmi to improperly respond to these events.

Signed-off-by: Mario Limonciello <mario_limonciello@dell.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-06-17 23:44:07 -04:00
Matthew Garrett 0b3f6109f0 dell-wmi: new driver for hotkey control
Add a WMI driver for Dell laptops. Currently it does nothing but send a
generic input event when a button with a picture of a battery on it is
pressed, but maybe other uses will appear over time.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-04-03 22:54:50 -04:00