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:

 - three new touchscreen drivers: EETI EXC3000, HiDeep, and Samsung
   S6SY761

 - the timer API conversion (setup_timer() -> timer_setup())

 - a few drivers swiytched to using managed API for creating custom
   device attributes

 - other assorted fixed and cleanups.

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (50 commits)
  Input: gamecon - mark expected switch fall-throughs
  Input: sidewinder - mark expected switch fall-throughs
  Input: spaceball - mark expected switch fall-throughs
  Input: uinput - unlock on allocation failure in ioctl
  Input: add support for the Samsung S6SY761 touchscreen
  Input: add support for HiDeep touchscreen
  Input: st1232 - remove obsolete platform device support
  Input: convert autorepeat timer to use timer_setup()
  media: ttpci: remove autorepeat handling and use timer_setup
  Input: cyttsp4 - avoid overflows when calculating memory sizes
  Input: mxs-lradc - remove redundant assignment to pointer input
  Input: add I2C attached EETI EXC3000 multi touch driver
  Input: goodix - support gt1151 touchpanel
  Input: ps2-gpio - actually abort probe when connected to sleeping GPIOs
  Input: hil_mlc - convert to using timer_setup()
  Input: hp_sdc - convert to using timer_setup()
  Input: touchsceen - convert timers to use timer_setup()
  Input: keyboard - convert timers to use timer_setup()
  Input: uinput - fold header into the driver proper
  Input: uinput - remove uinput_allocate_device()
  ...
  • Loading branch information
torvalds committed Nov 15, 2017
2 parents 4e4510f + c251410 commit 9f7a9b1
Show file tree
Hide file tree
Showing 55 changed files with 2,776 additions and 731 deletions.
32 changes: 32 additions & 0 deletions Documentation/devicetree/bindings/input/gpio-mouse.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Device-Tree bindings for GPIO attached mice

This simply uses standard GPIO handles to define a simple mouse connected
to 5-7 GPIO lines.

Required properties:
- compatible: must be "gpio-mouse"
- scan-interval-ms: The scanning interval in milliseconds
- up-gpios: GPIO line phandle to the line indicating "up"
- down-gpios: GPIO line phandle to the line indicating "down"
- left-gpios: GPIO line phandle to the line indicating "left"
- right-gpios: GPIO line phandle to the line indicating "right"

Optional properties:
- button-left-gpios: GPIO line handle to the left mouse button
- button-middle-gpios: GPIO line handle to the middle mouse button
- button-right-gpios: GPIO line handle to the right mouse button
Example:

#include <dt-bindings/gpio/gpio.h>

gpio-mouse {
compatible = "gpio-mouse";
scan-interval-ms = <50>;
up-gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
down-gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
left-gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
right-gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
button-left-gpios = <&gpio0 4 GPIO_ACTIVE_LOW>;
button-middle-gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
button-right-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
};
27 changes: 27 additions & 0 deletions Documentation/devicetree/bindings/input/touchscreen/exc3000.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
* EETI EXC3000 Multiple Touch Controller

Required properties:
- compatible: must be "eeti,exc3000"
- reg: i2c slave address
- interrupt-parent: the phandle for the interrupt controller
- interrupts: touch controller interrupt
- touchscreen-size-x: See touchscreen.txt
- touchscreen-size-y: See touchscreen.txt

Optional properties:
- touchscreen-inverted-x: See touchscreen.txt
- touchscreen-inverted-y: See touchscreen.txt
- touchscreen-swapped-x-y: See touchscreen.txt

Example:

