···6464 struct spi_board_info *spi_bi = &ads7846_spi_board_info;6565 int err;66666767- err = gpio_request_one(gpio_pendown, GPIOF_IN, "TSPenDown");6868- if (err) {6969- pr_err("Couldn't obtain gpio for TSPenDown: %d\n", err);7070- return;7171- }6767+ /*6868+ * If a board defines get_pendown_state() function, request the pendown6969+ * GPIO and set the GPIO debounce time.7070+ * If a board does not define the get_pendown_state() function, then7171+ * the ads7846 driver will setup the pendown GPIO itself.7272+ */7373+ if (board_pdata && board_pdata->get_pendown_state) {7474+ err = gpio_request_one(gpio_pendown, GPIOF_IN, "TSPenDown");7575+ if (err) {7676+ pr_err("Couldn't obtain gpio for TSPenDown: %d\n", err);7777+ return;7878+ }72797373- if (gpio_debounce)7474- gpio_set_debounce(gpio_pendown, gpio_debounce);8080+ if (gpio_debounce)8181+ gpio_set_debounce(gpio_pendown, gpio_debounce);8282+8383+ gpio_export(gpio_pendown, 0);8484+ }75857686 spi_bi->bus_num = bus_num;7787 spi_bi->irq = gpio_to_irq(gpio_pendown);78888989+ ads7846_config.gpio_pendown = gpio_pendown;9090+7991 if (board_pdata) {8092 board_pdata->gpio_pendown = gpio_pendown;9393+ board_pdata->gpio_pendown_debounce = gpio_debounce;8194 spi_bi->platform_data = board_pdata;8282- if (board_pdata->get_pendown_state)8383- gpio_export(gpio_pendown, 0);8484- } else {8585- ads7846_config.gpio_pendown = gpio_pendown;8695 }8787-8888- if (!board_pdata || (board_pdata && !board_pdata->get_pendown_state))8989- gpio_free(gpio_pendown);90969197 spi_register_board_info(&ads7846_spi_board_info, 1);9298}
+4
drivers/input/input-mt.c
···2626 * input_mt_init_slots() - initialize MT input slots2727 * @dev: input device supporting MT events and finger tracking2828 * @num_slots: number of slots used by the device2929+ * @flags: mt tasks to handle in core2930 *3031 * This function allocates all necessary memory for MT slot handling3132 * in the input device, prepares the ABS_MT_SLOT and3233 * ABS_MT_TRACKING_ID events for use and sets up appropriate buffers.3434+ * Depending on the flags set, it also performs pointer emulation and3535+ * frame synchronization.3636+ *3337 * May be called repeatedly. Returns -EINVAL if attempting to3438 * reinitialize with a different number of slots.3539 */
···955955956956static SIMPLE_DEV_PM_OPS(ads7846_pm, ads7846_suspend, ads7846_resume);957957958958-static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads7846 *ts)958958+static int __devinit ads7846_setup_pendown(struct spi_device *spi,959959+ struct ads7846 *ts)959960{960961 struct ads7846_platform_data *pdata = spi->dev.platform_data;961962 int err;···982981983982 ts->gpio_pendown = pdata->gpio_pendown;984983984984+ if (pdata->gpio_pendown_debounce)985985+ gpio_set_debounce(pdata->gpio_pendown,986986+ pdata->gpio_pendown_debounce);985987 } else {986988 dev_err(&spi->dev, "no get_pendown_state nor gpio_pendown?\n");987989 return -EINVAL;
+3-2
include/linux/spi/ads7846.h
···4646 u16 debounce_rep; /* additional consecutive good readings4747 * required after the first two */4848 int gpio_pendown; /* the GPIO used to decide the pendown4949- * state if get_pendown_state == NULL5050- */4949+ * state if get_pendown_state == NULL */5050+ int gpio_pendown_debounce; /* platform specific debounce time for5151+ * the gpio_pendown */5152 int (*get_pendown_state)(void);5253 int (*filter_init) (const struct ads7846_platform_data *pdata,5354 void **filter_data);