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 /arch/blackfin/mach-bf533 | |
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>
Diffstat (limited to 'arch/blackfin/mach-bf533')
-rw-r--r-- | arch/blackfin/mach-bf533/boards/ezkit.c | 28 | ||||
-rw-r--r-- | arch/blackfin/mach-bf533/boards/stamp.c | 27 |
2 files changed, 55 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) |