linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input - Move KEY_{EURO, DOLLAR} to lower keycodes
@ 2007-11-16 13:41 Carlos Corbacho
  2007-11-16 13:47 ` Dmitry Torokhov
  0 siblings, 1 reply; 7+ messages in thread
From: Carlos Corbacho @ 2007-11-16 13:41 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input

From: Carlos Corbacho <cathectic@gmail.com>

These keys are used on PS/2 controllers, so their current values are too
high to map the scancodes to. Move them to the < 256 range.

Signed-off-by: Carlos Corbacho <cathectic@gmail.com>
---
This is one solution to my previously posted problem - just move the keycodes
to ones that can be used by setkeycodes.

 include/linux/input.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/input.h b/include/linux/input.h
index d423cf1..94c3c4b 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -371,6 +371,9 @@ struct input_absinfo {
 #define KEY_BRIGHTNESS_ZERO	244	/* brightness off, use ambient */
 #define KEY_DISPLAY_OFF		245	/* display device to off state */
 
+#define KEY_DOLLAR		246
+#define KEY_EURO		247
+
 #define BTN_MISC		0x100
 #define BTN_0			0x100
 #define BTN_1			0x101
@@ -527,9 +530,6 @@ struct input_absinfo {
 #define KEY_SPELLCHECK		0x1b0   /* AL Spell Check */
 #define KEY_LOGOFF		0x1b1   /* AL Logoff */
 
-#define KEY_DOLLAR		0x1b2
-#define KEY_EURO		0x1b3
-
 #define KEY_DEL_EOL		0x1c0
 #define KEY_DEL_EOS		0x1c1
 #define KEY_INS_LINE		0x1c2
-- 
1.5.3.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] Input - Move KEY_{EURO, DOLLAR} to lower keycodes
  2007-11-16 13:41 [PATCH] Input - Move KEY_{EURO, DOLLAR} to lower keycodes Carlos Corbacho
@ 2007-11-16 13:47 ` Dmitry Torokhov
  2007-11-16 13:49   ` Carlos Corbacho
  0 siblings, 1 reply; 7+ messages in thread
From: Dmitry Torokhov @ 2007-11-16 13:47 UTC (permalink / raw)
  To: Carlos Corbacho; +Cc: linux-input

Hi Carlos,

On Nov 16, 2007 8:41 AM, Carlos Corbacho <carlos@strangeworlds.co.uk> wrote:
> From: Carlos Corbacho <cathectic@gmail.com>
>
> These keys are used on PS/2 controllers, so their current values are too
> high to map the scancodes to. Move them to the < 256 range.
>

They should stay where they were. We need to change atkbd to use
ushorts in keymaps. I have a patch for it, I'll forward it to you
today or tomorrow.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Input - Move KEY_{EURO, DOLLAR} to lower keycodes
  2007-11-16 13:47 ` Dmitry Torokhov
@ 2007-11-16 13:49   ` Carlos Corbacho
  2007-12-11 19:28     ` Carlos Corbacho
  0 siblings, 1 reply; 7+ messages in thread
From: Carlos Corbacho @ 2007-11-16 13:49 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input

On Friday 16 November 2007 13:47:23 Dmitry Torokhov wrote:
> They should stay where they were. We need to change atkbd to use
> ushorts in keymaps. I have a patch for it, I'll forward it to you
> today or tomorrow.

Even better - cheers :)

-Carlos
-- 
E-Mail: carlos@strangeworlds.co.uk
Web: strangeworlds.co.uk
GPG Key ID: 0x23EE722D

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Input - Move KEY_{EURO, DOLLAR} to lower keycodes
  2007-11-16 13:49   ` Carlos Corbacho
@ 2007-12-11 19:28     ` Carlos Corbacho
  2008-05-30 19:39       ` Carlos Corbacho
  0 siblings, 1 reply; 7+ messages in thread
From: Carlos Corbacho @ 2007-12-11 19:28 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input

On Friday 16 November 2007 13:49:02 Carlos Corbacho wrote:
> On Friday 16 November 2007 13:47:23 Dmitry Torokhov wrote:
> > They should stay where they were. We need to change atkbd to use
> > ushorts in keymaps. I have a patch for it, I'll forward it to you
> > today or tomorrow.
> 
> Even better - cheers :)

Any news on this yet?

-Carlos
-- 
E-Mail: carlos@strangeworlds.co.uk
Web: strangeworlds.co.uk
GPG Key ID: 0x23EE722D

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Input - Move KEY_{EURO, DOLLAR} to lower keycodes
  2007-12-11 19:28     ` Carlos Corbacho
