diff options
| -rw-r--r-- | drivers/input/keyboard/Kconfig | 2 | ||||
| -rw-r--r-- | drivers/input/keyboard/omap4-keypad.c | 32 | ||||
| -rw-r--r-- | include/linux/platform_data/omap4-keypad.h | 13 |
3 files changed, 7 insertions, 40 deletions
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig index 948a30304870..0f84f2346fe4 100644 --- a/drivers/input/keyboard/Kconfig +++ b/drivers/input/keyboard/Kconfig | |||
| @@ -589,7 +589,7 @@ config KEYBOARD_OMAP | |||
| 589 | 589 | ||
| 590 | config KEYBOARD_OMAP4 | 590 | config KEYBOARD_OMAP4 |
| 591 | tristate "TI OMAP4+ keypad support" | 591 | tristate "TI OMAP4+ keypad support" |
| 592 | depends on ARCH_OMAP2PLUS | 592 | depends on OF || ARCH_OMAP2PLUS |
| 593 | select INPUT_MATRIXKMAP | 593 | select INPUT_MATRIXKMAP |
| 594 | help | 594 | help |
| 595 | Say Y here if you want to use the OMAP4+ keypad. | 595 | Say Y here if you want to use the OMAP4+ keypad. |
diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c index 0400b3f2b4b9..024b7bdffe5b 100644 --- a/drivers/input/keyboard/omap4-keypad.c +++ b/drivers/input/keyboard/omap4-keypad.c | |||
| @@ -28,11 +28,10 @@ | |||
| 28 | #include <linux/io.h> | 28 | #include <linux/io.h> |
| 29 | #include <linux/of.h> | 29 | #include <linux/of.h> |
| 30 | #include <linux/input.h> | 30 | #include <linux/input.h> |
| 31 | #include <linux/input/matrix_keypad.h> | ||
| 31 | #include <linux/slab.h> | 32 | #include <linux/slab.h> |
| 32 | #include <linux/pm_runtime.h> | 33 | #include <linux/pm_runtime.h> |
| 33 | 34 | ||
| 34 | #include <linux/platform_data/omap4-keypad.h> | ||
| 35 | |||
| 36 | /* OMAP4 registers */ | 35 | /* OMAP4 registers */ |
| 37 | #define OMAP4_KBD_REVISION 0x00 | 36 | #define OMAP4_KBD_REVISION 0x00 |
| 38 | #define OMAP4_KBD_SYSCONFIG 0x10 | 37 | #define OMAP4_KBD_SYSCONFIG 0x10 |
| @@ -218,7 +217,6 @@ static void omap4_keypad_close(struct input_dev *input) | |||
| 218 | pm_runtime_put_sync(input->dev.parent); | 217 | pm_runtime_put_sync(input->dev.parent); |
| 219 | } | 218 | } |
| 220 | 219 | ||
| 221 | #ifdef CONFIG_OF | ||
| 222 | static int omap4_keypad_parse_dt(struct device *dev, | 220 | static int omap4_keypad_parse_dt(struct device *dev, |
| 223 | struct omap4_keypad *keypad_data) | 221 | struct omap4_keypad *keypad_data) |
| 224 | { | 222 | { |
| @@ -235,20 +233,9 @@ static int omap4_keypad_parse_dt(struct device *dev, | |||
| 235 | 233 | ||
| 236 | return 0; | 234 | return 0; |
| 237 | } | 235 | } |
| 238 | #else | ||
| 239 | static inline int omap4_keypad_parse_dt(struct device *dev, | ||
| 240 | struct omap4_keypad *keypad_data) | ||
| 241 | { | ||
| 242 | return -ENOSYS; | ||
| 243 | } | ||
| 244 | #endif | ||
| 245 | 236 | ||
| 246 | static int omap4_keypad_probe(struct platform_device *pdev) | 237 | static int omap4_keypad_probe(struct platform_device *pdev) |
| 247 | { | 238 | { |
| 248 | const struct omap4_keypad_platform_data *pdata = | ||
| 249 | dev_get_platdata(&pdev->dev); | ||
| 250 | const struct matrix_keymap_data *keymap_data = | ||
| 251 | pdata ? pdata->keymap_data : NULL; | ||
| 252 | struct omap4_keypad *keypad_data; | 239 | struct omap4_keypad *keypad_data; |
| 253 | struct input_dev *input_dev; | 240 | struct input_dev *input_dev; |
| 254 | struct resource *res; | 241 | struct resource *res; |
| @@ -277,14 +264,9 @@ static int omap4_keypad_probe(struct platform_device *pdev) | |||
| 277 | 264 | ||
| 278 | keypad_data->irq = irq; | 265 | keypad_data->irq = irq; |
| 279 | 266 | ||
| 280 | if (pdata) { | 267 | error = omap4_keypad_parse_dt(&pdev->dev, keypad_data); |
| 281 | keypad_data->rows = pdata->rows; | 268 | if (error) |
| 282 | keypad_data->cols = pdata->cols; | 269 | return error; |
| 283 | } else { | ||
| 284 | error = omap4_keypad_parse_dt(&pdev->dev, keypad_data); | ||
| 285 | if (error) | ||
| 286 | return error; | ||
| 287 | } | ||
| 288 | 270 | ||
| 289 | res = request_mem_region(res->start, resource_size(res), pdev->name); | 271 | res = request_mem_region(res->start, resource_size(res), pdev->name); |
| 290 | if (!res) { | 272 | if (!res) { |
| @@ -363,7 +345,7 @@ static int omap4_keypad_probe(struct platform_device *pdev) | |||
| 363 | goto err_free_input; | 345 | goto err_free_input; |
| 364 | } | 346 | } |
| 365 | 347 | ||
| 366 | error = matrix_keypad_build_keymap(keymap_data, NULL, | 348 | error = matrix_keypad_build_keymap(NULL, NULL, |
| 367 | keypad_data->rows, keypad_data->cols, | 349 | keypad_data->rows, keypad_data->cols, |
| 368 | keypad_data->keymap, input_dev); | 350 | keypad_data->keymap, input_dev); |
| 369 | if (error) { | 351 | if (error) { |
| @@ -434,13 +416,11 @@ static int omap4_keypad_remove(struct platform_device *pdev) | |||
| 434 | return 0; | 416 | return 0; |
| 435 | } | 417 | } |
| 436 | 418 | ||
| 437 | #ifdef CONFIG_OF | ||
| 438 | static const struct of_device_id omap_keypad_dt_match[] = { | 419 | static const struct of_device_id omap_keypad_dt_match[] = { |
| 439 | { .compatible = "ti,omap4-keypad" }, | 420 | { .compatible = "ti,omap4-keypad" }, |
| 440 | {}, | 421 | {}, |
| 441 | }; | 422 | }; |
| 442 | MODULE_DEVICE_TABLE(of, omap_keypad_dt_match); | 423 | MODULE_DEVICE_TABLE(of, omap_keypad_dt_match); |
| 443 | #endif | ||
| 444 | 424 | ||
| 445 | #ifdef CONFIG_PM_SLEEP | 425 | #ifdef CONFIG_PM_SLEEP |
| 446 | static int omap4_keypad_suspend(struct device *dev) | 426 | static int omap4_keypad_suspend(struct device *dev) |
| @@ -482,7 +462,7 @@ static struct platform_driver omap4_keypad_driver = { | |||
| 482 | .name = "omap4-keypad", | 462 | .name = "omap4-keypad", |
| 483 | .owner = THIS_MODULE, | 463 | .owner = THIS_MODULE, |
| 484 | .pm = &omap4_keypad_pm_ops, | 464 | .pm = &omap4_keypad_pm_ops, |
| 485 | .of_match_table = of_match_ptr(omap_keypad_dt_match), | 465 | .of_match_table = omap_keypad_dt_match, |
| 486 | }, | 466 | }, |
| 487 | }; | 467 | }; |
| 488 | module_platform_driver(omap4_keypad_driver); | 468 | module_platform_driver(omap4_keypad_driver); |
diff --git a/include/linux/platform_data/omap4-keypad.h b/include/linux/platform_data/omap4-keypad.h deleted file mode 100644 index 4eef5fb05a17..000000000000 --- a/include/linux/platform_data/omap4-keypad.h +++ /dev/null | |||
| @@ -1,13 +0,0 @@ | |||
| 1 | #ifndef __LINUX_INPUT_OMAP4_KEYPAD_H | ||
| 2 | #define __LINUX_INPUT_OMAP4_KEYPAD_H | ||
| 3 | |||
| 4 | #include <linux/input/matrix_keypad.h> | ||
| 5 | |||
| 6 | struct omap4_keypad_platform_data { | ||
| 7 | const struct matrix_keymap_data *keymap_data; | ||
| 8 | |||
| 9 | u8 rows; | ||
| 10 | u8 cols; | ||
| 11 | }; | ||
| 12 | |||
| 13 | #endif /* __LINUX_INPUT_OMAP4_KEYPAD_H */ | ||
