diff options
author | Jeremy Lainé <jeremy.laine@m4x.org> | 2008-12-22 08:14:51 +0100 |
---|---|---|
committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2008-12-22 08:14:51 +0100 |
commit | bc01e920ab6319679ab1f29f3b3e2e0258c2ab55 (patch) | |
tree | ab3b84137015518ca70b91e12c1b1882aca33d4f /packages/linux | |
parent | 389bb8d311f1b9a47be6c28b0cc056fd4036f97b (diff) |
linux-2.6.26: fix boc01 keyboard driver's repeat rate
Diffstat (limited to 'packages/linux')
-rw-r--r-- | packages/linux/linux-2.6.26/boc01/012-081222-cy3218-btns.patch (renamed from packages/linux/linux-2.6.26/boc01/012-081218-cy3218-btns.patch) | 80 | ||||
-rw-r--r-- | packages/linux/linux_2.6.26.bb | 4 |
2 files changed, 35 insertions, 49 deletions
diff --git a/packages/linux/linux-2.6.26/boc01/012-081218-cy3218-btns.patch b/packages/linux/linux-2.6.26/boc01/012-081222-cy3218-btns.patch index d5985f3f0a..91211e301f 100644 --- a/packages/linux/linux-2.6.26/boc01/012-081218-cy3218-btns.patch +++ b/packages/linux/linux-2.6.26/boc01/012-081222-cy3218-btns.patch @@ -1,14 +1,15 @@ -diff -Nru linux-2.6.26.orig/drivers/input/misc/cy3218-btns.c linux-2.6.26/drivers/input/misc/cy3218-btns.c +diff -urN linux-2.6.26.orig/drivers/input/misc/cy3218-btns.c linux-2.6.26/drivers/input/misc/cy3218-btns.c --- linux-2.6.26.orig/drivers/input/misc/cy3218-btns.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.26/drivers/input/misc/cy3218-btns.c 2008-11-21 12:11:43.000000000 +0100 -@@ -0,0 +1,215 @@ ++++ linux-2.6.26/drivers/input/misc/cy3218-btns.c 2008-12-22 07:50:48.000000000 +0100 +@@ -0,0 +1,201 @@ +/* + * CAPSENSE Interface driver + * + * + * Copyright (C) 2007, CenoSYS (www.cenosys.com). -+ * Guillaume Ligneul -+ * Guillaume.ligneul@gmail.com ++ * ++ * Guillaume Ligneul <guillaume.ligneul@gmail.com> ++ * Jeremy Lainé <jeremy.laine@bolloretelecom.eu> + * + * This software program is licensed subject to the GNU General Public License + * (GPL).Version 2,June 1991, available at http://www.fsf.org/copyleft/gpl.html @@ -58,64 +59,50 @@ diff -Nru linux-2.6.26.orig/drivers/input/misc/cy3218-btns.c linux-2.6.26/driver +struct cy3218 { + struct input_polled_dev *ipdev; + struct i2c_client client; ++ unsigned char key_state; +}; + -+static void report_key(struct input_dev *input, unsigned keycode) -+{ -+ input_report_key(input, keycode, 1); -+ input_sync(input); -+ -+ input_report_key(input, keycode, 0); -+ input_sync(input); -+} -+ +unsigned short keymap[5] = { -+ KEY_UP, -+ KEY_F1, -+ KEY_ENTER, -+ KEY_DOWN, -+ KEY_BACKSPACE, ++ KEY_UP, ++ KEY_F1, ++ KEY_ENTER, ++ KEY_DOWN, ++ KEY_BACKSPACE, +}; + +static void handle_buttons(struct input_polled_dev *dev) +{ + u8 uValue; + struct cy3218 *capsense = dev->private; -+ struct input_dev *idev = dev->input; -+ ++ unsigned char new_state = 0; ++ unsigned char changed; ++ int i; + + uValue = i2c_smbus_read_byte_data(&capsense->client, CAP_STATE_GP1); + + if(uValue == MASK0) -+ { -+ report_key(idev, keymap[0]); -+ printk("Bouton UP\n"); -+ } ++ new_state |= 1; + + uValue = i2c_smbus_read_byte_data(&capsense->client, CAP_STATE_GP0); + + if(uValue == MASK0) -+ { -+ report_key(idev, keymap[1]); -+ printk("Bouton HELP\n"); -+ } ++ new_state |= 2; + + if(uValue == MASK1) -+ { -+ report_key(idev, keymap[2]); -+ printk("Bouton OK\n"); -+ } ++ new_state |= 4; + + if(uValue == MASK2) -+ { -+ report_key(idev, keymap[3]); -+ printk("Bouton DOWN\n"); -+ } ++ new_state |= 8; ++ + if(uValue == MASK3) -+ { -+ report_key(idev, keymap[4]); -+ printk("Bouton BACK\n"); -+ } ++ new_state |= 16; ++ ++ changed = capsense->key_state ^ new_state; ++ for (i = 0; i < ARRAY_SIZE(keymap); i++) ++ if (changed & (1 << i)) ++ input_report_key(dev->input, keymap[i], (new_state & (1 << i))); ++ capsense->key_state = new_state; ++ input_sync(dev->input); +} + +static int @@ -138,6 +125,7 @@ diff -Nru linux-2.6.26.orig/drivers/input/misc/cy3218-btns.c linux-2.6.26/driver + if (!ipdev) + goto failout; + ++ capsense->key_state = 0; + capsense->ipdev = ipdev; + capsense->client.adapter = adapter; + capsense->client.addr = addr; @@ -166,7 +154,6 @@ diff -Nru linux-2.6.26.orig/drivers/input/misc/cy3218-btns.c linux-2.6.26/driver + input_set_capability(input, EV_MSC, MSC_SCAN); + set_bit(EV_KEY, ipdev->input->evbit); + -+ + for (i = 0; i < ARRAY_SIZE(keymap); i++) + set_bit(keymap[i], ipdev->input->keybit); + @@ -184,7 +171,6 @@ diff -Nru linux-2.6.26.orig/drivers/input/misc/cy3218-btns.c linux-2.6.26/driver + return err; +} + -+ +static int +capsense_attach_adapter (struct i2c_adapter *adapter) +{ @@ -217,9 +203,9 @@ diff -Nru linux-2.6.26.orig/drivers/input/misc/cy3218-btns.c linux-2.6.26/driver +MODULE_LICENSE("GPL"); +module_init(capsense_buttons_init); +module_exit(capsense_buttons_exit); -diff -Nru linux-2.6.26.orig/drivers/input/misc/Kconfig linux-2.6.26/drivers/input/misc/Kconfig +diff -urN linux-2.6.26.orig/drivers/input/misc/Kconfig linux-2.6.26/drivers/input/misc/Kconfig --- linux-2.6.26.orig/drivers/input/misc/Kconfig 2008-07-13 23:51:29.000000000 +0200 -+++ linux-2.6.26/drivers/input/misc/Kconfig 2008-11-21 10:50:56.000000000 +0100 ++++ linux-2.6.26/drivers/input/misc/Kconfig 2008-12-22 07:47:08.000000000 +0100 @@ -197,4 +197,12 @@ Say Y here if you want to support the built-in real time clock of the HP SDC controller. @@ -233,9 +219,9 @@ diff -Nru linux-2.6.26.orig/drivers/input/misc/Kconfig linux-2.6.26/drivers/inpu + To change poll interval, invoque poll parameter in msecs. + endif -diff -Nru linux-2.6.26.orig/drivers/input/misc/Makefile linux-2.6.26/drivers/input/misc/Makefile +diff -urN linux-2.6.26.orig/drivers/input/misc/Makefile linux-2.6.26/drivers/input/misc/Makefile --- linux-2.6.26.orig/drivers/input/misc/Makefile 2008-07-13 23:51:29.000000000 +0200 -+++ linux-2.6.26/drivers/input/misc/Makefile 2008-11-21 10:50:56.000000000 +0100 ++++ linux-2.6.26/drivers/input/misc/Makefile 2008-12-22 07:47:19.000000000 +0100 @@ -19,3 +19,4 @@ obj-$(CONFIG_HP_SDC_RTC) += hp_sdc_rtc.o obj-$(CONFIG_INPUT_UINPUT) += uinput.o diff --git a/packages/linux/linux_2.6.26.bb b/packages/linux/linux_2.6.26.bb index 36887a137a..965e25eda2 100644 --- a/packages/linux/linux_2.6.26.bb +++ b/packages/linux/linux_2.6.26.bb @@ -1,6 +1,6 @@ require linux.inc -PR = "r6" +PR = "r7" # Mark archs/machines that this kernel supports DEFAULT_PREFERENCE = "-1" @@ -22,7 +22,7 @@ SRC_URI_append_boc01 = "\ file://008-081127-spi.patch;patch=1 \ file://010-081105-mii.patch;patch=1 \ file://011-081202-gpio.patch;patch=1 \ - file://012-081218-cy3218-btns.patch;patch=1 \ + file://012-081222-cy3218-btns.patch;patch=1 \ file://013-081212-lcd.patch;patch=1 \ " |