diff options
author | Michael Hennerich <michael.hennerich@analog.com> | 2008-01-27 03:49:48 -0500 |
---|---|---|
committer | Bryan Wu <bryan.wu@analog.com> | 2008-01-27 03:49:48 -0500 |
commit | 2463ef22bf8b6e22048bd26f940c014f7e1f0998 (patch) | |
tree | 1060c346b95a64f8aa0de77dc162903a960a5ac2 | |
parent | 6fce6a8d6940654b48d3d540627c7ee790a03b80 (diff) |
[Blackfin] arch: replace current blackfin specific pfbutton driver with kernel generic gpio key driver
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
-rw-r--r-- | arch/blackfin/mach-bf533/boards/ezkit.c | 28 | ||||
-rw-r--r-- | arch/blackfin/mach-bf533/boards/stamp.c | 27 | ||||
-rw-r--r-- | arch/blackfin/mach-bf537/boards/stamp.c | 28 | ||||
-rw-r--r-- | arch/blackfin/mach-bf548/boards/ezkit.c | 27 | ||||
-rw-r--r-- | arch/blackfin/mach-bf561/boards/ezkit.c | 30 |
5 files changed, 140 insertions, 0 deletions
diff --git a/arch/blackfin/mach-bf533/boards/ezkit.c b/arch/blackfin/mach-bf533/boards/ezkit.c index be852034a68b..ead5c12cbe90 100644 --- a/arch/blackfin/mach-bf533/boards/ezkit.c +++ b/arch/blackfin/mach-bf533/boards/ezkit.c | |||
@@ -256,6 +256,30 @@ static struct platform_device bfin_pata_device = { | |||
256 | }; | 256 | }; |
257 | #endif | 257 | #endif |
258 | 258 | ||
259 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | ||
260 | #include <linux/input.h> | ||
261 | #include <linux/gpio_keys.h> | ||
262 | |||
263 | static struct gpio_keys_button bfin_gpio_keys_table[] = { | ||
264 | {BTN_0, GPIO_PF7, 1, "gpio-keys: BTN0"}, | ||
265 | {BTN_1, GPIO_PF8, 1, "gpio-keys: BTN1"}, | ||
266 | {BTN_2, GPIO_PF9, 1, "gpio-keys: BTN2"}, | ||
267 | {BTN_3, GPIO_PF10, 1, "gpio-keys: BTN3"}, | ||
268 | }; | ||
269 | |||
270 | static struct gpio_keys_platform_data bfin_gpio_keys_data = { | ||
271 | .buttons = bfin_gpio_keys_table, | ||
272 | .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table), | ||
273 | }; | ||
274 | |||
275 | static struct platform_device bfin_device_gpiokeys = { | ||
276 | .name = "gpio-keys", | ||
277 | .dev = { | ||
278 | .platform_data = &bfin_gpio_keys_data, | ||
279 | }, | ||
280 | }; | ||
281 | #endif | ||
282 | |||
259 | static struct platform_device *ezkit_devices[] __initdata = { | 283 | static struct platform_device *ezkit_devices[] __initdata = { |
260 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) | 284 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
261 | &smc91x_device, | 285 | &smc91x_device, |
@@ -280,6 +304,10 @@ static struct platform_device *ezkit_devices[] __initdata = { | |||
280 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) | 304 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) |
281 | &bfin_pata_device, | 305 | &bfin_pata_device, |
282 | #endif | 306 | #endif |
307 | |||
308 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | ||
309 | &bfin_device_gpiokeys, | ||
310 | #endif | ||
283 | }; | 311 | }; |
284 | 312 | ||
285 | static int __init ezkit_init(void) | 313 | static int __init ezkit_init(void) |
diff --git a/arch/blackfin/mach-bf533/boards/stamp.c b/arch/blackfin/mach-bf533/boards/stamp.c index 8fde8d832850..689816937703 100644 --- a/arch/blackfin/mach-bf533/boards/stamp.c +++ b/arch/blackfin/mach-bf533/boards/stamp.c | |||
@@ -373,6 +373,29 @@ static struct platform_device bfin_pata_device = { | |||
373 | }; | 373 | }; |
374 | #endif | 374 | #endif |
375 | 375 | ||
376 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | ||
377 | #include <linux/input.h> | ||
378 | #include <linux/gpio_keys.h> | ||
379 | |||
380 | static struct gpio_keys_button bfin_gpio_keys_table[] = { | ||
381 | {BTN_0, GPIO_PF5, 1, "gpio-keys: BTN0"}, | ||
382 | {BTN_1, GPIO_PF6, 1, "gpio-keys: BTN1"}, | ||
383 | {BTN_2, GPIO_PF8, 1, "gpio-keys: BTN2"}, | ||
384 | }; | ||
385 | |||
386 | static struct gpio_keys_platform_data bfin_gpio_keys_data = { | ||
387 | .buttons = bfin_gpio_keys_table, | ||
388 | .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table), | ||
389 | }; | ||
390 | |||
391 | static struct platform_device bfin_device_gpiokeys = { | ||
392 | .name = "gpio-keys", | ||
393 | .dev = { | ||
394 | .platform_data = &bfin_gpio_keys_data, | ||
395 | }, | ||
396 | }; | ||
397 | #endif | ||
398 | |||
376 | static struct platform_device *stamp_devices[] __initdata = { | 399 | static struct platform_device *stamp_devices[] __initdata = { |
377 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) | 400 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) |
378 | &rtc_device, | 401 | &rtc_device, |
@@ -406,6 +429,10 @@ static struct platform_device *stamp_devices[] __initdata = { | |||
406 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) | 429 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) |
407 | &bfin_pata_device, | 430 | &bfin_pata_device, |
408 | #endif | 431 | #endif |
432 | |||
433 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | ||
434 | &bfin_device_gpiokeys, | ||
435 | #endif | ||
409 | }; | 436 | }; |
410 | 437 | ||
411 | static int __init stamp_init(void) | 438 | static int __init stamp_init(void) |
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c index 07b0dc273d2f..3e0ad04d8d75 100644 --- a/arch/blackfin/mach-bf537/boards/stamp.c +++ b/arch/blackfin/mach-bf537/boards/stamp.c | |||
@@ -103,6 +103,30 @@ void __exit bfin_isp1761_exit(void) | |||
103 | arch_initcall(bfin_isp1761_init); | 103 | arch_initcall(bfin_isp1761_init); |
104 | #endif | 104 | #endif |
105 | 105 | ||
106 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | ||
107 | #include <linux/input.h> | ||
108 | #include <linux/gpio_keys.h> | ||
109 | |||
110 | static struct gpio_keys_button bfin_gpio_keys_table[] = { | ||
111 | {BTN_0, GPIO_PF2, 1, "gpio-keys: BTN0"}, | ||
112 | {BTN_1, GPIO_PF3, 1, "gpio-keys: BTN1"}, | ||
113 | {BTN_2, GPIO_PF4, 1, "gpio-keys: BTN2"}, | ||
114 | {BTN_3, GPIO_PF5, 1, "gpio-keys: BTN3"}, | ||
115 | }; | ||
116 | |||
117 | static struct gpio_keys_platform_data bfin_gpio_keys_data = { | ||
118 | .buttons = bfin_gpio_keys_table, | ||
119 | .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table), | ||
120 | }; | ||
121 | |||
122 | static struct platform_device bfin_device_gpiokeys = { | ||
123 | .name = "gpio-keys", | ||
124 | .dev = { | ||
125 | .platform_data = &bfin_gpio_keys_data, | ||
126 | }, | ||
127 | }; | ||
128 | #endif | ||
129 | |||
106 | #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) | 130 | #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) |
107 | static struct resource bfin_pcmcia_cf_resources[] = { | 131 | static struct resource bfin_pcmcia_cf_resources[] = { |
108 | { | 132 | { |
@@ -738,6 +762,10 @@ static struct platform_device *stamp_devices[] __initdata = { | |||
738 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) | 762 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) |
739 | &bfin_pata_device, | 763 | &bfin_pata_device, |
740 | #endif | 764 | #endif |
765 | |||
766 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | ||
767 | &bfin_device_gpiokeys, | ||
768 | #endif | ||
741 | }; | 769 | }; |
742 | 770 | ||
743 | static int __init stamp_init(void) | 771 | static int __init stamp_init(void) |
diff --git a/arch/blackfin/mach-bf548/boards/ezkit.c b/arch/blackfin/mach-bf548/boards/ezkit.c index 856b9db06663..4ca3288fd07c 100644 --- a/arch/blackfin/mach-bf548/boards/ezkit.c +++ b/arch/blackfin/mach-bf548/boards/ezkit.c | |||
@@ -514,6 +514,29 @@ static struct platform_device i2c_bfin_twi1_device = { | |||
514 | #endif | 514 | #endif |
515 | #endif | 515 | #endif |
516 | 516 | ||
517 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | ||
518 | #include <linux/gpio_keys.h> | ||
519 | |||
520 | static struct gpio_keys_button bfin_gpio_keys_table[] = { | ||
521 | {BTN_0, GPIO_PB8, 1, "gpio-keys: BTN0"}, | ||
522 | {BTN_1, GPIO_PB9, 1, "gpio-keys: BTN1"}, | ||
523 | {BTN_2, GPIO_PB10, 1, "gpio-keys: BTN2"}, | ||
524 | {BTN_3, GPIO_PB11, 1, "gpio-keys: BTN3"}, | ||
525 | }; | ||
526 | |||
527 | static struct gpio_keys_platform_data bfin_gpio_keys_data = { | ||
528 | .buttons = bfin_gpio_keys_table, | ||
529 | .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table), | ||
530 | }; | ||
531 | |||
532 | static struct platform_device bfin_device_gpiokeys = { | ||
533 | .name = "gpio-keys", | ||
534 | .dev = { | ||
535 | .platform_data = &bfin_gpio_keys_data, | ||
536 | }, | ||
537 | }; | ||
538 | #endif | ||
539 | |||
517 | static struct platform_device *ezkit_devices[] __initdata = { | 540 | static struct platform_device *ezkit_devices[] __initdata = { |
518 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) | 541 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) |
519 | &rtc_device, | 542 | &rtc_device, |
@@ -562,6 +585,10 @@ static struct platform_device *ezkit_devices[] __initdata = { | |||
562 | &i2c_bfin_twi1_device, | 585 | &i2c_bfin_twi1_device, |
563 | #endif | 586 | #endif |
564 | #endif | 587 | #endif |
588 | |||
589 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | ||
590 | &bfin_device_gpiokeys, | ||
591 | #endif | ||
565 | }; | 592 | }; |
566 | 593 | ||
567 | static int __init stamp_init(void) | 594 | static int __init stamp_init(void) |
diff --git a/arch/blackfin/mach-bf561/boards/ezkit.c b/arch/blackfin/mach-bf561/boards/ezkit.c index 4ff8f6e7a11f..edfceb08a7d5 100644 --- a/arch/blackfin/mach-bf561/boards/ezkit.c +++ b/arch/blackfin/mach-bf561/boards/ezkit.c | |||
@@ -246,6 +246,30 @@ static struct platform_device bfin_pata_device = { | |||
246 | }; | 246 | }; |
247 | #endif | 247 | #endif |
248 | 248 | ||
249 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | ||
250 | #include <linux/input.h> | ||
251 | #include <linux/gpio_keys.h> | ||
252 | |||
253 | static struct gpio_keys_button bfin_gpio_keys_table[] = { | ||
254 | {BTN_0, GPIO_PF5, 1, "gpio-keys: BTN0"}, | ||
255 | {BTN_1, GPIO_PF6, 1, "gpio-keys: BTN1"}, | ||
256 | {BTN_2, GPIO_PF7, 1, "gpio-keys: BTN2"}, | ||
257 | {BTN_3, GPIO_PF8, 1, "gpio-keys: BTN3"}, | ||
258 | }; | ||
259 | |||
260 | static struct gpio_keys_platform_data bfin_gpio_keys_data = { | ||
261 | .buttons = bfin_gpio_keys_table, | ||
262 | .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table), | ||
263 | }; | ||
264 | |||
265 | static struct platform_device bfin_device_gpiokeys = { | ||
266 | .name = "gpio-keys", | ||
267 | .dev = { | ||
268 | .platform_data = &bfin_gpio_keys_data, | ||
269 | }, | ||
270 | }; | ||
271 | #endif | ||
272 | |||
249 | static struct platform_device *ezkit_devices[] __initdata = { | 273 | static struct platform_device *ezkit_devices[] __initdata = { |
250 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) | 274 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
251 | &smc91x_device, | 275 | &smc91x_device, |
@@ -258,12 +282,18 @@ static struct platform_device *ezkit_devices[] __initdata = { | |||
258 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | 282 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
259 | &bfin_spi0_device, | 283 | &bfin_spi0_device, |
260 | #endif | 284 | #endif |
285 | |||
261 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 286 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
262 | &bfin_uart_device, | 287 | &bfin_uart_device, |
263 | #endif | 288 | #endif |
289 | |||
264 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) | 290 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) |
265 | &bfin_pata_device, | 291 | &bfin_pata_device, |
266 | #endif | 292 | #endif |
293 | |||
294 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | ||
295 | &bfin_device_gpiokeys, | ||
296 | #endif | ||
267 | }; | 297 | }; |
268 | 298 | ||
269 | static int __init ezkit_init(void) | 299 | static int __init ezkit_init(void) |