GIT 07fe3c5e30d88714785486ce6a0c9c082ec8af48 git+ssh://master.kernel.org/pub/scm/linux/kernel/git/dtor/input.git commit Author: Stephen Hemminger Date: Sun Dec 24 01:18:16 2006 -0500 Input: lifebook - add support for Lifebook 6210 Signed-off-by: Stephen Hemminger Signed-off-by: Dmitry Torokhov commit 26d7256d3b55672a5f671523259cc9582008ed29 Author: Phil Blundell Date: Thu Dec 21 00:59:54 2006 -0500 Input: gpio-keys - keyboard driver for GPIO buttons This is an interrupt-driven keyboard driver for simple buttons connected directly to CPU GPIO lines of embedded ARM systems. It supports pxa architectures and is used by a number of PDAs and PocketPC phones in the handhelds.org kernel. Support for other architectures, such as sa11xx and sc2410, will be added once generic GPIO API is available. Signed-off-by: Paul Sokolovsky Signed-off-by: Philipp Zabel Signed-off-by: Dmitry Torokhov commit ea41648d7275aae02d2a5f33dab089622857d0dd Author: Jiri Slaby Date: Thu Dec 21 00:43:15 2006 -0500 Input: hid-ff - add support for Logitech Momo racing wheel Add support for Logitech Momo racing wheel (046d:ca03) to hid force feedback. Signed-off-by: Jiri Slaby Signed-off-by: Andrew Morton Signed-off-by: Dmitry Torokhov commit 65a2d2258e0f29371606aa0f7f4258e618ecebe8 Author: Akinobu Mita Date: Thu Dec 21 00:42:55 2006 -0500 Input: pc110pad - return proper error The driver should return -ENODEV rather than -ENOENT when it detects a PCI device in the box. Signed-off-by: Akinobu Mita Signed-off-by: Dmitry Torokhov drivers/input/keyboard/Kconfig | 19 ++++ drivers/input/keyboard/Makefile | 5 + drivers/input/keyboard/gpio_keys.c | 147 ++++++++++++++++++++++++++++++++++ drivers/input/mouse/lifebook.c | 6 + drivers/input/mouse/pc110pad.c | 2 drivers/usb/input/hid-ff.c | 1 drivers/usb/input/hid-lgff.c | 1 include/asm-arm/hardware/gpio_keys.h | 17 ++++ 8 files changed, 192 insertions(+), 6 deletions(-) diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig index 049f2f5..1b81a72 100644 --- a/drivers/input/keyboard/Kconfig +++ b/drivers/input/keyboard/Kconfig @@ -135,12 +135,12 @@ config KEYBOARD_STOWAWAY config KEYBOARD_CORGI tristate "Corgi keyboard" depends on PXA_SHARPSL - default y + default y help - Say Y here to enable the keyboard on the Sharp Zaurus SL-C7xx + Say Y here to enable the keyboard on the Sharp Zaurus SL-C7xx series of PDAs. - To compile this driver as a module, choose M here: the + To compile this driver as a module, choose M here: the module will be called corgikbd. config KEYBOARD_SPITZ @@ -214,4 +214,17 @@ config KEYBOARD_AAED2000 To compile this driver as a module, choose M here: the module will be called aaed2000_kbd. +config KEYBOARD_GPIO + tristate "Buttons on CPU GPIOs (PXA)" + depends on ARCH_PXA + help + This driver implements support for buttons connected + directly to GPIO pins of PXA CPUs. + + Say Y here if your device has buttons connected + directly to GPIO pins of the CPU. + + To compile this driver as a module, choose M here: the + module will be called gpio-keys. + endif diff --git a/drivers/input/keyboard/Makefile b/drivers/input/keyboard/Makefile index 5687979..586a0fe 100644 --- a/drivers/input/keyboard/Makefile +++ b/drivers/input/keyboard/Makefile @@ -16,6 +16,7 @@ obj-$(CONFIG_KEYBOARD_CORGI) += corgikb obj-$(CONFIG_KEYBOARD_SPITZ) += spitzkbd.o obj-$(CONFIG_KEYBOARD_HIL) += hil_kbd.o obj-$(CONFIG_KEYBOARD_HIL_OLD) += hilkbd.o -obj-$(CONFIG_KEYBOARD_OMAP) += omap-keypad.o -obj-$(CONFIG_KEYBOARD_AAED2000) += aaed2000_kbd.o +obj-$(CONFIG_KEYBOARD_OMAP) += omap-keypad.o +obj-$(CONFIG_KEYBOARD_AAED2000) += aaed2000_kbd.o +obj-$(CONFIG_KEYBOARD_GPIO) += gpio_keys.o diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c new file mode 100644 index 0000000..3a8f1b4 --- /dev/null +++ b/drivers/input/keyboard/gpio_keys.c @@ -0,0 +1,147 @@ +/* + * Driver for keys on GPIO lines capable of generating interrupts. + * + * Copyright 2005 Phil Blundell + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +static irqreturn_t gpio_keys_isr(int irq, void *dev_id) +{ + int i; + struct platform_device *pdev = dev_id; + struct gpio_keys_platform_data *pdata = pdev->dev.platform_data; + struct input_dev *input = platform_get_drvdata(pdev); + + for (i = 0; i < pdata->nbuttons; i++) { + int gpio = pdata->buttons[i].gpio; + if (irq == IRQ_GPIO(gpio)) { + int state = ((GPLR(gpio) & GPIO_bit(gpio)) ? 1 : 0) ^ (pdata->buttons[i].active_low); + + input_report_key(input, pdata->buttons[i].keycode, state); + input_sync(input); + } + } + + return IRQ_HANDLED; +} + +static int __devinit gpio_keys_probe(struct platform_device *pdev) +{ + struct gpio_keys_platform_data *pdata = pdev->dev.platform_data; + struct input_dev *input; + int i, error; + + input = input_allocate_device(); + if (!input) + return -ENOMEM; + + platform_set_drvdata(pdev, input); + + input->evbit[0] = BIT(EV_KEY); + + input->name = pdev->name; + input->phys = "gpio-keys/input0"; + input->cdev.dev = &pdev->dev; + input->private = pdata; + + input->id.bustype = BUS_HOST; + input->id.vendor = 0x0001; + input->id.product = 0x0001; + input->id.version = 0x0100; + + for (i = 0; i < pdata->nbuttons; i++) { + int code = pdata->buttons[i].keycode; + int irq = IRQ_GPIO(pdata->buttons[i].gpio); + + set_irq_type(irq, IRQ_TYPE_EDGE_BOTH); + error = request_irq(irq, gpio_keys_isr, SA_SAMPLE_RANDOM, + pdata->buttons[i].desc ? pdata->buttons[i].desc : "gpio_keys", + pdev); + if (error) { + printk(KERN_ERR "gpio-keys: unable to claim irq %d; error %d\n", irq, ret); + goto fail; + } + set_bit(code, input->keybit); + } + + error = input_register_device(input); + if (error) { + printk(KERN_ERR "Unable to register gpio-keys input device\n"); + goto fail; + } + + return 0; + + fail: + for (i = i - 1; i >= 0; i--) + free_irq(IRQ_GPIO(pdata->buttons[i].gpio), pdev); + + input_free_device(input); + + return error; +} + +static int __devexit gpio_keys_remove(struct platform_device *pdev) +{ + struct gpio_keys_platform_data *pdata = pdev->dev.platform_data; + struct input_dev *input = platform_get_drvdata(pdev); + int i; + + for (i = 0; i < pdata->nbuttons; i++) { + int irq = IRQ_GPIO(pdata->buttons[i].gpio); + free_irq(irq, pdev); + } + + input_unregister_device(input); + + return 0; +} + +struct platform_driver gpio_keys_device_driver = { + .probe = gpio_keys_probe, + .remove = __devexit_p(gpio_keys_remove), + .driver = { + .name = "gpio-keys", + } +}; + +static int __init gpio_keys_init(void) +{ + return platform_driver_register(&gpio_keys_device_driver); +} + +static void __exit gpio_keys_exit(void) +{ + platform_driver_unregister(&gpio_keys_device_driver); +} + +module_init(gpio_keys_init); +module_exit(gpio_keys_exit); + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Phil Blundell "); +MODULE_DESCRIPTION("Keyboard driver for CPU GPIOs"); diff --git a/drivers/input/mouse/lifebook.c b/drivers/input/mouse/lifebook.c index 29542f0..938ae46 100644 --- a/drivers/input/mouse/lifebook.c +++ b/drivers/input/mouse/lifebook.c @@ -63,6 +63,12 @@ static struct dmi_system_id lifebook_dmi DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B142"), }, }, + { + .ident = "Lifebook B6210", + .matches = { + DMI_MATCH(DMI_PRODUCT_NAME, "Lifebook B6210"), + }, + }, { } }; diff --git a/drivers/input/mouse/pc110pad.c b/drivers/input/mouse/pc110pad.c index f155c1f..05d992e 100644 --- a/drivers/input/mouse/pc110pad.c +++ b/drivers/input/mouse/pc110pad.c @@ -113,7 +113,7 @@ static int __init pc110pad_init(void) dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, NULL); if (dev) { pci_dev_put(dev); - return -ENOENT; + return -ENODEV; } if (!request_region(pc110pad_io, 4, "pc110pad")) { diff --git a/drivers/usb/input/hid-ff.c b/drivers/usb/input/hid-ff.c index f8f660e..d8d02b4 100644 --- a/drivers/usb/input/hid-ff.c +++ b/drivers/usb/input/hid-ff.c @@ -56,6 +56,7 @@ #ifdef CONFIG_LOGITECH_FF { 0x46d, 0xc283, hid_lgff_init }, /* Logitech Wingman Force 3d */ { 0x46d, 0xc295, hid_lgff_init }, /* Logitech MOMO force wheel */ { 0x46d, 0xc219, hid_lgff_init }, /* Logitech Cordless rumble pad 2 */ + { 0x46d, 0xca03, hid_lgff_init }, /* Logitech MOMO force wheel */ #endif #ifdef CONFIG_THRUSTMASTER_FF { 0x44f, 0xb304, hid_tmff_init }, diff --git a/drivers/usb/input/hid-lgff.c b/drivers/usb/input/hid-lgff.c index e474662..645b0d2 100644 --- a/drivers/usb/input/hid-lgff.c +++ b/drivers/usb/input/hid-lgff.c @@ -52,6 +52,7 @@ static const struct device_type devices[ { 0x046d, 0xc211, ff_rumble }, { 0x046d, 0xc219, ff_rumble }, { 0x046d, 0xc283, ff_joystick }, + { 0x046d, 0xca03, ff_joystick }, { 0x0000, 0x0000, ff_joystick } }; diff --git a/include/asm-arm/hardware/gpio_keys.h b/include/asm-arm/hardware/gpio_keys.h new file mode 100644 index 0000000..2b217c7 --- /dev/null +++ b/include/asm-arm/hardware/gpio_keys.h @@ -0,0 +1,17 @@ +#ifndef _GPIO_KEYS_H +#define _GPIO_KEYS_H + +struct gpio_keys_button { + /* Configuration parameters */ + int keycode; + int gpio; + int active_low; + char *desc; +}; + +struct gpio_keys_platform_data { + struct gpio_keys_button *buttons; + int nbuttons; +}; + +#endif