@ 2008-05-30 19:39       ` Carlos Corbacho
  2008-05-30 20:28         ` Dmitry Torokhov
  0 siblings, 1 reply; 7+ messages in thread
From: Carlos Corbacho @ 2008-05-30 19:39 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input

On Tuesday 11 December 2007 19:28:44 Carlos Corbacho wrote:
> On Friday 16 November 2007 13:49:02 Carlos Corbacho wrote:
> > On Friday 16 November 2007 13:47:23 Dmitry Torokhov wrote:
> > > They should stay where they were. We need to change atkbd to use
> > > ushorts in keymaps. I have a patch for it, I'll forward it to you
> > > today or tomorrow.
> >
> > Even better - cheers :)
>
> Any news on this yet?

Dmitry,

Any progress on this front, or are there other problems with this change that 
need to be fixed first?

-Carlos
-- 
E-Mail: carlos@strangeworlds.co.uk
Web: strangeworlds.co.uk
GPG Key ID: 0x23EE722D

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Input - Move KEY_{EURO, DOLLAR} to lower keycodes
  2008-05-30 19:39       ` Carlos Corbacho
@ 2008-05-30 20:28         ` Dmitry Torokhov
  2008-05-30 21:55           ` Carlos Corbacho
  0 siblings, 1 reply; 7+ messages in thread
From: Dmitry Torokhov @ 2008-05-30 20:28 UTC (permalink / raw)
  To: Carlos Corbacho; +Cc: linux-input

On Fri, May 30, 2008 at 08:39:03PM +0100, Carlos Corbacho wrote:
> On Tuesday 11 December 2007 19:28:44 Carlos Corbacho wrote:
> > On Friday 16 November 2007 13:49:02 Carlos Corbacho wrote:
> > > On Friday 16 November 2007 13:47:23 Dmitry Torokhov wrote:
> > > > They should stay where they were. We need to change atkbd to use
> > > > ushorts in keymaps. I have a patch for it, I'll forward it to you
> > > > today or tomorrow.
> > >
> > > Even better - cheers :)
> >
> > Any news on this yet?
> 
> Dmitry,
> 
> Any progress on this front, or are there other problems with this change that 
> need to be fixed first?
> 

Argh, forgot all about it, terribly sorry. How about the patch below?

-- 
Dmitry

Input: atkbd - use ushort instead of uchar keymap

Since some of the keycodes defined in input.h have values greater
than 255 we should use unsigned shorts in keymaps.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
 drivers/input/keyboard/atkbd.c |   20 ++++++++++----------
 include/linux/input.h          |    2 ++
 2 files changed, 12 insertions(+), 10 deletions(-)

Index: work/drivers/input/keyboard/atkbd.c
===================================================================
--- work.orig/drivers/input/keyboard/atkbd.c
+++ work/drivers/input/keyboard/atkbd.c
@@ -68,7 +68,7 @@ MODULE_PARM_DESC(extra, "Enable extra LE
  * are loadable via an userland utility.
  */
 
-static unsigned char atkbd_set2_keycode[512] = {
+static const unsigned short atkbd_set2_keycode[512] = {
 
 #ifdef CONFIG_KEYBOARD_ATKBD_HP_KEYCODES
 
@@ -99,7 +99,7 @@ static unsigned char atkbd_set2_keycode[
 #endif
 };
 
-static unsigned char atkbd_set3_keycode[512] = {
+static const unsigned short atkbd_set3_keycode[512] = {
 
 	  0,  0,  0,  0,  0,  0,  0, 59,  1,138,128,129,130, 15, 41, 60,
 	131, 29, 42, 86, 58, 16,  2, 61,133, 56, 44, 31, 30, 17,  3, 62,
@@ -115,7 +115,7 @@ static unsigned char atkbd_set3_keycode[
 	148,149,147,140
 };
 
-static unsigned char atkbd_unxlate_table[128] = {
+static const unsigned short atkbd_unxlate_table[128] = {
           0,118, 22, 30, 38, 37, 46, 54, 61, 62, 70, 69, 78, 85,102, 13,
          21, 29, 36, 45, 44, 53, 60, 67, 68, 77, 84, 91, 90, 20, 28, 27,
          35, 43, 52, 51, 59, 66, 75, 76, 82, 14, 18, 93, 26, 34, 33, 42,
@@ -161,7 +161,7 @@ static unsigned char atkbd_unxlate_table
 #define ATKBD_SCR_LEFT		249
 #define ATKBD_SCR_RIGHT		248
 
-#define ATKBD_SPECIAL		248
+#define ATKBD_SPECIAL		ATKBD_SCR_RIGHT
 
 #define ATKBD_LED_EVENT_BIT	0
 #define ATKBD_REP_EVENT_BIT	1
@@ -173,7 +173,7 @@ static unsigned char atkbd_unxlate_table
 #define ATKBD_XL_HANGEUL	0x10
 #define ATKBD_XL_HANJA		0x20
 
-static struct {
+static const struct {
 	unsigned char keycode;
 	unsigned char set2;
 } atkbd_scroll_keys[] = {
@@ -200,7 +200,7 @@ struct atkbd {
 	char phys[32];
 
 	unsigned short id;
-	unsigned char keycode[512];
+	unsigned short keycode[512];
 	DECLARE_BITMAP(force_release_mask, 512);
 	unsigned char set;
 	unsigned char translated;
@@ -357,7 +357,7 @@ static irqreturn_t atkbd_interrupt(struc
 	unsigned int code = data;
 	int scroll = 0, hscroll = 0, click = -1;
 	int value;
-	unsigned char keycode;
+	unsigned short keycode;
 
 #ifdef ATKBD_DEBUG
 	printk(KERN_DEBUG "atkbd.c: Received %02x flags %02x\n", data, flags);
@@ -961,16 +961,16 @@ static void atkbd_set_device_attrs(struc
 		input_dev->evbit[0] |= BIT_MASK(EV_REL);
 		input_dev->relbit[0] = BIT_MASK(REL_WHEEL) |
 			BIT_MASK(REL_HWHEEL);
-		set_bit(BTN_MIDDLE, input_dev->keybit);
+		__set_bit(BTN_MIDDLE, input_dev->keybit);
 	}
 
 	input_dev->keycode = atkbd->keycode;
-	input_dev->keycodesize = sizeof(unsigned char);
+	input_dev->keycodesize = sizeof(unsigned short);
 	input_dev->keycodemax = ARRAY_SIZE(atkbd_set2_keycode);
 
 	for (i = 0; i < 512; i++)
 		if (atkbd->keycode[i] && atkbd->keycode[i] < ATKBD_SPECIAL)
-			set_bit(atkbd->keycode[i], input_dev->keybit);
+			__set_bit(atkbd->keycode[i], input_dev->keybit);
 }
 
 /*
Index: work/include/linux/input.h
===================================================================
--- work.orig/include/linux/input.h
+++ work/include/linux/input.h
@@ -373,6 +373,8 @@ struct input_absinfo {
 
 #define KEY_WIMAX		246
 
+/* Range 248 - 255 is reserved for special needs of AT keyboard driver */
+
 #define BTN_MISC		0x100
 #define BTN_0			0x100
 #define BTN_1			0x101

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Input - Move KEY_{EURO, DOLLAR} to lower keycodes
  2008-05-30 20:28         ` Dmitry Torokhov
