* [PATCH 0/2] dell-wmi: Add support for Fn key combinations
[not found] <201405171639.45722@pali>
@ 2014-05-17 14:43 ` Pali Rohár
2014-05-17 14:43 ` [PATCH 1/2] Input: Add keycodes for some missing " Pali Rohár
2014-05-17 14:43 ` [PATCH 2/2] dell-wmi: Add support for " Pali Rohár
0 siblings, 2 replies; 6+ messages in thread
From: Pali Rohár @ 2014-05-17 14:43 UTC (permalink / raw)
To: Dmitry Torokhov, Matthew Garrett
Cc: linux-input, platform-driver-x86, linux-hotplug, Matthew Garrett,
linux-kernel, Pali Rohár
This patch series add support for Fn key combinations to dell-wmi driver.
I tested this patch series on laptop Dell Latitude E6440.
Here is Bios DMI table which contains scancode to keycode mapping:
Handle 0xB200, DMI type 178, 80 bytes
OEM-specific Type
Header and Data:
B2 50 00 B2 07 01 0C 00 08 01 0A 00 09 01 0B 00
0A 01 12 00 3B 00 20 00 42 00 18 00 48 00 14 00
50 00 13 00 10 00 FF 00 11 00 FF 00 12 00 FF 00
13 00 FF 00 14 00 FF 00 1E 00 FF 00 1F 00 FF 00
20 00 FF 00 21 00 FF 00 22 00 FF 00 4D 00 16 00
Strings:
As you can see, more different keys are mapped to one keycode 0xFF.
Pali Rohár (2):
Input: Add keycodes for some missing Fn key combinations
dell-wmi: Add support for Fn key combinations
drivers/platform/x86/dell-wmi.c | 27 ++++++++++++++++++++++++++-
include/uapi/linux/input.h | 6 ++++++
2 files changed, 32 insertions(+), 1 deletion(-)
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] Input: Add keycodes for some missing Fn key combinations
2014-05-17 14:43 ` [PATCH 0/2] dell-wmi: Add support for Fn key combinations Pali Rohár
@ 2014-05-17 14:43 ` Pali Rohár
2014-05-17 20:30 ` Dmitry Torokhov
2014-05-17 14:43 ` [PATCH 2/2] dell-wmi: Add support for " Pali Rohár
1 sibling, 1 reply; 6+ messages in thread
From: Pali Rohár @ 2014-05-17 14:43 UTC (permalink / raw)
To: Dmitry Torokhov, Matthew Garrett
Cc: linux-input, platform-driver-x86, linux-hotplug, Matthew Garrett,
linux-kernel, Pali Rohár
There are already defined some Fn key combinations, but not all.
This patch adds missing combinations for support in dell-wmi driver.
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
---
include/uapi/linux/input.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h
index f484952..3a32799 100644
--- a/include/uapi/linux/input.h
+++ b/include/uapi/linux/input.h
@@ -672,6 +672,12 @@ struct input_keymap_entry {
#define KEY_FN_F 0x1e2
#define KEY_FN_S 0x1e3
#define KEY_FN_B 0x1e4
+#define KEY_FN_Q 0x1e5
+#define KEY_FN_W 0x1e6
+#define KEY_FN_R 0x1e7
+#define KEY_FN_T 0x1e8
+#define KEY_FN_A 0x1e9
+#define KEY_FN_G 0x1ea
#define KEY_BRL_DOT1 0x1f1
#define KEY_BRL_DOT2 0x1f2
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] dell-wmi: Add support for Fn key combinations
2014-05-17 14:43 ` [PATCH 0/2] dell-wmi: Add support for Fn key combinations Pali Rohár
2014-05-17 14:43 ` [PATCH 1/2] Input: Add keycodes for some missing " Pali Rohár
@ 2014-05-17 14:43 ` Pali Rohár
1 sibling, 0 replies; 6+ messages in thread
From: Pali Rohár @ 2014-05-17 14:43 UTC (permalink / raw)
To: Dmitry Torokhov, Matthew Garrett
Cc: linux-input, platform-driver-x86, linux-hotplug, Matthew Garrett,
linux-kernel, Pali Rohár
Bios DMI table contains scancodes for some Fn key combinations. But
corresponding keycodes in DMI table have same value 255. And dell-wmi driver
map value 255 to KEY_PROG3. This means that it is not possible to distinguish
between Fn key combinations (e.g Fn+Q and Fn+W), because kernel reports for all
of them only KEY_PROG3.
This patch adding new table for mapping Bios DMI scancodes to linux keycodes
when bios DMI keycode is set to "generic" keycode 255. So different Fn key
combinations will have different keycodes.
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
---
drivers/platform/x86/dell-wmi.c | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c
index 390e8e3..c54d675 100644
--- a/drivers/platform/x86/dell-wmi.c
+++ b/drivers/platform/x86/dell-wmi.c
@@ -140,7 +140,27 @@ static const u16 bios_to_linux_keycode[256] __initconst = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, KEY_PROG3
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+
+/* table for bios code 0xff */
+static const u16 scancode_to_linux_keycode[256] __initconst = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ KEY_FN_Q, KEY_FN_W, KEY_FN_E, KEY_FN_R,
+ KEY_FN_T, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, KEY_FN_A, KEY_FN_S,
+ KEY_FN_D, KEY_FN_F, KEY_FN_G, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
static struct input_dev *dell_wmi_input_dev;
@@ -212,6 +232,11 @@ static const struct key_entry * __init dell_wmi_prepare_new_keymap(void)
keymap[i].keycode = bios_entry->keycode < 256 ?
bios_to_linux_keycode[bios_entry->keycode] :
KEY_RESERVED;
+ if (bios_entry->keycode == 255 && bios_entry->scancode < 256)
+ keymap[i].keycode =
+ scancode_to_linux_keycode[bios_entry->scancode];
+ if (!keymap[i].keycode)
+ keymap[i].keycode = KEY_RESERVED;
}
keymap[hotkey_num].type = KE_END;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] Input: Add keycodes for some missing Fn key combinations
2014-05-17 14:43 ` [PATCH 1/2] Input: Add keycodes for some missing " Pali Rohár
@ 2014-05-17 20:30 ` Dmitry Torokhov
2014-05-17 20:38 ` Pali Rohár
0 siblings, 1 reply; 6+ messages in thread
From: Dmitry Torokhov @ 2014-05-17 20:30 UTC (permalink / raw)
To: Pali Rohár
Cc: Matthew Garrett, linux-input, platform-driver-x86, linux-hotplug,
Matthew Garrett, linux-kernel
Hi Pali,
On Sat, May 17, 2014 at 04:43:36PM +0200, Pali Rohár wrote:
> There are already defined some Fn key combinations, but not all.
> This patch adds missing combinations for support in dell-wmi driver.
>
> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> ---
> include/uapi/linux/input.h | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h
> index f484952..3a32799 100644
> --- a/include/uapi/linux/input.h
> +++ b/include/uapi/linux/input.h
> @@ -672,6 +672,12 @@ struct input_keymap_entry {
> #define KEY_FN_F 0x1e2
> #define KEY_FN_S 0x1e3
> #define KEY_FN_B 0x1e4
> +#define KEY_FN_Q 0x1e5
> +#define KEY_FN_W 0x1e6
> +#define KEY_FN_R 0x1e7
> +#define KEY_FN_T 0x1e8
> +#define KEY_FN_A 0x1e9
> +#define KEY_FN_G 0x1ea
What do they actually do?
Thanks.
--
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] Input: Add keycodes for some missing Fn key combinations
2014-05-17 20:30 ` Dmitry Torokhov
@ 2014-05-17 20:38 ` Pali Rohár
2014-05-17 21:32 ` Dmitry Torokhov
0 siblings, 1 reply; 6+ messages in thread
From: Pali Rohár @ 2014-05-17 20:38 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Matthew Garrett, linux-input, platform-driver-x86, linux-hotplug,
Matthew Garrett, linux-kernel
[-- Attachment #1: Type: Text/Plain, Size: 1482 bytes --]
On Saturday 17 May 2014 22:30:54 Dmitry Torokhov wrote:
> Hi Pali,
>
> On Sat, May 17, 2014 at 04:43:36PM +0200, Pali Rohár wrote:
> > There are already defined some Fn key combinations, but not
> > all. This patch adds missing combinations for support in
> > dell-wmi driver.
> >
> > Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> > ---
> >
> > include/uapi/linux/input.h | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/include/uapi/linux/input.h
> > b/include/uapi/linux/input.h index f484952..3a32799 100644
> > --- a/include/uapi/linux/input.h
> > +++ b/include/uapi/linux/input.h
> > @@ -672,6 +672,12 @@ struct input_keymap_entry {
> >
> > #define KEY_FN_F 0x1e2
> > #define KEY_FN_S 0x1e3
> > #define KEY_FN_B 0x1e4
> >
> > +#define KEY_FN_Q 0x1e5
> > +#define KEY_FN_W 0x1e6
> > +#define KEY_FN_R 0x1e7
> > +#define KEY_FN_T 0x1e8
> > +#define KEY_FN_A 0x1e9
> > +#define KEY_FN_G 0x1ea
>
> What do they actually do?
>
> Thanks.
All 10 combinations Fn+Q ... Fn+T, Fn+A ... Fn+G are reported by
WMI and I need to assign some keycodes for them in dell-wmi
driver. And because More FN_* constants are already defined in
input.h I added those which are missing.
With this patch series I'm able to use above Fn combinations for
my own keyboard shortcuts. Before this patch all Fn combinations
were one same keycode - which was useless.
--
Pali Rohár
pali.rohar@gmail.com
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] Input: Add keycodes for some missing Fn key combinations
2014-05-17 20:38 ` Pali Rohár
@ 2014-05-17 21:32 ` Dmitry Torokhov
0 siblings, 0 replies; 6+ messages in thread
From: Dmitry Torokhov @ 2014-05-17 21:32 UTC (permalink / raw)
To: Pali Rohár
Cc: Matthew Garrett, linux-input, platform-driver-x86, linux-hotplug,
Matthew Garrett, linux-kernel
On Sat, May 17, 2014 at 10:38:30PM +0200, Pali Rohár wrote:
> On Saturday 17 May 2014 22:30:54 Dmitry Torokhov wrote:
> > Hi Pali,
> >
> > On Sat, May 17, 2014 at 04:43:36PM +0200, Pali Rohár wrote:
> > > There are already defined some Fn key combinations, but not
> > > all. This patch adds missing combinations for support in
> > > dell-wmi driver.
> > >
> > > Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> > > ---
> > >
> > > include/uapi/linux/input.h | 6 ++++++
> > > 1 file changed, 6 insertions(+)
> > >
> > > diff --git a/include/uapi/linux/input.h
> > > b/include/uapi/linux/input.h index f484952..3a32799 100644
> > > --- a/include/uapi/linux/input.h
> > > +++ b/include/uapi/linux/input.h
> > > @@ -672,6 +672,12 @@ struct input_keymap_entry {
> > >
> > > #define KEY_FN_F 0x1e2
> > > #define KEY_FN_S 0x1e3
> > > #define KEY_FN_B 0x1e4
> > >
> > > +#define KEY_FN_Q 0x1e5
> > > +#define KEY_FN_W 0x1e6
> > > +#define KEY_FN_R 0x1e7
> > > +#define KEY_FN_T 0x1e8
> > > +#define KEY_FN_A 0x1e9
> > > +#define KEY_FN_G 0x1ea
> >
> > What do they actually do?
> >
> > Thanks.
>
> All 10 combinations Fn+Q ... Fn+T, Fn+A ... Fn+G are reported by
> WMI and I need to assign some keycodes for them in dell-wmi
> driver.
If they do not have a well-defined meaning then KEY_UNKNOWN is
appropriate and user later can redefine via EVIOCSKEYCODE to the code
they wish.
> And because More FN_* constants are already defined in
> input.h I added those which are missing.
I am not sure if adding existing generic KEY_FN_* was a good idea.
>
> With this patch series I'm able to use above Fn combinations for
> my own keyboard shortcuts. Before this patch all Fn combinations
> were one same keycode - which was useless.
Are there not enough key definitions already to accommodate actions you
want? dell-wmi supports changing keymap from usersopace so you should be
able to remap entries you want to the actions you need.
Thanks.
--
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-05-17 21:32 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <201405171639.45722@pali>
2014-05-17 14:43 ` [PATCH 0/2] dell-wmi: Add support for Fn key combinations Pali Rohár
2014-05-17 14:43 ` [PATCH 1/2] Input: Add keycodes for some missing " Pali Rohár
2014-05-17 20:30 ` Dmitry Torokhov
2014-05-17 20:38 ` Pali Rohár
2014-05-17 21:32 ` Dmitry Torokhov
2014-05-17 14:43 ` [PATCH 2/2] dell-wmi: Add support for " Pali Rohár
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).