Skip to contentSkip to conversation

input: tegra-kbc: Add Function keymap.

PATCH Superseded [email protected] 2 participants 11 messages Feb 8, 2011 – Feb 15, 2011

Subsystems (6)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 input: tegra-kbc: Add Function keymap.

From: Rakesh Iyer <[email protected]>

Add Fn keymap support to allow for internal processing of Fn keys.

---
Added support for Fn keymap within tegra keyboard driver.

 arch/arm/mach-tegra/include/mach/kbc.h |    1 +
 drivers/input/keyboard/tegra-kbc.c     |   50 ++++++++++++++++++++++++++++++--
 2 files changed, 48 insertions(+), 3 deletions(-)
arch/arm/mach-tegra/include/mach/kbc.h +1 -0
index 66ad276..04c7798 100644
@@ -57,5 +57,6 @@ struct tegra_kbc_platform_data {
 	const struct matrix_keymap_data *keymap_data;
 
 	bool wakeup;
+	bool use_fn_map;
 };
 #endif
drivers/input/keyboard/tegra-kbc.c +47 -3

136 lines not on this page · raw message

Signature · 9 lines
1.7.0.4


-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
maintainer
#1 lore raw
Quoted 56 lines · On Tue, Feb 08, 2011 at 12:56:24PM -0800, [email protected] wrote:

From: Rakesh Iyer <[email protected]>

Add Fn keymap support to allow for internal processing of Fn keys.

---
Added support for Fn keymap within tegra keyboard driver.

 arch/arm/mach-tegra/include/mach/kbc.h |    1 +
 drivers/input/keyboard/tegra-kbc.c     |   50 ++++++++++++++++++++++++++++++--
 2 files changed, 48 insertions(+), 3 deletions(-)
arch/arm/mach-tegra/include/mach/kbc.h +1 -0
index 66ad276..04c7798 100644
@@ -57,5 +57,6 @@ struct tegra_kbc_platform_data {
 	const struct matrix_keymap_data *keymap_data;
 
 	bool wakeup;
+	bool use_fn_map;
 };
 #endif
drivers/input/keyboard/tegra-kbc.c +4 -2
index ac471b7..9f7bd2e 100644
@@ -60,7 +60,7 @@
 #define KBC_KP_ENT1_0	0x34
 #define KBC_ROW0_MASK_0	0x38
 
