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: matrix_keypad - remove support for platform data

There are no more users of struct matrix_keypad_platform_data in the
kernel, remove support for it from the driver.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20240805014710.1961677-6-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

+3 -119
+3 -71
drivers/input/keyboard/matrix_keypad.c
··· 271 271 static DEFINE_SIMPLE_DEV_PM_OPS(matrix_keypad_pm_ops, 272 272 matrix_keypad_suspend, matrix_keypad_resume); 273 273 274 - static int matrix_keypad_init_pdata_gpio(struct platform_device *pdev, 275 - const struct matrix_keypad_platform_data *pdata, 276 - struct matrix_keypad *keypad) 277 - { 278 - int i, err; 279 - 280 - keypad->num_col_gpios = pdata->num_col_gpios; 281 - keypad->num_row_gpios = pdata->num_row_gpios; 282 - 283 - /* initialized strobe lines as outputs, activated */ 284 - for (i = 0; i < pdata->num_col_gpios; i++) { 285 - err = devm_gpio_request(&pdev->dev, 286 - pdata->col_gpios[i], "matrix_kbd_col"); 287 - if (err) { 288 - dev_err(&pdev->dev, 289 - "failed to request GPIO%d for COL%d\n", 290 - pdata->col_gpios[i], i); 291 - return err; 292 - } 293 - 294 - keypad->col_gpios[i] = gpio_to_desc(pdata->col_gpios[i]); 295 - 296 - if (pdata->active_low ^ gpiod_is_active_low(keypad->col_gpios[i])) 297 - gpiod_toggle_active_low(keypad->col_gpios[i]); 298 - 299 - gpiod_direction_output(keypad->col_gpios[i], 1); 300 - } 301 - 302 - for (i = 0; i < pdata->num_row_gpios; i++) { 303 - err = devm_gpio_request(&pdev->dev, 304 - pdata->row_gpios[i], "matrix_kbd_row"); 305 - if (err) { 306 - dev_err(&pdev->dev, 307 - "failed to request GPIO%d for ROW%d\n", 308 - pdata->row_gpios[i], i); 309 - return err; 310 - } 311 - 312 - keypad->row_gpios[i] = gpio_to_desc(pdata->row_gpios[i]); 313 - 314 - if (pdata->active_low ^ gpiod_is_active_low(keypad->row_gpios[i])) 315 - gpiod_toggle_active_low(keypad->row_gpios[i]); 316 - 317 - gpiod_direction_input(keypad->row_gpios[i]); 318 - } 319 - 320 - return 0; 321 - } 322 - 323 274 static int matrix_keypad_init_gpio(struct platform_device *pdev, 324 275 struct matrix_keypad *keypad) 325 276 { ··· 371 420 372 421 static int matrix_keypad_probe(struct platform_device *pdev) 373 422 { 374 - const struct matrix_keypad_platform_data *pdata = 375 - dev_get_platdata(&pdev->dev); 376 423 struct matrix_keypad *keypad; 377 424 struct input_dev *input_dev; 378 - bool autorepeat; 379 425 bool wakeup; 380 426 int err; 381 427 ··· 396 448 device_property_read_u32(&pdev->dev, "col-scan-delay-us", 397 449 &keypad->col_scan_delay_us); 398 450 399 - if (pdata) { 400 - keypad->col_scan_delay_us = pdata->col_scan_delay_us; 401 - keypad->debounce_ms = pdata->debounce_ms; 402 - keypad->drive_inactive_cols = pdata->drive_inactive_cols; 403 - } 404 - 405 - if (pdata) 406 - err = matrix_keypad_init_pdata_gpio(pdev, pdata, keypad); 407 - else 408 - err = matrix_keypad_init_gpio(pdev, keypad); 451 + err = matrix_keypad_init_gpio(pdev, keypad); 409 452 if (err) 410 453 return err; 411 454 ··· 411 472 input_dev->open = matrix_keypad_start; 412 473 input_dev->close = matrix_keypad_stop; 413 474 414 - err = matrix_keypad_build_keymap(pdata ? pdata->keymap_data : NULL, 415 - NULL, 475 + err = matrix_keypad_build_keymap(NULL, NULL, 416 476 keypad->num_row_gpios, 417 477 keypad->num_col_gpios, 418 478 NULL, input_dev); ··· 420 482 return -ENOMEM; 421 483 } 422 484 423 - autorepeat = !device_property_read_bool(&pdev->dev, 424 - "linux,no-autorepeat"); 425 - if (autorepeat && pdata->no_autorepeat) 426 - autorepeat = false; 427 - if (autorepeat) 485 + if (!device_property_read_bool(&pdev->dev, "linux,no-autorepeat")) 428 486 __set_bit(EV_REP, input_dev->evbit); 429 487 430 488 input_set_capability(input_dev, EV_MSC, MSC_SCAN); ··· 433 499 wakeup = device_property_read_bool(&pdev->dev, "wakeup-source") || 434 500 /* legacy */ 435 501 device_property_read_bool(&pdev->dev, "linux,wakeup"); 436 - if (!wakeup && pdata) 437 - wakeup = pdata->wakeup; 438 502 device_init_wakeup(&pdev->dev, wakeup); 439 503 440 504 platform_set_drvdata(pdev, keypad);
-48
include/linux/input/matrix_keypad.h
··· 34 34 unsigned int keymap_size; 35 35 }; 36 36 37 - /** 38 - * struct matrix_keypad_platform_data - platform-dependent keypad data 39 - * @keymap_data: pointer to &matrix_keymap_data 40 - * @row_gpios: pointer to array of gpio numbers representing rows 41 - * @col_gpios: pointer to array of gpio numbers reporesenting colums 42 - * @num_row_gpios: actual number of row gpios used by device 43 - * @num_col_gpios: actual number of col gpios used by device 44 - * @col_scan_delay_us: delay, measured in microseconds, that is 45 - * needed before we can keypad after activating column gpio 46 - * @debounce_ms: debounce interval in milliseconds 47 - * @clustered_irq: may be specified if interrupts of all row/column GPIOs 48 - * are bundled to one single irq 49 - * @clustered_irq_flags: flags that are needed for the clustered irq 50 - * @active_low: gpio polarity 51 - * @wakeup: controls whether the device should be set up as wakeup 52 - * source 53 - * @no_autorepeat: disable key autorepeat 54 - * @drive_inactive_cols: drive inactive columns during scan, rather than 55 - * making them inputs. 56 - * 57 - * This structure represents platform-specific data that use used by 58 - * matrix_keypad driver to perform proper initialization. 59 - */ 60 - struct matrix_keypad_platform_data { 61 - const struct matrix_keymap_data *keymap_data; 62 - 63 - const unsigned int *row_gpios; 64 - const unsigned int *col_gpios; 65 - 66 - unsigned int num_row_gpios; 67 - unsigned int num_col_gpios; 68 - 69 - unsigned int col_scan_delay_us; 70 - 71 - /* key debounce interval in milli-second */ 72 - unsigned int debounce_ms; 73 - 74 - unsigned int clustered_irq; 75 - unsigned int clustered_irq_flags; 76 - 77 - bool active_low; 78 - bool wakeup; 79 - bool no_autorepeat; 80 - bool drive_inactive_cols; 81 - }; 82 - 83 37 int matrix_keypad_build_keymap(const struct matrix_keymap_data *keymap_data, 84 38 const char *keymap_name, 85 39 unsigned int rows, unsigned int cols, ··· 41 87 struct input_dev *input_dev); 42 88 int matrix_keypad_parse_properties(struct device *dev, 43 89 unsigned int *rows, unsigned int *cols); 44 - 45 - #define matrix_keypad_parse_of_params matrix_keypad_parse_properties 46 90 47 91 #endif /* _MATRIX_KEYPAD_H */