Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/dtor/input

Pull input updates from Dmitry Torokhov:
 "Two new touchpad drivers - Cypress APA I2C Trackpad and Cypress PS/2
  touchpad and a big update to ALPS driver from Kevin Cernekee that adds
  support for "Rushmore" touchpads and paves way for adding support for
  "Dolphin" touchpads.

  There is also a new input driver for Goldfish emulator and also
  Android keyreset driver was folded into SysRq code.

  A few more drivers were updated with device tree bindings and others
  got some small cleanups and fixes."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (55 commits)
  Input: cyttsp-spi - remove duplicate MODULE_ALIAS()
  Input: tsc2005 - add MODULE_ALIAS
  Input: tegra-kbc - require CONFIG_OF, remove platform data
  Input: synaptics - initialize pointer emulation usage
  Input: MT - do not apply filtering on emulated events
  Input: bma150 - make some defines public and fix some comments
  Input: bma150 - fix checking pm_runtime_get_sync() return value
  Input: ALPS - enable trackstick on Rushmore touchpads
  Input: ALPS - add support for "Rushmore" touchpads
  Input: ALPS - make the V3 packet field decoder "pluggable"
  Input: ALPS - move pixel and bitmap info into alps_data struct
  Input: ALPS - fix command mode check
  Input: ALPS - rework detection of Pinnacle AGx touchpads
  Input: ALPS - move {addr,nibble}_command settings into alps_set_defaults()
  Input: ALPS - use function pointers for different protocol handlers
  Input: ALPS - rework detection sequence
  Input: ALPS - introduce helper function for repeated commands
  Input: ALPS - move alps_get_model() down below hw_init code
  Input: ALPS - copy "model" info into alps_data struct
  Input: ALPS - document the alps.h data structures
  ...
  • Loading branch information
torvalds committed Feb 20, 2013
2 parents 5a12039 + 2d9f0d9 commit c6699b5
Show file tree
Hide file tree
Showing 41 changed files with 3,608 additions and 1,182 deletions.
53 changes: 53 additions & 0 deletions Documentation/devicetree/bindings/input/imx-keypad.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
* Freescale i.MX Keypad Port(KPP) device tree bindings

The KPP is designed to interface with a keypad matrix with 2-point contact
or 3-point contact keys. The KPP is designed to simplify the software task
of scanning a keypad matrix. The KPP is capable of detecting, debouncing,
and decoding one or multiple keys pressed simultaneously on a keypad.

Required SoC Specific Properties:
- compatible: Should be "fsl,<soc>-kpp".

- reg: Physical base address of the KPP and length of memory mapped
region.

- interrupts: The KPP interrupt number to the CPU(s).

- clocks: The clock provided by the SoC to the KPP. Some SoCs use dummy
clock(The clock for the KPP is provided by the SoCs automatically).

Required Board Specific Properties:
- pinctrl-names: The definition can be found at
pinctrl/pinctrl-bindings.txt.

- pinctrl-0: The definition can be found at
pinctrl/pinctrl-bindings.txt.

- linux,keymap: The definition can be found at
bindings/input/matrix-keymap.txt.

Example:
kpp: kpp@73f94000 {
compatible = "fsl,imx51-kpp", "fsl,imx21-kpp";
reg = <0x73f94000 0x4000>;
interrupts = <60>;
clocks = <&clks 0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_kpp_1>;
linux,keymap = <0x00000067 /* KEY_UP */
0x0001006c /* KEY_DOWN */
0x00020072 /* KEY_VOLUMEDOWN */
0x00030066 /* KEY_HOME */
0x0100006a /* KEY_RIGHT */
0x01010069 /* KEY_LEFT */
0x0102001c /* KEY_ENTER */
0x01030073 /* KEY_VOLUMEUP */
0x02000040 /* KEY_F6 */
0x02010042 /* KEY_F8 */
0x02020043 /* KEY_F9 */
0x02030044 /* KEY_F10 */
0x0300003b /* KEY_F1 */
0x0301003c /* KEY_F2 */
0x0302003d /* KEY_F3 */
0x03030074>; /* KEY_POWER */
};
22 changes: 22 additions & 0 deletions Documentation/devicetree/bindings/input/nvidia,tegra20-kbc.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
* Tegra keyboard controller
The key controller has maximum 24 pins to make matrix keypad. Any pin
can be configured as row or column. The maximum column pin can be 8
and maximum row pins can be 16 for Tegra20/Tegra30.

Required properties:
- compatible: "nvidia,tegra20-kbc"
- reg: Register base address of KBC.
- interrupts: Interrupt number for the KBC.
- nvidia,kbc-row-pins: The KBC pins which are configured as row. This is an
array of pin numbers which is used as rows.
- nvidia,kbc-col-pins: The KBC pins which are configured as column. This is an
array of pin numbers which is used as column.
- linux,keymap: The keymap for keys as described in the binding document
devicetree/bindings/input/matrix-keymap.txt.

