Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: ads7846 - enable pendown GPIO debounce time setting

Some platforms need the pendown GPIO debounce time setting programmed.
Since the pendown GPIO is handled by the driver, the debounce time
should also be handled along with the pendown GPIO request.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Igor Grinberg and committed by
Dmitry Torokhov
c4f49254 c91cb7a7

+8 -3
+5 -1
drivers/input/touchscreen/ads7846.c
··· 955 955 956 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 961 struct ads7846_platform_data *pdata = spi->dev.platform_data; 961 962 int err; ··· 982 981 983 982 ts->gpio_pendown = pdata->gpio_pendown; 984 983 984 + if (pdata->gpio_pendown_debounce) 985 + gpio_set_debounce(pdata->gpio_pendown, 986 + pdata->gpio_pendown_debounce); 985 987 } else { 986 988 dev_err(&spi->dev, "no get_pendown_state nor gpio_pendown?\n"); 987 989 return -EINVAL;
+3 -2
include/linux/spi/ads7846.h
··· 46 46 u16 debounce_rep; /* additional consecutive good readings 47 47 * required after the first two */ 48 48 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 */ 51 52 int (*get_pendown_state)(void); 52 53 int (*filter_init) (const struct ads7846_platform_data *pdata, 53 54 void **filter_data);