Skip to content

Commit

Permalink
Merge branch 'next' into for-linus
Browse files Browse the repository at this point in the history
Prepare input updates for 3.19.
  • Loading branch information
dtor committed Dec 16, 2014
2 parents a1f9a40 + 1d6a013 commit f20c86c
Show file tree
Hide file tree
Showing 77 changed files with 4,949 additions and 922 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
Device tree bindings for Microchip CAP1106, 6 channel capacitive touch sensor
Device tree bindings for Microchip CAP11xx based capacitive touch sensors

The node for this driver must be a child of a I2C controller node, as the
The node for this device must be a child of a I2C controller node, as the
device communication via I2C only.

Required properties:

compatible: Must be "microchip,cap1106"
compatible: Must contain one of:
"microchip,cap1106"
"microchip,cap1126"
"microchip,cap1188"

reg: The I2C slave address of the device.
Only 0x28 is valid.

interrupts: Property describing the interrupt line the
device's ALERT#/CM_IRQ# pin is connected to.
Expand All @@ -26,6 +28,10 @@ Optional properties:
Valid values are 1, 2, 4, and 8.
By default, a gain of 1 is set.

microchip,irq-active-high: By default the interrupt pin is active low
open drain. This property allows using the active
high push-pull output.

linux,keycodes: Specifies an array of numeric keycode values to
be used for the channels. If this property is
omitted, KEY_A, KEY_B, etc are used as
Expand All @@ -43,11 +49,11 @@ i2c_controller {
autorepeat;
microchip,sensor-gain = <2>;

linux,keycodes = <103 /* KEY_UP */
106 /* KEY_RIGHT */
108 /* KEY_DOWN */
105 /* KEY_LEFT */
109 /* KEY_PAGEDOWN */
104>; /* KEY_PAGEUP */
linux,keycodes = <103>, /* KEY_UP */
<106>, /* KEY_RIGHT */
<108>, /* KEY_DOWN */
<105>, /* KEY_LEFT */
<109>, /* KEY_PAGEDOWN */
<104>; /* KEY_PAGEUP */
};
}
34 changes: 34 additions & 0 deletions Documentation/devicetree/bindings/input/elan_i2c.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Elantech I2C Touchpad

Required properties:
- compatible: must be "elan,ekth3000".
- reg: I2C address of the chip.
- interrupt-parent: a phandle for the interrupt controller (see interrupt
binding[0]).
- interrupts: interrupt to which the chip is connected (see interrupt
binding[0]).

Optional properties:
- wakeup-source: touchpad can be used as a wakeup source.
- pinctrl-names: should be "default" (see pinctrl binding [1]).
- pinctrl-0: a phandle pointing to the pin settings for the device (see
pinctrl binding [1]).
- vcc-supply: a phandle for the regulator supplying 3.3V power.

[0]: Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
[1]: Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt

Example:
&i2c1 {
/* ... */

touchpad@15 {
compatible = "elan,ekth3000";
reg = <0x15>;
interrupt-parent = <&gpio4>;
interrupts = <0x0 IRQ_TYPE_EDGE_FALLING>;
wakeup-source;
};

/* ... */
};
33 changes: 33 additions & 0 deletions Documentation/devicetree/bindings/input/elants_i2c.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Elantech I2C Touchscreen

Required properties:
- compatible: must be "elan,ekth3500".
- reg: I2C address of the chip.
- interrupt-parent: a phandle for the interrupt controller (see interrupt
binding[0]).
- interrupts: interrupt to which the chip is connected (see interrupt
binding[0]).

Optional properties:
- wakeup-source: touchscreen can be used as a wakeup source.
- pinctrl-names: should be "default" (see pinctrl binding [1]).
- pinctrl-0: a phandle pointing to the pin settings for the device (see
pinctrl binding [1]).

[0]: Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
[1]: Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt

Example:
&i2c1 {
/* ... */

touchscreen@10 {
compatible = "elan,ekth3500";
reg = <0x10>;
interrupt-parent = <&gpio4>;
interrupts = <0x0 IRQ_TYPE_EDGE_FALLING>;
wakeup-source;
};

/* ... */
};
10 changes: 9 additions & 1 deletion Documentation/devicetree/bindings/input/gpio-keys.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ Optional properties:
Each button (key) is represented as a sub-node of "gpio-keys":
Subnode properties:

- gpios: OF device-tree gpio specification.
- label: Descriptive name of the key.
- linux,code: Keycode to emit.

Required mutual exclusive subnode-properties:
- gpios: OF device-tree gpio specification.
- interrupts: the interrupt line for that input

