]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
Input: twl4030_keypad - drop support for platform data
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 14 Aug 2025 18:47:06 +0000 (11:47 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 17 Sep 2025 22:00:02 +0000 (15:00 -0700)
Support for platform data from dropped from twl in 4a346a03a63c ("mfd:
twl: Remove platform data support") and board files were dropped even
earlier. There are no in-kernel users of twl4030_keypad_data in the
kernel, and the driver supports configuration via generic device
properties.

Drop support of static platform data from the keypad driver.

Reviewed-by: Andreas Kemnade <andreas@kemnade.info>
Link: https://lore.kernel.org/r/tica7ol7xwv5tqb7hlkzu6wkiv4quxwrpqv6croe4wfnwvj6wv@4ob6ktqqi3cr
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/keyboard/twl4030_keypad.c

index 77e0743a3cf855152fa082dfe18c610a71c105a5..5e3d17c5dc9bdf74c818df2a53dd014485a408f4 100644 (file)
  * an internal state machine that decodes pressed keys, including
  * multi-key combinations.
  *
- * This driver lets boards define what keycodes they wish to report for
- * which scancodes, as part of the "struct twl4030_keypad_data" used in
- * the probe() routine.
- *
  * See the TPS65950 documentation; that's the general availability
  * version of the TWL5030 second generation part.
  */
@@ -47,7 +43,6 @@
 struct twl4030_keypad {
        unsigned short  keymap[TWL4030_KEYMAP_SIZE];
        u16             kp_state[TWL4030_MAX_ROWS];
-       bool            autorepeat;
        unsigned int    n_rows;
        unsigned int    n_cols;
        int             irq;
@@ -322,8 +317,6 @@ static int twl4030_kp_program(struct twl4030_keypad *kp)
  */
 static int twl4030_kp_probe(struct platform_device *pdev)
 {
-       struct twl4030_keypad_data *pdata = dev_get_platdata(&pdev->dev);
-       const struct matrix_keymap_data *keymap_data = NULL;
        struct twl4030_keypad *kp;
        struct input_dev *input;
        u8 reg;
@@ -350,24 +343,10 @@ static int twl4030_kp_probe(struct platform_device *pdev)
        input->id.product       = 0x0001;
        input->id.version       = 0x0003;
 
-       if (pdata) {
-               if (!pdata->rows || !pdata->cols || !pdata->keymap_data) {
-                       dev_err(&pdev->dev, "Missing platform_data\n");
-                       return -EINVAL;
-               }
-
-               kp->n_rows = pdata->rows;
-               kp->n_cols = pdata->cols;
-               kp->autorepeat = pdata->rep;
-               keymap_data = pdata->keymap_data;
-       } else {
-               error = matrix_keypad_parse_properties(&pdev->dev, &kp->n_rows,
-                                                      &kp->n_cols);
-               if (error)
-                       return error;
-
-               kp->autorepeat = true;
-       }
+       error = matrix_keypad_parse_properties(&pdev->dev,
+                                              &kp->n_rows, &kp->n_cols);
+       if (error)
+               return error;
 
        if (kp->n_rows > TWL4030_MAX_ROWS || kp->n_cols > TWL4030_MAX_COLS) {
                dev_err(&pdev->dev,
@@ -379,7 +358,7 @@ static int twl4030_kp_probe(struct platform_device *pdev)
        if (kp->irq < 0)
                return kp->irq;
 
-       error = matrix_keypad_build_keymap(keymap_data, NULL,
+       error = matrix_keypad_build_keymap(NULL, NULL,
                                           TWL4030_MAX_ROWS,
                                           1 << TWL4030_ROW_SHIFT,
                                           kp->keymap, input);
@@ -389,9 +368,7 @@ static int twl4030_kp_probe(struct platform_device *pdev)
        }
 
        input_set_capability(input, EV_MSC, MSC_SCAN);
-       /* Enable auto repeat feature of Linux input subsystem */
-       if (kp->autorepeat)
-               __set_bit(EV_REP, input->evbit);
+       __set_bit(EV_REP, input->evbit);
 
        error = input_register_device(input);
        if (error) {