@ 2008-05-30 21:55           ` Carlos Corbacho
  0 siblings, 0 replies; 7+ messages in thread
From: Carlos Corbacho @ 2008-05-30 21:55 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input

On Friday 30 May 2008 21:28:57 Dmitry Torokhov wrote:
> Argh, forgot all about it, terribly sorry. How about the patch below?

Works fine here.

> Input: atkbd - use ushort instead of uchar keymap
>
> Since some of the keycodes defined in input.h have values greater
> than 255 we should use unsigned shorts in keymaps.
>
> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

Tested-by: Carlos Corbacho <carlos@strangeworlds.co.uk>

-Carlos
-- 
E-Mail: carlos@strangeworlds.co.uk
Web: strangeworlds.co.uk
GPG Key ID: 0x23EE722D

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-05-30 21:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-16 13:41 [PATCH] Input - Move KEY_{EURO, DOLLAR} to lower keycodes Carlos Corbacho
2007-11-16 13:47 ` Dmitry Torokhov
2007-11-16 13:49   ` Carlos Corbacho
2007-12-11 19:28     ` Carlos Corbacho
2008-05-30 19:39       ` Carlos Corbacho
2008-05-30 20:28         ` Dmitry Torokhov
2008-05-30 21:55           ` Carlos Corbacho

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).