diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-11-23 02:45:34 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-11-23 02:45:34 -0500 |
commit | 26d29d06ea020411559f75ec908db235ca1838d9 (patch) | |
tree | 3839843cd997b63c656c76118ac78db0ec41c5df | |
parent | 5a903166dd31a42e39283b075cc6b9a9c079d1af (diff) | |
parent | 0a0d62857366d8a6531e7fed1c3ccdd9a2b5b40b (diff) |
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()
-rw-r--r-- | arch/arm/mach-omap2/common-board-devices.c | 34 | ||||
-rw-r--r-- | drivers/input/input-mt.c | 4 | ||||
-rw-r--r-- | drivers/input/mousedev.c | 4 | ||||
-rw-r--r-- | drivers/input/touchscreen/ads7846.c | 6 | ||||
-rw-r--r-- | include/linux/spi/ads7846.h | 5 |
5 files changed, 34 insertions, 19 deletions
diff --git a/arch/arm/mach-omap2/common-board-devices.c b/arch/arm/mach-omap2/common-board-devices.c index 48daac2581b4..84551f205e46 100644 --- a/arch/arm/mach-omap2/common-board-devices.c +++ b/arch/arm/mach-omap2/common-board-devices.c | |||
@@ -64,30 +64,36 @@ void __init omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce, | |||
64 | struct spi_board_info *spi_bi = &ads7846_spi_board_info; | 64 | struct spi_board_info *spi_bi = &ads7846_spi_board_info; |
65 | int err; | 65 | int err; |
66 | 66 | ||
67 | err = gpio_request_one(gpio_pendown, GPIOF_IN, "TSPenDown"); | 67 | /* |
68 | if (err) { | 68 | * If a board defines get_pendown_state() function, request the pendown |
69 | pr_err("Couldn't obtain gpio for TSPenDown: %d\n", err); | 69 | * GPIO and set the GPIO debounce time. |
70 | return; | 70 | * If a board does not define the get_pendown_state() function, then |
71 | } | 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 | } | ||
72 | 79 | ||
73 | if (gpio_debounce) | 80 | if (gpio_debounce) |
74 | gpio_set_debounce(gpio_pendown, gpio_debounce); | 81 | gpio_set_debounce(gpio_pendown, gpio_debounce); |
82 | |||
83 | gpio_export(gpio_pendown, 0); | ||
84 | } | ||
75 | 85 | ||
76 | spi_bi->bus_num = bus_num; | 86 | spi_bi->bus_num = bus_num; |
77 | spi_bi->irq = gpio_to_irq(gpio_pendown); | 87 | spi_bi->irq = gpio_to_irq(gpio_pendown); |
78 | 88 | ||
89 | ads7846_config.gpio_pendown = gpio_pendown; | ||
90 | |||
79 | if (board_pdata) { | 91 | if (board_pdata) { |
80 | board_pdata->gpio_pendown = gpio_pendown; | 92 | board_pdata->gpio_pendown = gpio_pendown; |
93 | board_pdata->gpio_pendown_debounce = gpio_debounce; | ||
81 | spi_bi->platform_data = board_pdata; | 94 | 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; | ||
86 | } | 95 | } |
87 | 96 | ||
88 | if (!board_pdata || (board_pdata && !board_pdata->get_pendown_state)) | ||
89 | gpio_free(gpio_pendown); | ||
90 | |||
91 | spi_register_board_info(&ads7846_spi_board_info, 1); | 97 | spi_register_board_info(&ads7846_spi_board_info, 1); |
92 | } | 98 | } |
93 | #else | 99 | #else |
diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c index c0ec7d42c3be..1abbc170d8b7 100644 --- a/drivers/input/input-mt.c +++ b/drivers/input/input-mt.c | |||
@@ -26,10 +26,14 @@ static void copy_abs(struct input_dev *dev, unsigned int dst, unsigned int src) | |||
26 | * input_mt_init_slots() - initialize MT input slots | 26 | * input_mt_init_slots() - initialize MT input slots |
27 | * @dev: input device supporting MT events and finger tracking | 27 | * @dev: input device supporting MT events and finger tracking |
28 | * @num_slots: number of slots used by the device | 28 | * @num_slots: number of slots used by the device |
29 | * @flags: mt tasks to handle in core | ||
29 | * | 30 | * |
30 | * This function allocates all necessary memory for MT slot handling | 31 | * This function allocates all necessary memory for MT slot handling |
31 | * in the input device, prepares the ABS_MT_SLOT and | 32 | * in the input device, prepares the ABS_MT_SLOT and |
32 | * ABS_MT_TRACKING_ID events for use and sets up appropriate buffers. | 33 | * 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 | * | ||
33 | * May be called repeatedly. Returns -EINVAL if attempting to | 37 | * May be called repeatedly. Returns -EINVAL if attempting to |
34 | * reinitialize with a different number of slots. | 38 | * reinitialize with a different number of slots. |
35 | */ | 39 | */ |
diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c index 8f02e3d0e712..4c842c320c2e 100644 --- a/drivers/input/mousedev.c +++ b/drivers/input/mousedev.c | |||
@@ -12,8 +12,8 @@ | |||
12 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | 12 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
13 | 13 | ||
14 | #define MOUSEDEV_MINOR_BASE 32 | 14 | #define MOUSEDEV_MINOR_BASE 32 |
15 | #define MOUSEDEV_MINORS 32 | 15 | #define MOUSEDEV_MINORS 31 |
16 | #define MOUSEDEV_MIX 31 | 16 | #define MOUSEDEV_MIX 63 |
17 | 17 | ||
18 | #include <linux/sched.h> | 18 | #include <linux/sched.h> |
19 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index f02028ec3db6..78e5d9ab0ba7 100644 --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c | |||
@@ -955,7 +955,8 @@ static int ads7846_resume(struct device *dev) | |||
955 | 955 | ||
956 | static SIMPLE_DEV_PM_OPS(ads7846_pm, ads7846_suspend, ads7846_resume); | 956 | static SIMPLE_DEV_PM_OPS(ads7846_pm, ads7846_suspend, ads7846_resume); |
957 | 957 | ||
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) | ||
959 | { | 960 | { |
960 | struct ads7846_platform_data *pdata = spi->dev.platform_data; | 961 | struct ads7846_platform_data *pdata = spi->dev.platform_data; |
961 | int err; | 962 | int err; |
@@ -981,6 +982,9 @@ static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads784 | |||
981 | 982 | ||
982 | ts->gpio_pendown = pdata->gpio_pendown; | 983 | ts->gpio_pendown = pdata->gpio_pendown; |
983 | 984 | ||
985 | if (pdata->gpio_pendown_debounce) | ||
986 | gpio_set_debounce(pdata->gpio_pendown, | ||
987 | pdata->gpio_pendown_debounce); | ||
984 | } else { | 988 | } else { |
985 | dev_err(&spi->dev, "no get_pendown_state nor gpio_pendown?\n"); | 989 | dev_err(&spi->dev, "no get_pendown_state nor gpio_pendown?\n"); |
986 | return -EINVAL; | 990 | return -EINVAL; |
diff --git a/include/linux/spi/ads7846.h b/include/linux/spi/ads7846.h index c64de9dd7631..2f694f3846a9 100644 --- a/include/linux/spi/ads7846.h +++ b/include/linux/spi/ads7846.h | |||
@@ -46,8 +46,9 @@ struct ads7846_platform_data { | |||
46 | u16 debounce_rep; /* additional consecutive good readings | 46 | u16 debounce_rep; /* additional consecutive good readings |
47 | * required after the first two */ | 47 | * required after the first two */ |
48 | int gpio_pendown; /* the GPIO used to decide the pendown | 48 | int gpio_pendown; /* the GPIO used to decide the pendown |
49 | * state if get_pendown_state == NULL | 49 | * state if get_pendown_state == NULL */ |
50 | */ | 50 | int gpio_pendown_debounce; /* platform specific debounce time for |
51 | * the gpio_pendown */ | ||
51 | int (*get_pendown_state)(void); | 52 | int (*get_pendown_state)(void); |
52 | int (*filter_init) (const struct ads7846_platform_data *pdata, | 53 | int (*filter_init) (const struct ads7846_platform_data *pdata, |
53 | void **filter_data); | 54 | void **filter_data); |