Optional properties, in addition to those specified by the shared
matrix-keyboard bindings:
Expand All @@ -19,5 +30,16 @@ Example:
keyboard: keyboard {
compatible = "nvidia,tegra20-kbc";
reg = <0x7000e200 0x100>;
interrupts = <0 85 0x04>;
nvidia,ghost-filter;
nvidia,debounce-delay-ms = <640>;
nvidia,kbc-row-pins = <0 1 2>; /* pin 0, 1, 2 as rows */
nvidia,kbc-col-pins = <11 12 13>; /* pin 11, 12, 13 as columns */
linux,keymap = <0x00000074
0x00010067
0x00020066
0x01010068
0x02000069
0x02010070
0x02020071>;
};
2 changes: 1 addition & 1 deletion drivers/input/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#

menu "Input device support"
depends on !S390 && !UML
depends on !UML

config INPUT
tristate "Generic input layer (needed for keyboard, mouse, ...)" if EXPERT
Expand Down
1 change: 1 addition & 0 deletions drivers/input/input-mt.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ static void copy_abs(struct input_dev *dev, unsigned int dst, unsigned int src)
{
if (dev->absinfo && test_bit(src, dev->absbit)) {
dev->absinfo[dst] = dev->absinfo[src];
dev->absinfo[dst].fuzz = 0;
dev->absbit[BIT_WORD(dst)] |= BIT_MASK(dst);
}
}
Expand Down
82 changes: 46 additions & 36 deletions drivers/input/joystick/walkera0701.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* the Free Software Foundation.
*/

