Skip to content

Commit 11fafeb

Browse files
committed
Input: twl4030_keypad - drop support for platform data
Support for platform data from dropped from twl in 4a346a0 ("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>
1 parent 09fd862 commit 11fafeb

1 file changed

Lines changed: 6 additions & 29 deletions

File tree

drivers/input/keyboard/twl4030_keypad.c

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@
2828
* an internal state machine that decodes pressed keys, including
2929
* multi-key combinations.
3030
*
31-
* This driver lets boards define what keycodes they wish to report for
32-
* which scancodes, as part of the "struct twl4030_keypad_data" used in
33-
* the probe() routine.
34-
*
3531
* See the TPS65950 documentation; that's the general availability
3632
* version of the TWL5030 second generation part.
3733
*/
@@ -47,7 +43,6 @@
4743
struct twl4030_keypad {
4844
unsigned short keymap[TWL4030_KEYMAP_SIZE];
4945
u16 kp_state[TWL4030_MAX_ROWS];
50-
bool autorepeat;
5146
unsigned int n_rows;
5247
unsigned int n_cols;
5348
int irq;
@@ -322,8 +317,6 @@ static int twl4030_kp_program(struct twl4030_keypad *kp)
322317
*/
323318
static int twl4030_kp_probe(struct platform_device *pdev)
324319
{
325-
struct twl4030_keypad_data *pdata = dev_get_platdata(&pdev->dev);
326-
const struct matrix_keymap_data *keymap_data = NULL;
327320
struct twl4030_keypad *kp;
328321
struct input_dev *input;
329322
u8 reg;
@@ -350,24 +343,10 @@ static int twl4030_kp_probe(struct platform_device *pdev)
350343
input->id.product = 0x0001;
351344
input->id.version = 0x0003;
352345

353-
if (pdata) {
354-
if (!pdata->rows || !pdata->cols || !pdata->keymap_data) {
355-
dev_err(&pdev->dev, "Missing platform_data\n");
356-
return -EINVAL;
357-
}
358-
359-
kp->n_rows = pdata->rows;
360-
kp->n_cols = pdata->cols;
361-
kp->autorepeat = pdata->rep;
362-
keymap_data = pdata->keymap_data;
363-
} else {
364-
error = matrix_keypad_parse_properties(&pdev->dev, &kp->n_rows,
365-
&kp->n_cols);
366-
if (error)
367-
return error;
368-
369-
kp->autorepeat = true;
370-
}
346+
error = matrix_keypad_parse_properties(&pdev->dev,
347+
&kp->n_rows, &kp->n_cols);
348+
if (error)
349+
return error;
371350

372351
if (kp->n_rows > TWL4030_MAX_ROWS || kp->n_cols > TWL4030_MAX_COLS) {
373352
dev_err(&pdev->dev,
@@ -379,7 +358,7 @@ static int twl4030_kp_probe(struct platform_device *pdev)
379358
if (kp->irq < 0)
380359
return kp->irq;
381360

382-
error = matrix_keypad_build_keymap(keymap_data, NULL,
361+
error = matrix_keypad_build_keymap(NULL, NULL,
383362
TWL4030_MAX_ROWS,
384363
1 << TWL4030_ROW_SHIFT,
385364
kp->keymap, input);
@@ -389,9 +368,7 @@ static int twl4030_kp_probe(struct platform_device *pdev)
389368
}
390369

391370
input_set_capability(input, EV_MSC, MSC_SCAN);
392-
/* Enable auto repeat feature of Linux input subsystem */
393-
if (kp->autorepeat)
394-
__set_bit(EV_REP, input->evbit);
371+
__set_bit(EV_REP, input->evbit);
395372

396373
error = input_register_device(input);
397374
if (error) {

0 commit comments

Comments
 (0)