Skip to content

Commit c4f4925

Browse files
Igor Grinbergdtor
authored andcommitted
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>
1 parent c91cb7a commit c4f4925

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

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)