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

Configure Feed

Select the types of activity you want to include in your feed.

Input: ads7846 - remove custom filter handling functions from pdata

The functions in the platform data struct to initialize, cleanup and
apply custom filters are not in use by any mainline board.

Remove support for them to pave the road for more cleanups to come.

The enum was moved as it has no users outside of the driver code
itself.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
Link: https://lore.kernel.org/r/20210907200726.2034962-3-daniel@zonque.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Daniel Mack and committed by
Dmitry Torokhov
937f5d5e de609b56

+8 -32
+8 -17
drivers/input/touchscreen/ads7846.c
··· 142 142 143 143 int (*filter)(void *data, int data_idx, int *val); 144 144 void *filter_data; 145 - void (*filter_cleanup)(void *data); 146 145 int (*get_pendown_state)(void); 147 146 int gpio_pendown; 148 147 149 148 void (*wait_for_sync)(void); 149 + }; 150 + 151 + enum ads7846_filter { 152 + ADS7846_FILTER_OK, 153 + ADS7846_FILTER_REPEAT, 154 + ADS7846_FILTER_IGNORE, 150 155 }; 151 156 152 157 /* leave chip selected when we're done, for quicker re-select? */ ··· 1282 1277 ts->x_plate_ohms = pdata->x_plate_ohms ? : 400; 1283 1278 ts->vref_mv = pdata->vref_mv; 1284 1279 1285 - if (pdata->filter != NULL) { 1286 - if (pdata->filter_init != NULL) { 1287 - err = pdata->filter_init(pdata, &ts->filter_data); 1288 - if (err < 0) 1289 - goto err_free_mem; 1290 - } 1291 - ts->filter = pdata->filter; 1292 - ts->filter_cleanup = pdata->filter_cleanup; 1293 - } else if (pdata->debounce_max) { 1280 + if (pdata->debounce_max) { 1294 1281 ts->debounce_max = pdata->debounce_max; 1295 1282 if (ts->debounce_max < 2) 1296 1283 ts->debounce_max = 2; ··· 1296 1299 1297 1300 err = ads7846_setup_pendown(spi, ts, pdata); 1298 1301 if (err) 1299 - goto err_cleanup_filter; 1302 + goto err_free_mem; 1300 1303 1301 1304 if (pdata->penirq_recheck_delay_usecs) 1302 1305 ts->penirq_recheck_delay_usecs = ··· 1422 1425 err_free_gpio: 1423 1426 if (!ts->get_pendown_state) 1424 1427 gpio_free(ts->gpio_pendown); 1425 - err_cleanup_filter: 1426 - if (ts->filter_cleanup) 1427 - ts->filter_cleanup(ts->filter_data); 1428 1428 err_free_mem: 1429 1429 input_free_device(input_dev); 1430 1430 kfree(packet); ··· 1451 1457 */ 1452 1458 gpio_free(ts->gpio_pendown); 1453 1459 } 1454 - 1455 - if (ts->filter_cleanup) 1456 - ts->filter_cleanup(ts->filter_data); 1457 1460 1458 1461 kfree(ts->packet); 1459 1462 kfree(ts);
-15
include/linux/spi/ads7846.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 2 /* linux/spi/ads7846.h */ 3 3 4 - /* Touchscreen characteristics vary between boards and models. The 5 - * platform_data for the device's "struct device" holds this information. 6 - * 7 - * It's OK if the min/max values are zero. 8 - */ 9 - enum ads7846_filter { 10 - ADS7846_FILTER_OK, 11 - ADS7846_FILTER_REPEAT, 12 - ADS7846_FILTER_IGNORE, 13 - }; 14 - 15 4 struct ads7846_platform_data { 16 5 u16 model; /* 7843, 7845, 7846, 7873. */ 17 6 u16 vref_delay_usecs; /* 0 for external vref; etc */ ··· 40 51 int gpio_pendown_debounce; /* platform specific debounce time for 41 52 * the gpio_pendown */ 42 53 int (*get_pendown_state)(void); 43 - int (*filter_init) (const struct ads7846_platform_data *pdata, 44 - void **filter_data); 45 - int (*filter) (void *filter_data, int data_idx, int *val); 46 - void (*filter_cleanup)(void *filter_data); 47 54 void (*wait_for_sync)(void); 48 55 bool wakeup; 49 56 unsigned long irq_flags;