Skip to content

Commit 26d29d0

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input updates from Dmitry Torokhov: "This fixes recent regression where /dev/input/mice got assigned wrong device node which messed up setups with static /dev, and a regression in ads7846 GPIO debounce setup." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: ARM - OMAP: ads7846: fix pendown debounce setting Input: ads7846 - enable pendown GPIO debounce time setting Input: mousedev - move /dev/input/mice to the correct minor Input: MT - document new 'flags' argument of input_mt_init_slots()
2 parents 5a90316 + 0a0d628 commit 26d29d0

File tree

5 files changed

+34
-19
lines changed

5 files changed

+34
-19
lines changed

arch/arm/mach-omap2/common-board-devices.c

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,30 +64,36 @@ void __init omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce,
6464
struct spi_board_info *spi_bi = &ads7846_spi_board_info;
6565
int err;
6666

67-
err = gpio_request_one(gpio_pendown, GPIOF_IN, "TSPenDown");
68-
if (err) {
69-
pr_err("Couldn't obtain gpio for TSPenDown: %d\n", err);
70-
return;
71-
}
67+
/*
68+
* If a board defines get_pendown_state() function, request the pendown
69+
* GPIO and set the GPIO debounce time.
70+
* If a board does not define the get_pendown_state() function, then
71+
* the ads7846 driver will setup the pendown GPIO itself.
72+
*/
73+
if (board_pdata && board_pdata->get_pendown_state) {
74+
err = gpio_request_one(gpio_pendown, GPIOF_IN, "TSPenDown");
75+
if (err) {
76+
pr_err("Couldn't obtain gpio for TSPenDown: %d\n", err);
77+
return;
78+
}
7279

73-
if (gpio_debounce)
74-
gpio_set_debounce(gpio_pendown, gpio_debounce);
80+
if (gpio_debounce)
81+
gpio_set_debounce(gpio_pendown, gpio_debounce);
82+
83+
gpio_export(gpio_pendown, 0);
84+
}
7585

7686
spi_bi->bus_num = bus_num;
7787
spi_bi->irq = gpio_to_irq(gpio_pendown);
7888

89+
ads7846_config.gpio_pendown = gpio_pendown;
90+
7991
if (board_pdata) {
8092
board_pdata->gpio_pendown = gpio_pendown;
93+
board_pdata->gpio_pendown_debounce = gpio_debounce;
8194
spi_bi->platform_data = board_pdata;
82-
if (board_pdata->get_pendown_state)
83-
gpio_export(gpio_pendown, 0);
84-
} else {
85-
ads7846_config.gpio_pendown = gpio_pendown;
8695
}
8796

88-
if (!board_pdata || (board_pdata && !board_pdata->get_pendown_state))
89-
gpio_free(gpio_pendown);
90-
9197
spi_register_board_info(&ads7846_spi_board_info, 1);
9298
}
9399
#else

drivers/input/input-mt.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,14 @@ static void copy_abs(struct input_dev *dev, unsigned int dst, unsigned int src)
2626
* input_mt_init_slots() - initialize MT input slots
2727
* @dev: input device supporting MT events and finger tracking
2828
* @num_slots: number of slots used by the device
29+
* @flags: mt tasks to handle in core
2930
*
3031
* This function allocates all necessary memory for MT slot handling
3132
* in the input device, prepares the ABS_MT_SLOT and
3233
* ABS_MT_TRACKING_ID events for use and sets up appropriate buffers.
34+
* Depending on the flags set, it also performs pointer emulation and
35+
* frame synchronization.
36+
*
3337
* May be called repeatedly. Returns -EINVAL if attempting to
3438
* reinitialize with a different number of slots.
3539
*/

drivers/input/mousedev.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
1313

1414
#define MOUSEDEV_MINOR_BASE 32
15-
#define MOUSEDEV_MINORS 32
16-
#define MOUSEDEV_MIX 31
15+
#define MOUSEDEV_MINORS 31
16+
#define MOUSEDEV_MIX 63
1717

1818
#include <linux/sched.h>
1919
#include <linux/slab.h>

drivers/input/touchscreen/ads7846.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,8 @@ static int ads7846_resume(struct device *dev)
955955

956956
static SIMPLE_DEV_PM_OPS(ads7846_pm, ads7846_suspend, ads7846_resume);
957957

958-
static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads7846 *ts)
958+
static int __devinit ads7846_setup_pendown(struct spi_device *spi,
959+
struct ads7846 *ts)
959960
{
960961
struct ads7846_platform_data *pdata = spi->dev.platform_data;
961962
int err;
@@ -981,6 +982,9 @@ static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads784
981982

982983
ts->gpio_pendown = pdata->gpio_pendown;
983984

985+
if (pdata->gpio_pendown_debounce)
986+
gpio_set_debounce(pdata->gpio_pendown,
987+
pdata->gpio_pendown_debounce);
984988
} else {
985989
dev_err(&spi->dev, "no get_pendown_state nor gpio_pendown?\n");
986990
return -EINVAL;

include/linux/spi/ads7846.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ struct ads7846_platform_data {
4646
u16 debounce_rep; /* additional consecutive good readings
4747
* required after the first two */
4848
int gpio_pendown; /* the GPIO used to decide the pendown
49-
* state if get_pendown_state == NULL
50-
*/
49+
* state if get_pendown_state == NULL */
50+
int gpio_pendown_debounce; /* platform specific debounce time for
51+
* the gpio_pendown */
5152
int (*get_pendown_state)(void);
5253
int (*filter_init) (const struct ads7846_platform_data *pdata,
5354
void **filter_data);

0 commit comments

Comments
 (0)