-#define KBC_ROW_SHIFT	3
+#define KBC_ROW_SHIFT	4
 
 struct tegra_kbc {
 	void __iomem *mmio;
@@ -71,8 +71,9 @@ struct tegra_kbc {
 	spinlock_t lock;
 	unsigned int repoll_dly;
 	unsigned long cp_dly_jiffies;
+	bool use_fn_map;
 	const struct tegra_kbc_platform_data *pdata;
-	unsigned short keycode[KBC_MAX_KEY];
+	unsigned short keycode[KBC_MAX_KEY * 2];
 	unsigned short current_keys[KBC_MAX_KPENT];
 	unsigned int num_pressed_keys;
 	struct timer_list timer;
@@ -107,6 +108,7 @@ static const u32 tegra_kbc_default_keymap[] = {
 	KEY(4, 5, KEY_V),
 	KEY(4, 6, KEY_C),
 	KEY(4, 7, KEY_SPACE),
+	KEY(4, 8, KEY_7),
 
 	KEY(5, 0, KEY_9),
 	KEY(5, 1, KEY_8),

drivers/input/keyboard/tegra-kbc.c static const u32 tegra_kbc_default_keymap[] = { · line 124

Quoted 7 lines
drivers/input/keyboard/tegra-kbc.c +4 -0
@@ -116,6 +118,10 @@ static const u32 tegra_kbc_default_keymap[] = {
 	KEY(5, 5, KEY_N),
 	KEY(5, 6, KEY_B),
 	KEY(5, 7, KEY_BACKSLASH),
+	KEY(5, 8, KEY_9),
+	KEY(5, 9, KEY_8),
+	KEY(5, 10, KEY_4),
+	KEY(5, 12, KEY_1),

I think Fn emulates keypad here, so KEY_KP9, KEY_KP8, etc.

Quoted 58 lines
drivers/input/keyboard/tegra-kbc.c +19 -0
 	KEY(6, 0, KEY_MINUS),
 	KEY(6, 1, KEY_0),
@@ -125,6 +131,12 @@ static const u32 tegra_kbc_default_keymap[] = {
 	KEY(6, 5, KEY_K),
 	KEY(6, 6, KEY_COMMA),
 	KEY(6, 7, KEY_M),
+	KEY(6, 9, KEY_SLASH),
+	KEY(6, 10, KEY_6),
+	KEY(6, 11, KEY_5),
+	KEY(6, 12, KEY_3),
+	KEY(6, 13, KEY_2),
+	KEY(6, 15, KEY_0),
 
 	KEY(7, 1, KEY_EQUAL),
 	KEY(7, 2, KEY_RIGHTBRACE),
@@ -143,6 +155,10 @@ static const u32 tegra_kbc_default_keymap[] = {
 	KEY(11, 3, KEY_SEMICOLON),
 	KEY(11, 4, KEY_SLASH),
 	KEY(11, 5, KEY_DOT),
+	KEY(11, 9, KEY_KPASTERISK),
+	KEY(11, 11, KEY_KPMINUS),
+	KEY(11, 12, KEY_KPPLUS),
+	KEY(11, 13, KEY_DOT),
 
 	KEY(12, 0, KEY_F10),
 	KEY(12, 1, KEY_F9),
@@ -152,6 +168,7 @@ static const u32 tegra_kbc_default_keymap[] = {
 	KEY(12, 5, KEY_UP),
 	KEY(12, 6, KEY_PRINT),
 	KEY(12, 7, KEY_PAUSE),
+	KEY(12, 13, KEY_VOLUMEUP),
 
 	KEY(13, 0, KEY_INSERT),
 	KEY(13, 1, KEY_DELETE),
@@ -160,6 +177,11 @@ static const u32 tegra_kbc_default_keymap[] = {
 	KEY(13, 5, KEY_RIGHT),
 	KEY(13, 6, KEY_DOWN),
 	KEY(13, 7, KEY_LEFT),
+	KEY(13, 11, KEY_HOME),
+	KEY(13, 12, KEY_END),
+	KEY(13, 13, KEY_BRIGHTNESSDOWN),
+	KEY(13, 14, KEY_VOLUMEDOWN),
+	KEY(13, 15, KEY_BRIGHTNESSUP),
 
 	KEY(14, 0, KEY_F11),
 	KEY(14, 1, KEY_F12),
@@ -169,6 +191,9 @@ static const u32 tegra_kbc_default_keymap[] = {
 	KEY(14, 5, KEY_F3),
 	KEY(14, 6, KEY_1),
 	KEY(14, 7, KEY_F7),
+	KEY(14, 8, KEY_NUMLOCK),
+	KEY(14, 9, KEY_SCROLLLOCK),
+	KEY(14, 10, KEY_MUTE),
 
 	KEY(15, 0, KEY_ESC),
 	KEY(15, 1, KEY_GRAVE),

drivers/input/keyboard/tegra-kbc.c static const u32 tegra_kbc_default_keymap[] = { · line 206

Quoted 4 lines
drivers/input/keyboard/tegra-kbc.c +1 -0
@@ -178,6 +203,7 @@ static const u32 tegra_kbc_default_keymap[] = {
 	KEY(15, 5, KEY_F2),
 	KEY(15, 6, KEY_CAPSLOCK),
 	KEY(15, 7, KEY_F6),
+	KEY(15, 12, KEY_QUESTION),

Not KEY_SLASH or similar?

Signature · 1 line
Dmitry
#2 lore raw
Quoted 64 lines
Quoted 57 lines
drivers/input/keyboard/tegra-kbc.c +19 -0
 	KEY(6, 0, KEY_MINUS),
 	KEY(6, 1, KEY_0),
@@ -125,6 +131,12 @@ static const u32 tegra_kbc_default_keymap[] = {
 	KEY(6, 5, KEY_K),
 	KEY(6, 6, KEY_COMMA),
 	KEY(6, 7, KEY_M),
+	KEY(6, 9, KEY_SLASH),
+	KEY(6, 10, KEY_6),
+	KEY(6, 11, KEY_5),
+	KEY(6, 12, KEY_3),
+	KEY(6, 13, KEY_2),
+	KEY(6, 15, KEY_0),
 
 	KEY(7, 1, KEY_EQUAL),
 	KEY(7, 2, KEY_RIGHTBRACE),
@@ -143,6 +155,10 @@ static const u32 tegra_kbc_default_keymap[] = {
 	KEY(11, 3, KEY_SEMICOLON),
 	KEY(11, 4, KEY_SLASH),
 	KEY(11, 5, KEY_DOT),
+	KEY(11, 9, KEY_KPASTERISK),
+	KEY(11, 11, KEY_KPMINUS),
+	KEY(11, 12, KEY_KPPLUS),
+	KEY(11, 13, KEY_DOT),
 
 	KEY(12, 0, KEY_F10),
 	KEY(12, 1, KEY_F9),
@@ -152,6 +168,7 @@ static const u32 tegra_kbc_default_keymap[] = {
 	KEY(12, 5, KEY_UP),
 	KEY(12, 6, KEY_PRINT),
 	KEY(12, 7, KEY_PAUSE),
+	KEY(12, 13, KEY_VOLUMEUP),
 
 	KEY(13, 0, KEY_INSERT),
 	KEY(13, 1, KEY_DELETE),
@@ -160,6 +177,11 @@ static const u32 tegra_kbc_default_keymap[] = {
 	KEY(13, 5, KEY_RIGHT),
 	KEY(13, 6, KEY_DOWN),
 	KEY(13, 7, KEY_LEFT),
+	KEY(13, 11, KEY_HOME),
+	KEY(13, 12, KEY_END),
+	KEY(13, 13, KEY_BRIGHTNESSDOWN),
+	KEY(13, 14, KEY_VOLUMEDOWN),
+	KEY(13, 15, KEY_BRIGHTNESSUP),
 
 	KEY(14, 0, KEY_F11),
 	KEY(14, 1, KEY_F12),
@@ -169,6 +191,9 @@ static const u32 tegra_kbc_default_keymap[] = {
 	KEY(14, 5, KEY_F3),
 	KEY(14, 6, KEY_1),
 	KEY(14, 7, KEY_F7),
+	KEY(14, 8, KEY_NUMLOCK),
+	KEY(14, 9, KEY_SCROLLLOCK),
+	KEY(14, 10, KEY_MUTE),
 
 	KEY(15, 0, KEY_ESC),
 	KEY(15, 1, KEY_GRAVE),

drivers/input/keyboard/tegra-kbc.c static const u32 tegra_kbc_default_keymap[] = { · line 206

Quoted 4 lines
drivers/input/keyboard/tegra-kbc.c +1 -0
@@ -178,6 +203,7 @@ static const u32 tegra_kbc_default_keymap[] = {
 	KEY(15, 5, KEY_F2),
 	KEY(15, 6, KEY_CAPSLOCK),
 	KEY(15, 7, KEY_F6),
+	KEY(15, 12, KEY_QUESTION),

Not KEY_SLASH or similar?

Quoted 2 lines

--
Dmitry

Actually in this keyboard layout that key indeed maps to KEY_QUESTION and not KEY_SLASH. Is that unexpected.

Regards
Rakesh
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------

maintainer
#3 lore raw
Quoted 11 lines · Rakesh Iyer
Quoted 11 lines

drivers/input/keyboard/tegra-kbc.c static const u32 tegra_kbc_default_keymap[] = { · line 206

Quoted 8 lines
drivers/input/keyboard/tegra-kbc.c +1 -0
 	KEY(15, 0, KEY_ESC),
 	KEY(15, 1, KEY_GRAVE),
@@ -178,6 +203,7 @@ static const u32 tegra_kbc_default_keymap[] = {
 	KEY(15, 5, KEY_F2),
 	KEY(15, 6, KEY_CAPSLOCK),
 	KEY(15, 7, KEY_F6),
+	KEY(15, 12, KEY_QUESTION),

Not KEY_SLASH or similar?

Quoted 3 lines

Actually in this keyboard layout that key indeed maps to KEY_QUESTION and not KEY_SLASH. Is that unexpected.

So it is a dedicated key for a question mark? KEY_QUESTION is not really that although we could re-purpose it (the USB keyboard that is currently using this keycode most likely wants KEY_HELP or similar).

Is there a picture of physical keypad somewhere?

Signature · 1 line
Dmitry
#4 lore raw

The following is a public image of the same keyboard we are using as default.

http://www.laptopguts.co.uk/ekmps/shops/laptopguts/images/acer-aspire-3690-series-laptop-keyboard-uk-layout-108-p[ekm]758x300[ekm].jpg

Regards
Rakesh

Quoted 24 lines

-----Original Message-----
From: Dmitry Torokhov [mailto:[email protected]]
Sent: Tuesday, February 15, 2011 10:55 AM
To: Rakesh Iyer
Cc: [email protected]; [email protected]; Andrew Chew
Subject: Re: [PATCH v1] input: tegra-kbc: Add Function keymap.

Quoted 11 lines · Rakesh Iyer
Quoted 11 lines

drivers/input/keyboard/tegra-kbc.c static const u32 tegra_kbc_default_keymap[] = { · line 206

Quoted 8 lines
drivers/input/keyboard/tegra-kbc.c +1 -0
 	KEY(15, 0, KEY_ESC),
 	KEY(15, 1, KEY_GRAVE),
@@ -178,6 +203,7 @@ static const u32 tegra_kbc_default_keymap[] = {
 	KEY(15, 5, KEY_F2),
 	KEY(15, 6, KEY_CAPSLOCK),
 	KEY(15, 7, KEY_F6),
+	KEY(15, 12, KEY_QUESTION),

Not KEY_SLASH or similar?

Quoted 1 line

Actually in this keyboard layout that key indeed maps to KEY_QUESTION and not

KEY_SLASH.

Quoted 2 lines

Is that unexpected.

Quoted 8 lines

So it is a dedicated key for a question mark? KEY_QUESTION is not really that although we could re-purpose it (the USB keyboard that is currently using this keycode most likely wants KEY_HELP or similar).

Is there a picture of physical keypad somewhere?

--
Dmitry

-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------

#5 lore raw

Just wanted to add -> some of the keys on the extreme right are not present in our keyboard (Euro and Dollar) and some others such as PgUp, PgDown are laid out differently.

Regards
Rakesh

Quoted 7 lines

-----Original Message-----
From: Rakesh Iyer
Sent: Tuesday, February 15, 2011 11:47 AM
To: 'Dmitry Torokhov'
Cc: [email protected]; [email protected]; Andrew Chew
Subject: RE: [PATCH v1] input: tegra-kbc: Add Function keymap.

Quoted 39 lines

The following is a public image of the same keyboard we are using as default.

http://www.laptopguts.co.uk/ekmps/shops/laptopguts/images/acer-aspire-3690-series-laptop-
keyboard-uk-layout-108-p[ekm]758x300[ekm].jpg

Regards
Rakesh

Quoted 32 lines

-----Original Message-----
From: Dmitry Torokhov [mailto:[email protected]]
Sent: Tuesday, February 15, 2011 10:55 AM
To: Rakesh Iyer
Cc: [email protected]; [email protected]; Andrew Chew
Subject: Re: [PATCH v1] input: tegra-kbc: Add Function keymap.

Quoted 11 lines · Rakesh Iyer
Quoted 11 lines

drivers/input/keyboard/tegra-kbc.c static const u32 tegra_kbc_default_keymap[] = { · line 206

Quoted 8 lines
drivers/input/keyboard/tegra-kbc.c +1 -0
 	KEY(15, 0, KEY_ESC),
 	KEY(15, 1, KEY_GRAVE),
@@ -178,6 +203,7 @@ static const u32 tegra_kbc_default_keymap[] = {
 	KEY(15, 5, KEY_F2),
 	KEY(15, 6, KEY_CAPSLOCK),
 	KEY(15, 7, KEY_F6),
+	KEY(15, 12, KEY_QUESTION),

Not KEY_SLASH or similar?

Quoted 1 line

Actually in this keyboard layout that key indeed maps to KEY_QUESTION and not

KEY_SLASH.

Quoted 2 lines

Is that unexpected.

So it is a dedicated key for a question mark? KEY_QUESTION is not really that although we could re-purpose it (the USB keyboard that is currently using this keycode most likely wants KEY_HELP or similar).

Is there a picture of physical keypad somewhere?

--
Dmitry

-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------

maintainer
#6 lore raw
Quoted 2 lines · Rakesh Iyer

Just wanted to add -> some of the keys on the extreme right are not present in our keyboard (Euro and Dollar) and some others such as PgUp, PgDown are laid out differently.

OK, sp what is the intended function of that '?' key? Should it produce question mark or is it a hotkey for invoking help function?

Thanks.

Signature · 1 line
Dmitry
#7 lore raw

We do not have a special definition for that key in our system, and going by the original intention it seems it's a help function for the hotkeys.

As far as our system is concerned we do not need the key to do that. Maybe I can avoid mapping that key. Does that seem reasonable?

Thank and Regards
Rakesh

Quoted 12 lines

-----Original Message-----
From: Dmitry Torokhov [mailto:[email protected]]
Sent: Tuesday, February 15, 2011 12:01 PM
To: Rakesh Iyer
Cc: '[email protected]'; '[email protected]'; Andrew Chew
Subject: Re: [PATCH v1] input: tegra-kbc: Add Function keymap.

Quoted 1 line · Rakesh Iyer

Just wanted to add -> some of the keys on the extreme right are not present in our

keyboard (Euro and Dollar) and some others such as PgUp, PgDown are laid out differently.

Quoted 1 line
Quoted 7 lines

OK, sp what is the intended function of that '?' key? Should it produce question mark or is it a hotkey for invoking help function?

Thanks.

--
Dmitry

-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------

#8 lore raw

To add, Does the rest of the patch look okay esp sent as Patch v3?

Regards
Rakesh

Quoted 47 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Rakesh Iyer
Sent: Tuesday, February 15, 2011 1:44 PM
To: 'Dmitry Torokhov'
Cc: '[email protected]'; '[email protected]'; Andrew Chew
Subject: RE: [PATCH v1] input: tegra-kbc: Add Function keymap.

We do not have a special definition for that key in our system, and going by the original intention it seems it's a help function for the hotkeys.

As far as our system is concerned we do not need the key to do that. Maybe I can avoid mapping that key. Does that seem reasonable?

Thank and Regards
Rakesh

Quoted 10 lines

-----Original Message-----
From: Dmitry Torokhov [mailto:[email protected]]
Sent: Tuesday, February 15, 2011 12:01 PM
To: Rakesh Iyer
Cc: '[email protected]'; '[email protected]'; Andrew Chew
Subject: Re: [PATCH v1] input: tegra-kbc: Add Function keymap.

Quoted 1 line · Rakesh Iyer

Just wanted to add -> some of the keys on the extreme right are not present in our

keyboard (Euro and Dollar) and some others such as PgUp, PgDown are laid out

differently.

Quoted 9 lines
Quoted 1 line

OK, sp what is the intended function of that '?' key? Should it produce question mark or is it a hotkey for invoking help function?

Thanks.

--
Dmitry

-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#9 lore raw
In reply to Rakesh Iyer
Quoted 4 lines · Rakesh Iyer

We do not have a special definition for that key in our system, and going by the original intention it seems it's a help function for the hotkeys.

As far as our system is concerned we do not need the key to do that. Maybe I can avoid mapping that key. Does that seem reasonable?

Let's just map it to:

#define KEY_HELP 138 /* AL Integrated Help Center */

No need to resend if you agree, I'll simply edit locally.

Thanks.

Signature · 1 line
Dmitry
#10 lore raw

Yeah that's perfect.

Regards
Rakesh

Quoted 17 lines

-----Original Message-----
From: Dmitry Torokhov [mailto:[email protected]]
Sent: Tuesday, February 15, 2011 1:54 PM
To: Rakesh Iyer
Cc: '[email protected]'; '[email protected]'; Andrew Chew
Subject: Re: [PATCH v1] input: tegra-kbc: Add Function keymap.

Quoted 1 line · Rakesh Iyer

We do not have a special definition for that key in our system, and going by the original

intention it seems it's a help function for the hotkeys.

Quoted 2 lines

As far as our system is concerned we do not need the key to do that. Maybe I can avoid

mapping that key. Does that seem reasonable?

Quoted 1 line

Let's just map it to:

Quoted 8 lines

#define KEY_HELP 138 /* AL Integrated Help Center */

No need to resend if you agree, I'll simply edit locally.

Thanks.

--
Dmitry

-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------