* [PATCH] toshiba_acpi: Add hotkeys support for Toshiba Satellite U940
@ 2013-11-22 23:02 Jose Ignacio Naranjo
2013-12-05 6:55 ` Jose Ignacio Naranjo
2014-01-21 13:38 ` Matthew Garrett
0 siblings, 2 replies; 4+ messages in thread
From: Jose Ignacio Naranjo @ 2013-11-22 23:02 UTC (permalink / raw)
To: platform-driver-x86; +Cc: Jose Ignacio Naranjo
---
drivers/platform/x86/toshiba_acpi.c | 41 +++++++++++++++++++++++++++++++++++--
1 file changed, 39 insertions(+), 2 deletions(-)
diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c
index 0cfadb6..ff711d5 100644
--- a/drivers/platform/x86/toshiba_acpi.c
+++ b/drivers/platform/x86/toshiba_acpi.c
@@ -54,6 +54,7 @@
#include <linux/slab.h>
#include <linux/workqueue.h>
#include <linux/i8042.h>
+#include <linux/dmi.h>
#include <asm/uaccess.h>
@@ -150,7 +151,7 @@ static const struct acpi_device_id toshiba_device_ids[] = {
};
MODULE_DEVICE_TABLE(acpi, toshiba_device_ids);
-static const struct key_entry toshiba_acpi_keymap[] = {
+static const struct key_entry toshiba_acpi_default_keymap[] = {
{ KE_KEY, 0x101, { KEY_MUTE } },
{ KE_KEY, 0x102, { KEY_ZOOMOUT } },
{ KE_KEY, 0x103, { KEY_ZOOMIN } },
@@ -178,6 +179,41 @@ static const struct key_entry toshiba_acpi_keymap[] = {
{ KE_END, 0 },
};
+static const struct key_entry *keymap = toshiba_acpi_default_keymap;
+
+static struct key_entry keymap_satellite_u940[] = {
+ { KE_KEY, 0x13c, { KEY_BRIGHTNESSDOWN } },
+ { KE_KEY, 0x13d, { KEY_BRIGHTNESSUP } },
+ { KE_KEY, 0x13e, { KEY_SWITCHVIDEOMODE } },
+ { KE_KEY, 0x13f, { KEY_TOUCHPAD_TOGGLE } },
+ { KE_KEY, 0x157, { KEY_MUTE} },
+ { KE_KEY, 0x158, { KEY_WLAN } },
+ { KE_KEY, 0x12c, { KEY_KBDILLUMTOGGLE } },
+ { KE_KEY, 0x102, { KEY_ZOOMOUT } },
+ { KE_KEY, 0x103, { KEY_ZOOMIN } },
+ { KE_KEY, 0x139, { KEY_ZOOMRESET } },
+ { KE_END, 0 }
+};
+
+static int dmi_matched(const struct dmi_system_id *dmi)
+{
+ keymap = dmi->driver_data;
+ return 1;
+}
+
+static const struct dmi_system_id dmi_ids[] = {
+ {
+ /* Toshiba Satellite U940 */
+ .callback = dmi_matched,
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE U940"),
+ },
+ .driver_data = keymap_satellite_u940
+ },
+ { NULL, }
+};
+
/* utility
*/
@@ -984,7 +1020,8 @@ static int toshiba_acpi_setup_keyboard(struct toshiba_acpi_dev *dev)
dev->hotkey_dev->phys = "toshiba_acpi/input0";
dev->hotkey_dev->id.bustype = BUS_HOST;
- error = sparse_keymap_setup(dev->hotkey_dev, toshiba_acpi_keymap, NULL);
+ dmi_check_system(dmi_ids);
+ error = sparse_keymap_setup(dev->hotkey_dev, keymap, NULL);
if (error)
goto err_free_dev;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] toshiba_acpi: Add hotkeys support for Toshiba Satellite U940
2013-11-22 23:02 [PATCH] toshiba_acpi: Add hotkeys support for Toshiba Satellite U940 Jose Ignacio Naranjo
@ 2013-12-05 6:55 ` Jose Ignacio Naranjo
2013-12-05 15:21 ` Matthew Garrett
2014-01-21 13:38 ` Matthew Garrett
1 sibling, 1 reply; 4+ messages in thread
From: Jose Ignacio Naranjo @ 2013-12-05 6:55 UTC (permalink / raw)
To: platform-driver-x86, mjg59
Hello Matthew and list,
I didn't receive any feedback about this patch. Is there any problem?
I had to do it because I was lacking of a few scancodes and I couldn't
remap all the keys using udev
Regards,
JI
On Sat, Nov 23, 2013 at 12:02 AM, Jose Ignacio Naranjo
<joseignacio.naranjo@gmail.com> wrote:
> ---
> drivers/platform/x86/toshiba_acpi.c | 41 +++++++++++++++++++++++++++++++++++--
> 1 file changed, 39 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c
> index 0cfadb6..ff711d5 100644
> --- a/drivers/platform/x86/toshiba_acpi.c
> +++ b/drivers/platform/x86/toshiba_acpi.c
> @@ -54,6 +54,7 @@
> #include <linux/slab.h>
> #include <linux/workqueue.h>
> #include <linux/i8042.h>
> +#include <linux/dmi.h>
>
> #include <asm/uaccess.h>
>
> @@ -150,7 +151,7 @@ static const struct acpi_device_id toshiba_device_ids[] = {
> };
> MODULE_DEVICE_TABLE(acpi, toshiba_device_ids);
>
> -static const struct key_entry toshiba_acpi_keymap[] = {
> +static const struct key_entry toshiba_acpi_default_keymap[] = {
> { KE_KEY, 0x101, { KEY_MUTE } },
> { KE_KEY, 0x102, { KEY_ZOOMOUT } },
> { KE_KEY, 0x103, { KEY_ZOOMIN } },
> @@ -178,6 +179,41 @@ static const struct key_entry toshiba_acpi_keymap[] = {
> { KE_END, 0 },
> };
>
> +static const struct key_entry *keymap = toshiba_acpi_default_keymap;
> +
> +static struct key_entry keymap_satellite_u940[] = {
> + { KE_KEY, 0x13c, { KEY_BRIGHTNESSDOWN } },
> + { KE_KEY, 0x13d, { KEY_BRIGHTNESSUP } },
> + { KE_KEY, 0x13e, { KEY_SWITCHVIDEOMODE } },
> + { KE_KEY, 0x13f, { KEY_TOUCHPAD_TOGGLE } },
> + { KE_KEY, 0x157, { KEY_MUTE} },
> + { KE_KEY, 0x158, { KEY_WLAN } },
> + { KE_KEY, 0x12c, { KEY_KBDILLUMTOGGLE } },
> + { KE_KEY, 0x102, { KEY_ZOOMOUT } },
> + { KE_KEY, 0x103, { KEY_ZOOMIN } },
> + { KE_KEY, 0x139, { KEY_ZOOMRESET } },
> + { KE_END, 0 }
> +};
> +
> +static int dmi_matched(const struct dmi_system_id *dmi)
> +{
> + keymap = dmi->driver_data;
> + return 1;
> +}
> +
> +static const struct dmi_system_id dmi_ids[] = {
> + {
> + /* Toshiba Satellite U940 */
> + .callback = dmi_matched,
> + .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
> + DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE U940"),
> + },
> + .driver_data = keymap_satellite_u940
> + },
> + { NULL, }
> +};
> +
> /* utility
> */
>
> @@ -984,7 +1020,8 @@ static int toshiba_acpi_setup_keyboard(struct toshiba_acpi_dev *dev)
> dev->hotkey_dev->phys = "toshiba_acpi/input0";
> dev->hotkey_dev->id.bustype = BUS_HOST;
>
> - error = sparse_keymap_setup(dev->hotkey_dev, toshiba_acpi_keymap, NULL);
> + dmi_check_system(dmi_ids);
> + error = sparse_keymap_setup(dev->hotkey_dev, keymap, NULL);
> if (error)
> goto err_free_dev;
>
> --
> 1.8.3.2
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] toshiba_acpi: Add hotkeys support for Toshiba Satellite U940
2013-12-05 6:55 ` Jose Ignacio Naranjo
@ 2013-12-05 15:21 ` Matthew Garrett
0 siblings, 0 replies; 4+ messages in thread
From: Matthew Garrett @ 2013-12-05 15:21 UTC (permalink / raw)
To: Jose Ignacio Naranjo; +Cc: platform-driver-x86
On Thu, Dec 05, 2013 at 07:55:17AM +0100, Jose Ignacio Naranjo wrote:
> Hello Matthew and list,
>
> I didn't receive any feedback about this patch. Is there any problem?
> I had to do it because I was lacking of a few scancodes and I couldn't
> remap all the keys using udev
I just haven't had a chance to review it yet. I'll take a look in the
next couple of days. Thanks for your patience!
--
Matthew Garrett | mjg59@srcf.ucam.org
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] toshiba_acpi: Add hotkeys support for Toshiba Satellite U940
2013-11-22 23:02 [PATCH] toshiba_acpi: Add hotkeys support for Toshiba Satellite U940 Jose Ignacio Naranjo
2013-12-05 6:55 ` Jose Ignacio Naranjo
@ 2014-01-21 13:38 ` Matthew Garrett
1 sibling, 0 replies; 4+ messages in thread
From: Matthew Garrett @ 2014-01-21 13:38 UTC (permalink / raw)
To: Jose Ignacio Naranjo; +Cc: platform-driver-x86
On Sat, 2013-11-23 at 00:02 +0100, Jose Ignacio Naranjo wrote:
First, I'm really sorry that it's taken me so long to get around to
reviewing this.
> +static struct key_entry keymap_satellite_u940[] = {
> + { KE_KEY, 0x13c, { KEY_BRIGHTNESSDOWN } },
> + { KE_KEY, 0x13d, { KEY_BRIGHTNESSUP } },
> + { KE_KEY, 0x13e, { KEY_SWITCHVIDEOMODE } },
> + { KE_KEY, 0x13f, { KEY_TOUCHPAD_TOGGLE } },
> + { KE_KEY, 0x157, { KEY_MUTE} },
> + { KE_KEY, 0x158, { KEY_WLAN } },
> + { KE_KEY, 0x12c, { KEY_KBDILLUMTOGGLE } },
> + { KE_KEY, 0x102, { KEY_ZOOMOUT } },
> + { KE_KEY, 0x103, { KEY_ZOOMIN } },
> + { KE_KEY, 0x139, { KEY_ZOOMRESET } },
> + { KE_END, 0 }
Yeah, that's pretty distinct from the original map. Boo.
> +
> +static int dmi_matched(const struct dmi_system_id *dmi)
> +{
> + keymap = dmi->driver_data;
> + return 1;
>+}
But I'm not a fan of doing this with DMI - if Toshiba are doing this for
some newer machines then it's possible that the map's changed for all of
them. Things that spring to mind:
1) The map may be different on all systems that support Windows 8?
2) There's some ACPI call that distinguishes between them?
Can you send me the output of acpidump for this system?
Thanks,
--
Matthew Garrett <matthew.garrett@nebula.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-01-21 13:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-22 23:02 [PATCH] toshiba_acpi: Add hotkeys support for Toshiba Satellite U940 Jose Ignacio Naranjo
2013-12-05 6:55 ` Jose Ignacio Naranjo
2013-12-05 15:21 ` Matthew Garrett
2014-01-21 13:38 ` Matthew Garrett
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.