aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/balloon3.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-pxa/balloon3.c')
-rw-r--r--arch/arm/mach-pxa/balloon3.c84
1 files changed, 81 insertions, 3 deletions
diff --git a/arch/arm/mach-pxa/balloon3.c b/arch/arm/mach-pxa/balloon3.c
index 91ad56d6e929..6f594bd410dd 100644
--- a/arch/arm/mach-pxa/balloon3.c
+++ b/arch/arm/mach-pxa/balloon3.c
@@ -26,6 +26,7 @@
26#include <linux/mtd/mtd.h> 26#include <linux/mtd/mtd.h>
27#include <linux/mtd/partitions.h> 27#include <linux/mtd/partitions.h>
28#include <linux/types.h> 28#include <linux/types.h>
29#include <linux/i2c/pcf857x.h>
29 30
30#include <asm/setup.h> 31#include <asm/setup.h>
31#include <asm/mach-types.h> 32#include <asm/mach-types.h>
@@ -375,15 +376,65 @@ static struct gpio_led_platform_data balloon3_gpio_led_info = {
375 376
376static struct platform_device balloon3_leds = { 377static struct platform_device balloon3_leds = {
377 .name = "leds-gpio", 378 .name = "leds-gpio",
378 .id = -1, 379 .id = 0,
379 .dev = { 380 .dev = {
380 .platform_data = &balloon3_gpio_led_info, 381 .platform_data = &balloon3_gpio_led_info,
381 } 382 }
382}; 383};
383 384
385struct gpio_led balloon3_pcf_gpio_leds[] = {
386 {
387 .name = "balloon3:green:led0",
388 .gpio = BALLOON3_PCF_GPIO_LED0,
389 .active_low = 1,
390 }, {
391 .name = "balloon3:green:led1",
392 .gpio = BALLOON3_PCF_GPIO_LED1,
393 .active_low = 1,
394 }, {
395 .name = "balloon3:orange:led2",
396 .gpio = BALLOON3_PCF_GPIO_LED2,
397 .active_low = 1,
398 }, {
399 .name = "balloon3:orange:led3",
400 .gpio = BALLOON3_PCF_GPIO_LED3,
401 .active_low = 1,
402 }, {
403 .name = "balloon3:orange:led4",
404 .gpio = BALLOON3_PCF_GPIO_LED4,
405 .active_low = 1,
406 }, {
407 .name = "balloon3:orange:led5",
408 .gpio = BALLOON3_PCF_GPIO_LED5,
409 .active_low = 1,
410 }, {
411 .name = "balloon3:red:led6",
412 .gpio = BALLOON3_PCF_GPIO_LED6,
413 .active_low = 1,
414 }, {
415 .name = "balloon3:red:led7",
416 .gpio = BALLOON3_PCF_GPIO_LED7,
417 .active_low = 1,
418 },
419};
420
421static struct gpio_led_platform_data balloon3_pcf_gpio_led_info = {
422 .leds = balloon3_pcf_gpio_leds,
423 .num_leds = ARRAY_SIZE(balloon3_pcf_gpio_leds),
424};
425
426static struct platform_device balloon3_pcf_leds = {
427 .name = "leds-gpio",
428 .id = 1,
429 .dev = {
430 .platform_data = &balloon3_pcf_gpio_led_info,
431 }
432};
433
384static void __init balloon3_leds_init(void) 434static void __init balloon3_leds_init(void)
385{ 435{
386 platform_device_register(&balloon3_leds); 436 platform_device_register(&balloon3_leds);
437 platform_device_register(&balloon3_pcf_leds);
387} 438}
388#else 439#else
389static inline void balloon3_leds_init(void) {} 440static inline void balloon3_leds_init(void) {}
@@ -451,6 +502,34 @@ static void __init balloon3_init_irq(void)
451} 502}
452 503
453/****************************************************************************** 504/******************************************************************************
505 * GPIO expander
506 ******************************************************************************/
507#if defined(CONFIG_GPIO_PCF857X) || defined(CONFIG_GPIO_PCF857X_MODULE)
508static struct pcf857x_platform_data balloon3_pcf857x_pdata = {
509 .gpio_base = BALLOON3_PCF_GPIO_BASE,
510 .n_latch = 0,
511 .setup = NULL,
512 .teardown = NULL,
513 .context = NULL,
514};
515
516static struct i2c_board_info __initdata balloon3_i2c_devs[] = {
517 {
518 I2C_BOARD_INFO("pcf8574a", 0x38),
519 .platform_data = &balloon3_pcf857x_pdata,
520 },
521};
522
523static void __init balloon3_i2c_init(void)
524{
525 pxa_set_i2c_info(NULL);
526 i2c_register_board_info(0, ARRAY_AND_SIZE(balloon3_i2c_devs));
527}
528#else
529static inline void balloon3_i2c_init(void) {}
530#endif
531
532/******************************************************************************
454 * Machine init 533 * Machine init
455 ******************************************************************************/ 534 ******************************************************************************/
456static void __init balloon3_init(void) 535static void __init balloon3_init(void)
@@ -463,8 +542,7 @@ static void __init balloon3_init(void)
463 pxa_set_btuart_info(NULL); 542 pxa_set_btuart_info(NULL);
464 pxa_set_stuart_info(NULL); 543 pxa_set_stuart_info(NULL);
465 544
466 pxa_set_i2c_info(NULL); 545 balloon3_i2c_init();
467
468 balloon3_irda_init(); 546 balloon3_irda_init();
469 balloon3_lcd_init(); 547 balloon3_lcd_init();
470 balloon3_leds_init(); 548 balloon3_leds_init();