diff options
| author | Linus Walleij <linus.walleij@linaro.org> | 2015-03-27 12:28:16 -0400 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2015-04-03 20:08:59 -0400 |
| commit | 8b6f53c2f6d3d04c077e74fdb07130242a2d6f58 (patch) | |
| tree | 4b5d66b3cf61d3b45f1f8bd6297717c12e418ebd /drivers | |
| parent | bbdb38a22e8a5197a6db1e4d22d7e5c6c368e7f7 (diff) | |
Input: tc3589x - localize platform data
This driver can only get its platform data from the device tree, and all
platforms using it do that. Localize the platform data for the keypad. A
later patch will enforce the device tree / OF dependence.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/input/keyboard/tc3589x-keypad.c | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/drivers/input/keyboard/tc3589x-keypad.c b/drivers/input/keyboard/tc3589x-keypad.c index 563932500ff1..ae90df3468e0 100644 --- a/drivers/input/keyboard/tc3589x-keypad.c +++ b/drivers/input/keyboard/tc3589x-keypad.c | |||
| @@ -70,6 +70,28 @@ | |||
| 70 | #define TC3589x_KBD_INT_CLR 0x1 | 70 | #define TC3589x_KBD_INT_CLR 0x1 |
| 71 | 71 | ||
| 72 | /** | 72 | /** |
| 73 | * struct tc35893_keypad_platform_data - platform specific keypad data | ||
| 74 | * @keymap_data: matrix scan code table for keycodes | ||
| 75 | * @krow: mask for available rows, value is 0xFF | ||
| 76 | * @kcol: mask for available columns, value is 0xFF | ||
| 77 | * @debounce_period: platform specific debounce time | ||
| 78 | * @settle_time: platform specific settle down time | ||
| 79 | * @irqtype: type of interrupt, falling or rising edge | ||
| 80 | * @enable_wakeup: specifies if keypad event can wake up system from sleep | ||
| 81 | * @no_autorepeat: flag for auto repetition | ||
| 82 | */ | ||
| 83 | struct tc3589x_keypad_platform_data { | ||
| 84 | const struct matrix_keymap_data *keymap_data; | ||
| 85 | u8 krow; | ||
| 86 | u8 kcol; | ||
| 87 | u8 debounce_period; | ||
| 88 | u8 settle_time; | ||
| 89 | unsigned long irqtype; | ||
| 90 | bool enable_wakeup; | ||
| 91 | bool no_autorepeat; | ||
| 92 | }; | ||
| 93 | |||
| 94 | /** | ||
| 73 | * struct tc_keypad - data structure used by keypad driver | 95 | * struct tc_keypad - data structure used by keypad driver |
| 74 | * @tc3589x: pointer to tc35893 | 96 | * @tc3589x: pointer to tc35893 |
| 75 | * @input: pointer to input device object | 97 | * @input: pointer to input device object |
| @@ -363,13 +385,10 @@ static int tc3589x_keypad_probe(struct platform_device *pdev) | |||
| 363 | const struct tc3589x_keypad_platform_data *plat; | 385 | const struct tc3589x_keypad_platform_data *plat; |
| 364 | int error, irq; | 386 | int error, irq; |
| 365 | 387 | ||
| 366 | plat = tc3589x->pdata->keypad; | 388 | plat = tc3589x_keypad_of_probe(&pdev->dev); |
| 367 | if (!plat) { | 389 | if (IS_ERR(plat)) { |
| 368 | plat = tc3589x_keypad_of_probe(&pdev->dev); | 390 | dev_err(&pdev->dev, "invalid keypad platform data\n"); |
| 369 | if (IS_ERR(plat)) { | 391 | return PTR_ERR(plat); |
| 370 | dev_err(&pdev->dev, "invalid keypad platform data\n"); | ||
| 371 | return PTR_ERR(plat); | ||
| 372 | } | ||
| 373 | } | 392 | } |
| 374 | 393 | ||
| 375 | irq = platform_get_irq(pdev, 0); | 394 | irq = platform_get_irq(pdev, 0); |