/* #define WK0701_DEBUG */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#define RESERVE 20000
#define SYNC_PULSE 1306000
Expand Down Expand Up @@ -67,6 +67,7 @@ static inline void walkera0701_parse_frame(struct walkera_dev *w)
{
int i;
int val1, val2, val3, val4, val5, val6, val7, val8;
int magic, magic_bit;
int crc1, crc2;

for (crc1 = crc2 = i = 0; i < 10; i++) {
Expand Down Expand Up @@ -102,17 +103,12 @@ static inline void walkera0701_parse_frame(struct walkera_dev *w)
val8 = (w->buf[18] & 1) << 8 | (w->buf[19] << 4) | w->buf[20];
val8 *= (w->buf[18] & 2) - 1; /*sign */

#ifdef WK0701_DEBUG
{
int magic, magic_bit;
magic = (w->buf[21] << 4) | w->buf[22];
magic_bit = (w->buf[24] & 8) >> 3;
printk(KERN_DEBUG
"walkera0701: %4d %4d %4d %4d %4d %4d %4d %4d (magic %2x %d)\n",
val1, val2, val3, val4, val5, val6, val7, val8, magic,
magic_bit);
}
#endif
magic = (w->buf[21] << 4) | w->buf[22];
magic_bit = (w->buf[24] & 8) >> 3;
pr_debug("%4d %4d %4d %4d %4d %4d %4d %4d (magic %2x %d)\n",
val1, val2, val3, val4, val5, val6, val7, val8,
magic, magic_bit);

input_report_abs(w->input_dev, ABS_X, val2);
input_report_abs(w->input_dev, ABS_Y, val1);
input_report_abs(w->input_dev, ABS_Z, val6);
Expand Down Expand Up @@ -187,6 +183,9 @@ static int walkera0701_open(struct input_dev *dev)
{
struct walkera_dev *w = input_get_drvdata(dev);

if (parport_claim(w->pardevice))
return -EBUSY;

parport_enable_irq(w->parport);
return 0;
}
Expand All @@ -197,40 +196,51 @@ static void walkera0701_close(struct input_dev *dev)

parport_disable_irq(w->parport);
hrtimer_cancel(&w->timer);

parport_release(w->pardevice);
}

static int walkera0701_connect(struct walkera_dev *w, int parport)
{
int err = -ENODEV;
int error;

w->parport = parport_find_number(parport);
if (w->parport == NULL)
if (!w->parport) {
pr_err("parport %d does not exist\n", parport);
return -ENODEV;
}

if (w->parport->irq == -1) {
printk(KERN_ERR "walkera0701: parport without interrupt\n");
goto init_err;
pr_err("parport %d does not have interrupt assigned\n",
parport);
error = -EINVAL;
goto err_put_parport;
}

err = -EBUSY;
w->pardevice = parport_register_device(w->parport, "walkera0701",
NULL, NULL, walkera0701_irq_handler,
PARPORT_DEV_EXCL, w);
if (!w->pardevice)
goto init_err;

if (parport_negotiate(w->pardevice->port, IEEE1284_MODE_COMPAT))
goto init_err1;
if (!w->pardevice) {
pr_err("failed to register parport device\n");
error = -EIO;
goto err_put_parport;
}

if (parport_claim(w->pardevice))
goto init_err1;
if (parport_negotiate(w->pardevice->port, IEEE1284_MODE_COMPAT)) {
pr_err("failed to negotiate parport mode\n");
error = -EIO;
goto err_unregister_device;
}

hrtimer_init(&w->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
w->timer.function = timer_handler;

w->input_dev = input_allocate_device();
if (!w->input_dev)
goto init_err2;
if (!w->input_dev) {
pr_err("failed to allocate input device\n");
error = -ENOMEM;
goto err_unregister_device;
}

input_set_drvdata(w->input_dev, w);
w->input_dev->name = "Walkera WK-0701 TX";
Expand All @@ -241,6 +251,7 @@ static int walkera0701_connect(struct walkera_dev *w, int parport)
w->input_dev->id.vendor = 0x0001;
w->input_dev->id.product = 0x0001;
w->input_dev->id.version = 0x0100;
w->input_dev->dev.parent = w->parport->dev;
w->input_dev->open = walkera0701_open;
w->input_dev->close = walkera0701_close;

Expand All @@ -254,27 +265,26 @@ static int walkera0701_connect(struct walkera_dev *w, int parport)
input_set_abs_params(w->input_dev, ABS_RUDDER, -512, 512, 0, 0);
input_set_abs_params(w->input_dev, ABS_MISC, -512, 512, 0, 0);

err = input_register_device(w->input_dev);
if (err)
goto init_err3;
error = input_register_device(w->input_dev);
if (error) {
pr_err("failed to register input device\n");
goto err_free_input_dev;
}

return 0;

init_err3:
err_free_input_dev:
input_free_device(w->input_dev);
init_err2:
parport_release(w->pardevice);
init_err1:
err_unregister_device:
parport_unregister_device(w->pardevice);
init_err:
err_put_parport:
parport_put_port(w->parport);
return err;
return error;
}

static void walkera0701_disconnect(struct walkera_dev *w)
{
input_unregister_device(w->input_dev);
parport_release(w->pardevice);
parport_unregister_device(w->pardevice);
parport_put_port(w->parport);
}
Expand Down
16 changes: 13 additions & 3 deletions drivers/input/keyboard/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ config KEYBOARD_TCA6416

config KEYBOARD_TCA8418
tristate "TCA8418 Keypad Support"
depends on I2C
depends on I2C && GENERIC_HARDIRQS
select INPUT_MATRIXKMAP
help
This driver implements basic keypad functionality
Expand Down Expand Up @@ -303,7 +303,7 @@ config KEYBOARD_HP7XX

config KEYBOARD_LM8323
tristate "LM8323 keypad chip"
depends on I2C
depends on I2C && GENERIC_HARDIRQS
depends on LEDS_CLASS
help
If you say yes here you get support for the National Semiconductor
Expand Down Expand Up @@ -420,7 +420,7 @@ config KEYBOARD_NOMADIK

config KEYBOARD_TEGRA
tristate "NVIDIA Tegra internal matrix keyboard controller support"
depends on ARCH_TEGRA
depends on ARCH_TEGRA && OF
select INPUT_MATRIXKMAP
help
Say Y here if you want to use a matrix keyboard connected directly
Expand Down Expand Up @@ -479,6 +479,16 @@ config KEYBOARD_SAMSUNG
To compile this driver as a module, choose M here: the
module will be called samsung-keypad.

config KEYBOARD_GOLDFISH_EVENTS
depends on GOLDFISH
tristate "Generic Input Event device for Goldfish"
help
Say Y here to get an input event device for the Goldfish virtual
device emulator.

To compile this driver as a module, choose M here: the
module will be called goldfish-events.

config KEYBOARD_STOWAWAY
tristate "Stowaway keyboard"
select SERIO
Expand Down
1 change: 1 addition & 0 deletions drivers/input/keyboard/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ obj-$(CONFIG_KEYBOARD_ATKBD) += atkbd.o
obj-$(CONFIG_KEYBOARD_BFIN) += bf54x-keys.o
obj-$(CONFIG_KEYBOARD_DAVINCI) += davinci_keyscan.o
obj-$(CONFIG_KEYBOARD_EP93XX) += ep93xx_keypad.o
obj-$(CONFIG_KEYBOARD_GOLDFISH_EVENTS) += goldfish_events.o
obj-$(CONFIG_KEYBOARD_GPIO) += gpio_keys.o
obj-$(CONFIG_KEYBOARD_GPIO_POLLED) += gpio_keys_polled.o
obj-$(CONFIG_KEYBOARD_TCA6416) += tca6416-keypad.o
Expand Down
Loading

0 comments on commit c6699b5

Please sign in to comment.