diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-04-24 14:31:57 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-04-24 14:31:57 -0400 |
| commit | b39c8be6d5e38f4478be0c7aaf1d3a160a4dd330 (patch) | |
| tree | f53de2f560ca582ad92dc60b826ef693c4c21a13 | |
| parent | df37bd156dcb4f5441beaf5bde444adac974e9a0 (diff) | |
| parent | c9db3efee16add57ea459a00dfa00610fcbce931 (diff) | |
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platform-drivers-x86
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platform-drivers-x86:
eeepc-laptop: add missing sparse_keymap_free
eeepc-wmi: Build fix
asus: don't modify bluetooth/wlan on boot
dell-wmi: Fix memory leak
eeepc-wmi: add backlight support
eeepc-wmi: use a platform device as parent device of all sub-devices
eeepc-wmi: add an eeepc_wmi context structure
| -rw-r--r-- | drivers/platform/x86/Kconfig | 1 | ||||
| -rw-r--r-- | drivers/platform/x86/asus-laptop.c | 8 | ||||
| -rw-r--r-- | drivers/platform/x86/dell-wmi.c | 3 | ||||
| -rw-r--r-- | drivers/platform/x86/eeepc-laptop.c | 3 | ||||
| -rw-r--r-- | drivers/platform/x86/eeepc-wmi.c | 333 |
5 files changed, 302 insertions, 46 deletions
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig index 7bec4588c268..6c3320d75055 100644 --- a/drivers/platform/x86/Kconfig +++ b/drivers/platform/x86/Kconfig | |||
| @@ -390,6 +390,7 @@ config EEEPC_WMI | |||
| 390 | depends on ACPI_WMI | 390 | depends on ACPI_WMI |
| 391 | depends on INPUT | 391 | depends on INPUT |
| 392 | depends on EXPERIMENTAL | 392 | depends on EXPERIMENTAL |
| 393 | select INPUT_SPARSEKMAP | ||
| 393 | ---help--- | 394 | ---help--- |
| 394 | Say Y here if you want to support WMI-based hotkeys on Eee PC laptops. | 395 | Say Y here if you want to support WMI-based hotkeys on Eee PC laptops. |
| 395 | 396 | ||
diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c index 52262b012abb..efe8f6388906 100644 --- a/drivers/platform/x86/asus-laptop.c +++ b/drivers/platform/x86/asus-laptop.c | |||
| @@ -79,15 +79,15 @@ static uint wapf = 1; | |||
| 79 | module_param(wapf, uint, 0644); | 79 | module_param(wapf, uint, 0644); |
| 80 | MODULE_PARM_DESC(wapf, "WAPF value"); | 80 | MODULE_PARM_DESC(wapf, "WAPF value"); |
| 81 | 81 | ||
| 82 | static uint wlan_status = 1; | 82 | static int wlan_status = 1; |
| 83 | static uint bluetooth_status = 1; | 83 | static int bluetooth_status = 1; |
| 84 | 84 | ||
| 85 | module_param(wlan_status, uint, 0644); | 85 | module_param(wlan_status, int, 0644); |
| 86 | MODULE_PARM_DESC(wlan_status, "Set the wireless status on boot " | 86 | MODULE_PARM_DESC(wlan_status, "Set the wireless status on boot " |
| 87 | "(0 = disabled, 1 = enabled, -1 = don't do anything). " | 87 | "(0 = disabled, 1 = enabled, -1 = don't do anything). " |
| 88 | "default is 1"); | 88 | "default is 1"); |
| 89 | 89 | ||
| 90 | module_param(bluetooth_status, uint, 0644); | 90 | module_param(bluetooth_status, int, 0644); |
| 91 | MODULE_PARM_DESC(bluetooth_status, "Set the wireless status on boot " | 91 | MODULE_PARM_DESC(bluetooth_status, "Set the wireless status on boot " |
| 92 | "(0 = disabled, 1 = enabled, -1 = don't do anything). " | 92 | "(0 = disabled, 1 = enabled, -1 = don't do anything). " |
| 93 | "default is 1"); | 93 | "default is 1"); |
diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c index 6ba6c30e5bb6..66f53c3c35e8 100644 --- a/drivers/platform/x86/dell-wmi.c +++ b/drivers/platform/x86/dell-wmi.c | |||
| @@ -217,6 +217,7 @@ static void dell_wmi_notify(u32 value, void *context) | |||
| 217 | if (dell_new_hk_type && (buffer_entry[1] != 0x10)) { | 217 | if (dell_new_hk_type && (buffer_entry[1] != 0x10)) { |
| 218 | printk(KERN_INFO "dell-wmi: Received unknown WMI event" | 218 | printk(KERN_INFO "dell-wmi: Received unknown WMI event" |
| 219 | " (0x%x)\n", buffer_entry[1]); | 219 | " (0x%x)\n", buffer_entry[1]); |
| 220 | kfree(obj); | ||
| 220 | return; | 221 | return; |
| 221 | } | 222 | } |
| 222 | 223 | ||
| @@ -234,7 +235,7 @@ static void dell_wmi_notify(u32 value, void *context) | |||
| 234 | key->keycode == KEY_BRIGHTNESSDOWN) && acpi_video) { | 235 | key->keycode == KEY_BRIGHTNESSDOWN) && acpi_video) { |
| 235 | /* Don't report brightness notifications that will also | 236 | /* Don't report brightness notifications that will also |
| 236 | * come via ACPI */ | 237 | * come via ACPI */ |
| 237 | return; | 238 | ; |
| 238 | } else { | 239 | } else { |
| 239 | input_report_key(dell_wmi_input_dev, key->keycode, 1); | 240 | input_report_key(dell_wmi_input_dev, key->keycode, 1); |
| 240 | input_sync(dell_wmi_input_dev); | 241 | input_sync(dell_wmi_input_dev); |
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c index 54a015785ca8..0306174ba875 100644 --- a/drivers/platform/x86/eeepc-laptop.c +++ b/drivers/platform/x86/eeepc-laptop.c | |||
| @@ -169,7 +169,6 @@ struct eeepc_laptop { | |||
| 169 | struct backlight_device *backlight_device; | 169 | struct backlight_device *backlight_device; |
| 170 | 170 | ||
| 171 | struct input_dev *inputdev; | 171 | struct input_dev *inputdev; |
| 172 | struct key_entry *keymap; | ||
| 173 | 172 | ||
| 174 | struct rfkill *wlan_rfkill; | 173 | struct rfkill *wlan_rfkill; |
| 175 | struct rfkill *bluetooth_rfkill; | 174 | struct rfkill *bluetooth_rfkill; |
| @@ -1204,8 +1203,8 @@ static int eeepc_input_init(struct eeepc_laptop *eeepc) | |||
| 1204 | static void eeepc_input_exit(struct eeepc_laptop *eeepc) | 1203 | static void eeepc_input_exit(struct eeepc_laptop *eeepc) |
| 1205 | { | 1204 | { |
| 1206 | if (eeepc->inputdev) { | 1205 | if (eeepc->inputdev) { |
| 1206 | sparse_keymap_free(eeepc->inputdev); | ||
| 1207 | input_unregister_device(eeepc->inputdev); | 1207 | input_unregister_device(eeepc->inputdev); |
| 1208 | kfree(eeepc->keymap); | ||
| 1209 | } | 1208 | } |
| 1210 | } | 1209 | } |
| 1211 | 1210 | ||
diff --git a/drivers/platform/x86/eeepc-wmi.c b/drivers/platform/x86/eeepc-wmi.c index 9f8822658fd7..b227eb469f49 100644 --- a/drivers/platform/x86/eeepc-wmi.c +++ b/drivers/platform/x86/eeepc-wmi.c | |||
| @@ -23,6 +23,8 @@ | |||
| 23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 24 | */ | 24 | */ |
| 25 | 25 | ||
| 26 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
| 27 | |||
| 26 | #include <linux/kernel.h> | 28 | #include <linux/kernel.h> |
| 27 | #include <linux/module.h> | 29 | #include <linux/module.h> |
| 28 | #include <linux/init.h> | 30 | #include <linux/init.h> |
| @@ -30,22 +32,34 @@ | |||
| 30 | #include <linux/slab.h> | 32 | #include <linux/slab.h> |
| 31 | #include <linux/input.h> | 33 | #include <linux/input.h> |
| 32 | #include <linux/input/sparse-keymap.h> | 34 | #include <linux/input/sparse-keymap.h> |
| 35 | #include <linux/fb.h> | ||
| 36 | #include <linux/backlight.h> | ||
| 37 | #include <linux/platform_device.h> | ||
| 33 | #include <acpi/acpi_bus.h> | 38 | #include <acpi/acpi_bus.h> |
| 34 | #include <acpi/acpi_drivers.h> | 39 | #include <acpi/acpi_drivers.h> |
| 35 | 40 | ||
| 41 | #define EEEPC_WMI_FILE "eeepc-wmi" | ||
| 42 | |||
| 36 | MODULE_AUTHOR("Yong Wang <yong.y.wang@intel.com>"); | 43 | MODULE_AUTHOR("Yong Wang <yong.y.wang@intel.com>"); |
| 37 | MODULE_DESCRIPTION("Eee PC WMI Hotkey Driver"); | 44 | MODULE_DESCRIPTION("Eee PC WMI Hotkey Driver"); |
| 38 | MODULE_LICENSE("GPL"); | 45 | MODULE_LICENSE("GPL"); |
| 39 | 46 | ||
| 40 | #define EEEPC_WMI_EVENT_GUID "ABBC0F72-8EA1-11D1-00A0-C90629100000" | 47 | #define EEEPC_WMI_EVENT_GUID "ABBC0F72-8EA1-11D1-00A0-C90629100000" |
| 48 | #define EEEPC_WMI_MGMT_GUID "97845ED0-4E6D-11DE-8A39-0800200C9A66" | ||
| 41 | 49 | ||
| 42 | MODULE_ALIAS("wmi:"EEEPC_WMI_EVENT_GUID); | 50 | MODULE_ALIAS("wmi:"EEEPC_WMI_EVENT_GUID); |
| 51 | MODULE_ALIAS("wmi:"EEEPC_WMI_MGMT_GUID); | ||
| 43 | 52 | ||
| 44 | #define NOTIFY_BRNUP_MIN 0x11 | 53 | #define NOTIFY_BRNUP_MIN 0x11 |
| 45 | #define NOTIFY_BRNUP_MAX 0x1f | 54 | #define NOTIFY_BRNUP_MAX 0x1f |
| 46 | #define NOTIFY_BRNDOWN_MIN 0x20 | 55 | #define NOTIFY_BRNDOWN_MIN 0x20 |
| 47 | #define NOTIFY_BRNDOWN_MAX 0x2e | 56 | #define NOTIFY_BRNDOWN_MAX 0x2e |
| 48 | 57 | ||
| 58 | #define EEEPC_WMI_METHODID_DEVS 0x53564544 | ||
| 59 | #define EEEPC_WMI_METHODID_DSTS 0x53544344 | ||
| 60 | |||
| 61 | #define EEEPC_WMI_DEVID_BACKLIGHT 0x00050012 | ||
| 62 | |||
| 49 | static const struct key_entry eeepc_wmi_keymap[] = { | 63 | static const struct key_entry eeepc_wmi_keymap[] = { |
| 50 | /* Sleep already handled via generic ACPI code */ | 64 | /* Sleep already handled via generic ACPI code */ |
| 51 | { KE_KEY, 0x5d, { KEY_WLAN } }, | 65 | { KE_KEY, 0x5d, { KEY_WLAN } }, |
| @@ -58,18 +72,198 @@ static const struct key_entry eeepc_wmi_keymap[] = { | |||
| 58 | { KE_END, 0}, | 72 | { KE_END, 0}, |
| 59 | }; | 73 | }; |
| 60 | 74 | ||
| 61 | static struct input_dev *eeepc_wmi_input_dev; | 75 | struct bios_args { |
| 76 | u32 dev_id; | ||
| 77 | u32 ctrl_param; | ||
| 78 | }; | ||
| 79 | |||
| 80 | struct eeepc_wmi { | ||
| 81 | struct input_dev *inputdev; | ||
| 82 | struct backlight_device *backlight_device; | ||
| 83 | }; | ||
| 84 | |||
| 85 | static struct platform_device *platform_device; | ||
| 86 | |||
| 87 | static int eeepc_wmi_input_init(struct eeepc_wmi *eeepc) | ||
| 88 | { | ||
| 89 | int err; | ||
| 90 | |||
| 91 | eeepc->inputdev = input_allocate_device(); | ||
| 92 | if (!eeepc->inputdev) | ||
| 93 | return -ENOMEM; | ||
| 94 | |||
| 95 | eeepc->inputdev->name = "Eee PC WMI hotkeys"; | ||
| 96 | eeepc->inputdev->phys = EEEPC_WMI_FILE "/input0"; | ||
| 97 | eeepc->inputdev->id.bustype = BUS_HOST; | ||
| 98 | eeepc->inputdev->dev.parent = &platform_device->dev; | ||
| 99 | |||
| 100 | err = sparse_keymap_setup(eeepc->inputdev, eeepc_wmi_keymap, NULL); | ||
| 101 | if (err) | ||
| 102 | |||