Optional subnode-properties:
- linux,input-type: Specify event type this button/key generates.
If not specified defaults to <1> == EV_KEY.
Expand All @@ -33,4 +36,9 @@ Example nodes:
linux,code = <103>;
gpios = <&gpio1 0 1>;
};
button@22 {
label = "GPIO Key DOWN";
linux,code = <108>;
interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
};
...
1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/vendor-prefixes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ dlink D-Link Corporation
dmo Data Modul AG
ebv EBV Elektronik
edt Emerging Display Technologies
elan Elan Microelectronic Corp.
emmicro EM Microelectronic
epcos EPCOS AG
epfl Ecole Polytechnique Fédérale de Lausanne
Expand Down
6 changes: 6 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -4062,6 +4062,12 @@ L: [email protected]
S: Maintained
F: drivers/media/usb/go7007/

GOODIX TOUCHSCREEN
M: Bastien Nocera <[email protected]>
L: [email protected]
S: Maintained
F: drivers/input/touchscreen/goodix.c

GPIO SUBSYSTEM
M: Linus Walleij <[email protected]>
M: Alexandre Courbot <[email protected]>
Expand Down
4 changes: 2 additions & 2 deletions drivers/input/gameport/gameport.c
Original file line number Diff line number Diff line change
Expand Up @@ -527,14 +527,14 @@ EXPORT_SYMBOL(gameport_set_phys);
*/
static void gameport_init_port(struct gameport *gameport)
{
static atomic_t gameport_no = ATOMIC_INIT(0);
static atomic_t gameport_no = ATOMIC_INIT(-1);

__module_get(THIS_MODULE);

mutex_init(&gameport->drv_mutex);
device_initialize(&gameport->dev);
dev_set_name(&gameport->dev, "gameport%lu",
(unsigned long)atomic_inc_return(&gameport_no) - 1);
(unsigned long)atomic_inc_return(&gameport_no));
gameport->dev.bus = &gameport_bus;
gameport->dev.release = gameport_release_port;
if (gameport->parent)
Expand Down
4 changes: 2 additions & 2 deletions drivers/input/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -1775,7 +1775,7 @@ EXPORT_SYMBOL_GPL(input_class);
*/
struct input_dev *input_allocate_device(void)
{
static atomic_t input_no = ATOMIC_INIT(0);
static atomic_t input_no = ATOMIC_INIT(-1);
struct input_dev *dev;

dev = kzalloc(sizeof(struct input_dev), GFP_KERNEL);
Expand All @@ -1790,7 +1790,7 @@ struct input_dev *input_allocate_device(void)
INIT_LIST_HEAD(&dev->node);

dev_set_name(&dev->dev, "input%lu",
(unsigned long) atomic_inc_return(&input_no) - 1);
(unsigned long)atomic_inc_return(&input_no));