touchscreen@2a {
compatible = "eeti,exc3000";
reg = <0x2a>;
interrupt-parent = <&gpio1>;
interrupts = <9 IRQ_TYPE_LEVEL_LOW>;
touchscreen-size-x = <4096>;
touchscreen-size-y = <4096>;
touchscreen-inverted-x;
touchscreen-swapped-x-y;
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ Device tree bindings for Goodix GT9xx series touchscreen controller

Required properties:

- compatible : Should be "goodix,gt911"
- compatible : Should be "goodix,gt1151"
or "goodix,gt911"
or "goodix,gt9110"
or "goodix,gt912"
or "goodix,gt927"
Expand Down
42 changes: 42 additions & 0 deletions Documentation/devicetree/bindings/input/touchscreen/hideep.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
* HiDeep Finger and Stylus touchscreen controller

Required properties:
- compatible : must be "hideep,hideep-ts"
- reg : I2C slave address, (e.g. 0x6C).
- interrupt-parent : Interrupt controller to which the chip is connected.
- interrupts : Interrupt to which the chip is connected.

Optional properties:
- vdd-supply : It is the controller supply for controlling
main voltage(3.3V) through the regulator.
- vid-supply : It is the controller supply for controlling
IO voltage(1.8V) through the regulator.
- reset-gpios : Define for reset gpio pin.
It is to use for reset IC.
- touchscreen-size-x : X axis size of touchscreen
- touchscreen-size-y : Y axis size of touchscreen
- linux,keycodes : Specifies an array of numeric keycode values to
be used for reporting button presses. The array can
contain up to 3 entries.

Example:

#include "dt-bindings/input/input.h"

i2c@00000000 {

/* ... */

touchscreen@6c {
compatible = "hideep,hideep-ts";
reg = <0x6c>;
interrupt-parent = <&gpx1>;
interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
vdd-supply = <&ldo15_reg>";
vid-supply = <&ldo18_reg>;
reset-gpios = <&gpx1 5 0>;
touchscreen-size-x = <1080>;
touchscreen-size-y = <1920>;
linux,keycodes = <KEY_HOME>, <KEY_MENU>, <KEY_BACK>;
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
* Samsung S6SY761 touchscreen controller

Required properties:
- compatible : must be "samsung,s6sy761"
- reg : I2C slave address, (e.g. 0x48)
- interrupt-parent : the phandle to the interrupt controller which provides
the interrupt
- interrupts : interrupt specification
- avdd-supply : analogic power supply
- vdd-supply : power supply

Optional properties:
- touchscreen-size-x : see touchscreen.txt. This property is embedded in the
device. If defined it forces a different x resolution.
- touchscreen-size-y : see touchscreen.txt. This property is embedded in the
device. If defined it forces a different y resolution.

Example:

i2c@00000000 {

/* ... */

touchscreen@48 {
compatible = "samsung,s6sy761";
reg = <0x48>;
interrupt-parent = <&gpa1>;
interrupts = <1 IRQ_TYPE_NONE>;
avdd-supply = <&ldo30_reg>;
vdd-supply = <&ldo31_reg>;
touchscreen-size-x = <4096>;
touchscreen-size-y = <4096>;
};
};
1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/vendor-prefixes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ gw Gateworks Corporation
hannstar HannStar Display Corporation
haoyu Haoyu Microelectronic Co. Ltd.
hardkernel Hardkernel Co., Ltd
hideep HiDeep Inc.
himax Himax Technologies, Inc.
hisilicon Hisilicon Limited.
hit Hitachi Ltd.
Expand Down
8 changes: 4 additions & 4 deletions drivers/input/ff-memless.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,10 +412,10 @@ static void ml_play_effects(struct ml_device *ml)
ml_schedule_timer(ml);
}

static void ml_effect_timer(unsigned long timer_data)
static void ml_effect_timer(struct timer_list *t)
{
struct input_dev *dev = (struct input_dev *)timer_data;
struct ml_device *ml = dev->ff->private;
struct ml_device *ml = from_timer(ml, t, timer);
struct input_dev *dev = ml->dev;
unsigned long flags;

pr_debug("timer: updating effects\n");
Expand Down Expand Up @@ -526,7 +526,7 @@ int input_ff_create_memless(struct input_dev *dev, void *data,
ml->private = data;
ml->play_effect = play_effect;
ml->gain = 0xffff;
setup_timer(&ml->timer, ml_effect_timer, (unsigned long)dev);
timer_setup(&ml->timer, ml_effect_timer, 0);

set_bit(FF_GAIN, dev->ffbit);

Expand Down
11 changes: 5 additions & 6 deletions drivers/input/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static void input_start_autorepeat(struct input_dev *dev, int code)
{
if (test_bit(EV_REP, dev->evbit) &&
dev->rep[REP_PERIOD] && dev->rep[REP_DELAY] &&
dev->timer.data) {
dev->timer.function) {
dev->repeat_key = code;
mod_timer(&dev->timer,
jiffies + msecs_to_jiffies(dev->rep[REP_DELAY]));
Expand Down Expand Up @@ -179,9 +179,9 @@ static void input_pass_event(struct input_dev *dev,
* dev->event_lock here to avoid racing with input_event
* which may cause keys get "stuck".
*/
static void input_repeat_key(unsigned long data)
static void input_repeat_key(struct timer_list *t)
{
struct input_dev *dev = (void *) data;
struct input_dev *dev = from_timer(dev, t, timer);
unsigned long flags;

spin_lock_irqsave(&dev->event_lock, flags);
Expand Down Expand Up @@ -1784,7 +1784,7 @@ struct input_dev *input_allocate_device(void)
device_initialize(&dev->dev);
mutex_init(&dev->mutex);
spin_lock_init(&dev->event_lock);
init_timer(&dev->timer);
timer_setup(&dev->timer, NULL, 0);
INIT_LIST_HEAD(&dev->h_list);
INIT_LIST_HEAD(&dev->node);

Expand Down Expand Up @@ -2047,8 +2047,7 @@ static void devm_input_device_unregister(struct device *dev, void *res)
*/
void input_enable_softrepeat(struct input_dev *dev, int delay, int period)
{
dev->timer.data = (unsigned long) dev;
dev->timer.function = input_repeat_key;
dev->timer.function = (TIMER_FUNC_TYPE)input_repeat_key;
dev->rep[REP_DELAY] = delay;
dev->rep[REP_PERIOD] = period;
}
Expand Down
3 changes: 3 additions & 0 deletions drivers/input/joystick/gamecon.c
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,7 @@ static void gc_psx_report_one(struct gc_pad *pad, unsigned char psx_type,

input_report_key(dev, BTN_THUMBL, ~data[0] & 0x04);
input_report_key(dev, BTN_THUMBR, ~data[0] & 0x02);
/* fall through */

case GC_PSX_NEGCON:
case GC_PSX_ANALOG:
Expand Down Expand Up @@ -887,13 +888,15 @@ static int gc_setup_pad(struct gc *gc, int idx, int pad_type)
case GC_SNES:
for (i = 4; i < 8; i++)
__set_bit(gc_snes_btn[i], input_dev->keybit);
/* fall through */
case GC_NES:
for (i = 0; i < 4; i++)
__set_bit(gc_snes_btn[i], input_dev->keybit);
break;

case GC_MULTI2:
__set_bit(BTN_THUMB, input_dev->keybit);
/* fall through */
case GC_MULTI:
__set_bit(BTN_TRIGGER, input_dev->keybit);
break;
Expand Down
10 changes: 5 additions & 5 deletions drivers/input/joystick/sidewinder.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,16 +672,16 @@ static int sw_connect(struct gameport *gameport, struct gameport_driver *drv)

switch (i * m) {
case 60:
sw->number++;
sw->number++; /* fall through */
case 45: /* Ambiguous packet length */
if (j <= 40) { /* ID length less or eq 40 -> FSP */
case 43:
sw->type = SW_ID_FSP;
break;
}
sw->number++;
sw->number++; /* fall through */
case 30:
sw->number++;
sw->number++; /* fall through */
case 15:
sw->type = SW_ID_GP;
break;
Expand All @@ -697,9 +697,9 @@ static int sw_connect(struct gameport *gameport, struct gameport_driver *drv)
sw->type = SW_ID_PP;
break;
case 66:
sw->bits = 3;
sw->bits = 3; /* fall through */
case 198:
sw->length = 22;
sw->length = 22; /* fall through */
case 64:
sw->type = SW_ID_3DP;
if (j == 160)
Expand Down
4 changes: 4 additions & 0 deletions drivers/input/joystick/spaceball.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,15 @@ static irqreturn_t spaceball_interrupt(struct serio *serio,
break;
}
spaceball->escape = 0;
/* fall through */
case 'M':
case 'Q':
case 'S':
if (spaceball->escape) {
spaceball->escape = 0;
data &= 0x1f;
}
/* fall through */
default:
if (spaceball->escape)
spaceball->escape = 0;
Expand Down Expand Up @@ -234,11 +236,13 @@ static int spaceball_connect(struct serio *serio, struct serio_driver *drv)
input_dev->keybit[BIT_WORD(BTN_A)] |= BIT_MASK(BTN_A) |
BIT_MASK(BTN_B) | BIT_MASK(BTN_C) |
BIT_MASK(BTN_MODE);
/* fall through */
default:
input_dev->keybit[BIT_WORD(BTN_0)] |= BIT_MASK(BTN_2) |
BIT_MASK(BTN_3) | BIT_MASK(BTN_4) |
BIT_MASK(BTN_5) | BIT_MASK(BTN_6) |
BIT_MASK(BTN_7) | BIT_MASK(BTN_8);
/* fall through */
case SPACEBALL_3003C:
input_dev->keybit[BIT_WORD(BTN_0)] |= BIT_MASK(BTN_1) |
BIT_MASK(BTN_8);
Expand Down
7 changes: 3 additions & 4 deletions drivers/input/keyboard/bf54x-keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,9 @@ static inline void bfin_kpad_clear_irq(void)
bfin_write_KPAD_ROWCOL(0xFFFF);
}

static void bfin_kpad_timer(unsigned long data)
static void bfin_kpad_timer(struct timer_list *t)
{
struct platform_device *pdev = (struct platform_device *) data;
struct bf54x_kpad *bf54x_kpad = platform_get_drvdata(pdev);
struct bf54x_kpad *bf54x_kpad = from_timer(bf54x_kpad, t, timer);

if (bfin_kpad_get_keypressed(bf54x_kpad)) {
/* Try again later */
Expand Down Expand Up @@ -298,7 +297,7 @@ static int bfin_kpad_probe(struct platform_device *pdev)

/* Init Keypad Key Up/Release test timer */

setup_timer(&bf54x_kpad->timer, bfin_kpad_timer, (unsigned long) pdev);
timer_setup(&bf54x_kpad->timer, bfin_kpad_timer, 0);

bfin_write_KPAD_PRESCALE(bfin_kpad_get_prescale(TIME_SCALE));

Expand Down
7 changes: 3 additions & 4 deletions drivers/input/keyboard/gpio_keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,9 +419,9 @@ static irqreturn_t gpio_keys_gpio_isr(int irq, void *dev_id)
return IRQ_HANDLED;
}

static void gpio_keys_irq_timer(unsigned long _data)
static void gpio_keys_irq_timer(struct timer_list *t)
{
struct gpio_button_data *bdata = (struct gpio_button_data *)_data;
struct gpio_button_data *bdata = from_timer(bdata, t, release_timer);
struct input_dev *input = bdata->input;
unsigned long flags;

Expand Down Expand Up @@ -582,8 +582,7 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
}

bdata->release_delay = button->debounce_interval;
setup_timer(&bdata->release_timer,
gpio_keys_irq_timer, (unsigned long)bdata);
timer_setup(&bdata->release_timer, gpio_keys_irq_timer, 0);

isr = gpio_keys_irq_isr;
irqflags = 0;
Expand Down
8 changes: 4 additions & 4 deletions drivers/input/keyboard/imx_keypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ static void imx_keypad_fire_events(struct imx_keypad *keypad,
/*
* imx_keypad_check_for_events is the timer handler.
*/
static void imx_keypad_check_for_events(unsigned long data)
static void imx_keypad_check_for_events(struct timer_list *t)
{
struct imx_keypad *keypad = (struct imx_keypad *) data;
struct imx_keypad *keypad = from_timer(keypad, t, check_matrix_timer);
unsigned short matrix_volatile_state[MAX_MATRIX_KEY_COLS];
unsigned short reg_val;
bool state_changed, is_zero_matrix;
Expand Down Expand Up @@ -456,8 +456,8 @@ static int imx_keypad_probe(struct platform_device *pdev)
keypad->irq = irq;
keypad->stable_count = 0;

setup_timer(&keypad->check_matrix_timer,
imx_keypad_check_for_events, (unsigned long) keypad);
timer_setup(&keypad->check_matrix_timer,
imx_keypad_check_for_events, 0);

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
keypad->mmio_base = devm_ioremap_resource(&pdev->dev, res);
Expand Down
7 changes: 3 additions & 4 deletions drivers/input/keyboard/locomokbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,9 @@ static irqreturn_t locomokbd_interrupt(int irq, void *dev_id)
/*
* LoCoMo timer checking for released keys
*/
static void locomokbd_timer_callback(unsigned long data)
static void locomokbd_timer_callback(struct timer_list *t)
{
struct locomokbd *locomokbd = (struct locomokbd *) data;
struct locomokbd *locomokbd = from_timer(locomokbd, t, timer);

locomokbd_scankeyboard(locomokbd);
}
Expand Down Expand Up @@ -264,8 +264,7 @@ static int locomokbd_probe(struct locomo_dev *dev)

spin_lock_init(&locomokbd->lock);

setup_timer(&locomokbd->timer, locomokbd_timer_callback,
(unsigned long)locomokbd);
timer_setup(&locomokbd->timer, locomokbd_timer_callback, 0);

locomokbd->suspend_jiffies = jiffies;

Expand Down
Loading

0 comments on commit 9f7a9b1

Please sign in to comment.