__module_get(THIS_MODULE);
}
Expand Down
8 changes: 4 additions & 4 deletions drivers/input/joystick/xpad.c
Original file line number Diff line number Diff line change
Expand Up @@ -886,8 +886,8 @@ static void xpad_led_set(struct led_classdev *led_cdev,

static int xpad_led_probe(struct usb_xpad *xpad)
{
static atomic_t led_seq = ATOMIC_INIT(0);
long led_no;
static atomic_t led_seq = ATOMIC_INIT(-1);
unsigned long led_no;
struct xpad_led *led;
struct led_classdev *led_cdev;
int error;
Expand All @@ -899,9 +899,9 @@ static int xpad_led_probe(struct usb_xpad *xpad)
if (!led)
return -ENOMEM;

led_no = (long)atomic_inc_return(&led_seq) - 1;
led_no = atomic_inc_return(&led_seq);

snprintf(led->name, sizeof(led->name), "xpad%ld", led_no);
snprintf(led->name, sizeof(led->name), "xpad%lu", led_no);
led->xpad = xpad;

led_cdev = &led->led_cdev;
Expand Down
8 changes: 4 additions & 4 deletions drivers/input/keyboard/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -665,14 +665,14 @@ config KEYBOARD_CROS_EC
To compile this driver as a module, choose M here: the
module will be called cros_ec_keyb.

config KEYBOARD_CAP1106
tristate "Microchip CAP1106 touch sensor"
config KEYBOARD_CAP11XX
tristate "Microchip CAP11XX based touch sensors"
depends on OF && I2C
select REGMAP_I2C
help
Say Y here to enable the CAP1106 touch sensor driver.
Say Y here to enable the CAP11XX touch sensor driver.

To compile this driver as a module, choose M here: the
module will be called cap1106.
module will be called cap11xx.

endif
2 changes: 1 addition & 1 deletion drivers/input/keyboard/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ obj-$(CONFIG_KEYBOARD_AMIGA) += amikbd.o
obj-$(CONFIG_KEYBOARD_ATARI) += atakbd.o
obj-$(CONFIG_KEYBOARD_ATKBD) += atkbd.o
obj-$(CONFIG_KEYBOARD_BFIN) += bf54x-keys.o
obj-$(CONFIG_KEYBOARD_CAP1106) += cap1106.o
obj-$(CONFIG_KEYBOARD_CAP11XX) += cap11xx.o
obj-$(CONFIG_KEYBOARD_CLPS711X) += clps711x-keypad.o
obj-$(CONFIG_KEYBOARD_CROS_EC) += cros_ec_keyb.o
obj-$(CONFIG_KEYBOARD_DAVINCI) += davinci_keyscan.o
Expand Down
47 changes: 30 additions & 17 deletions drivers/input/keyboard/amikbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ MODULE_AUTHOR("Vojtech Pavlik <[email protected]>");
MODULE_DESCRIPTION("Amiga keyboard driver");
MODULE_LICENSE("GPL");

#ifdef CONFIG_HW_CONSOLE
static unsigned char amikbd_keycode[0x78] __initdata = {
[0] = KEY_GRAVE,
[1] = KEY_1,
Expand Down Expand Up @@ -144,6 +145,32 @@ static unsigned char amikbd_keycode[0x78] __initdata = {
[103] = KEY_RIGHTMETA
};

static void __init amikbd_init_console_keymaps(void)
{
/* We can spare 512 bytes on stack for temp_map in init path. */
unsigned short temp_map[NR_KEYS];
int i, j;

for (i = 0; i < MAX_NR_KEYMAPS; i++) {
if (!key_maps[i])
continue;
memset(temp_map, 0, sizeof(temp_map));
for (j = 0; j < 0x78; j++) {
if (!amikbd_keycode[j])
continue;
temp_map[j] = key_maps[i][amikbd_keycode[j]];
}
for (j = 0; j < NR_KEYS; j++) {
if (!temp_map[j])
temp_map[j] = 0xf200;
}
memcpy(key_maps[i], temp_map, sizeof(temp_map));
}
}
#else /* !CONFIG_HW_CONSOLE */
static inline void amikbd_init_console_keymaps(void) {}
#endif /* !CONFIG_HW_CONSOLE */

static const char *amikbd_messages[8] = {
[0] = KERN_ALERT "amikbd: Ctrl-Amiga-Amiga reset warning!!\n",
[1] = KERN_WARNING "amikbd: keyboard lost sync\n",
Expand Down Expand Up @@ -186,7 +213,7 @@ static irqreturn_t amikbd_interrupt(int irq, void *data)
static int __init amikbd_probe(struct platform_device *pdev)
{
struct input_dev *dev;
int i, j, err;
int i, err;

dev = input_allocate_device();
if (!dev) {
Expand All @@ -207,22 +234,8 @@ static int __init amikbd_probe(struct platform_device *pdev)
for (i = 0; i < 0x78; i++)
set_bit(i, dev->keybit);

for (i = 0; i < MAX_NR_KEYMAPS; i++) {
static u_short temp_map[NR_KEYS] __initdata;
if (!key_maps[i])
continue;
memset(temp_map, 0, sizeof(temp_map));
for (j = 0; j < 0x78; j++) {
if (!amikbd_keycode[j])
continue;
temp_map[j] = key_maps[i][amikbd_keycode[j]];
}
for (j = 0; j < NR_KEYS; j++) {
if (!temp_map[j])
temp_map[j] = 0xf200;
}
memcpy(key_maps[i], temp_map, sizeof(temp_map));
}
amikbd_init_console_keymaps();

ciaa.cra &= ~0x41; /* serial data in, turn off TA */
err = request_irq(IRQ_AMIGA_CIAA_SP, amikbd_interrupt, 0, "amikbd",
dev);
Expand Down
6 changes: 4 additions & 2 deletions drivers/input/keyboard/atkbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,9 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,

keycode = atkbd->keycode[code];

if (keycode != ATKBD_KEY_NULL)
input_event(dev, EV_MSC, MSC_SCAN, code);
if (!(atkbd->release && test_bit(code, atkbd->force_release_mask)))
if (keycode != ATKBD_KEY_NULL)
input_event(dev, EV_MSC, MSC_SCAN, code);

switch (keycode) {
case ATKBD_KEY_NULL:
Expand Down Expand Up @@ -511,6 +512,7 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,
input_sync(dev);

if (value && test_bit(code, atkbd->force_release_mask)) {
input_event(dev, EV_MSC, MSC_SCAN, code);
input_report_key(dev, keycode, 0);
input_sync(dev);
}
Expand Down
Loading

0 comments on commit f20c86c

Please sign in to comment.