diff options
author | Eric Miao <eric.miao@marvell.com> | 2008-06-17 07:03:54 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-07-09 16:38:33 -0400 |
commit | 5c9f50e90e8056fb5a8bdd479ab0591d5dad79a0 (patch) | |
tree | f23cc01fa81116402d40a3db91d788e9cd7e5985 /arch/arm/mach-pxa | |
parent | a1f7fc48c143537e2bf70affee7e8932f5be9bb4 (diff) |
[ARM] pxa: add simple gpio debug LEDs support for zylonite
Signed-off-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-pxa')
-rw-r--r-- | arch/arm/mach-pxa/zylonite.c | 39 | ||||
-rw-r--r-- | arch/arm/mach-pxa/zylonite_pxa300.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-pxa/zylonite_pxa320.c | 6 |
3 files changed, 49 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/zylonite.c b/arch/arm/mach-pxa/zylonite.c index 13ab2985a026..4a4711d36e73 100644 --- a/arch/arm/mach-pxa/zylonite.c +++ b/arch/arm/mach-pxa/zylonite.c | |||
@@ -38,6 +38,8 @@ | |||
38 | struct platform_mmc_slot zylonite_mmc_slot[MAX_SLOTS]; | 38 | struct platform_mmc_slot zylonite_mmc_slot[MAX_SLOTS]; |
39 | 39 | ||
40 | int gpio_eth_irq; | 40 | int gpio_eth_irq; |
41 | int gpio_debug_led1; | ||
42 | int gpio_debug_led2; | ||
41 | 43 | ||
42 | int wm9713_irq; | 44 | int wm9713_irq; |
43 | 45 | ||
@@ -64,6 +66,42 @@ static struct platform_device smc91x_device = { | |||
64 | .resource = smc91x_resources, | 66 | .resource = smc91x_resources, |
65 | }; | 67 | }; |
66 | 68 | ||
69 | #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) | ||
70 | static struct gpio_led zylonite_debug_leds[] = { | ||
71 | [0] = { | ||
72 | .name = "zylonite:yellow:1", | ||
73 | .default_trigger = "heartbeat", | ||
74 | }, | ||
75 | [1] = { | ||
76 | .name = "zylonite:yellow:2", | ||
77 | .default_trigger = "default-on", | ||
78 | }, | ||
79 | }; | ||
80 | |||
81 | static struct gpio_led_platform_data zylonite_debug_leds_info = { | ||
82 | .leds = zylonite_debug_leds, | ||
83 | .num_leds = ARRAY_SIZE(zylonite_debug_leds), | ||
84 | }; | ||
85 | |||
86 | static struct platform_device zylonite_device_leds = { | ||
87 | .name = "leds-gpio", | ||
88 | .id = -1, | ||
89 | .dev = { | ||
90 | .platform_data = &zylonite_debug_leds_info, | ||
91 | } | ||
92 | }; | ||
93 | |||
94 | static void __init zylonite_init_leds(void) | ||
95 | { | ||
96 | zylonite_debug_leds[0].gpio = gpio_debug_led1; | ||
97 | zylonite_debug_leds[1].gpio = gpio_debug_led2; | ||
98 | |||
99 | platform_device_register(&zylonite_device_leds); | ||
100 | } | ||
101 | #else | ||
102 | static inline void zylonite_init_leds(void) {} | ||
103 | #endif | ||
104 | |||
67 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) | 105 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) |
68 | static struct platform_pwm_backlight_data zylonite_backlight_data = { | 106 | static struct platform_pwm_backlight_data zylonite_backlight_data = { |
69 | .pwm_id = 3, | 107 | .pwm_id = 3, |
@@ -395,6 +433,7 @@ static void __init zylonite_init(void) | |||
395 | zylonite_init_mmc(); | 433 | zylonite_init_mmc(); |
396 | zylonite_init_keypad(); | 434 | zylonite_init_keypad(); |
397 | zylonite_init_nand(); | 435 | zylonite_init_nand(); |
436 | zylonite_init_leds(); | ||
398 | } | 437 | } |
399 | 438 | ||
400 | MACHINE_START(ZYLONITE, "PXA3xx Platform Development Kit (aka Zylonite)") | 439 | MACHINE_START(ZYLONITE, "PXA3xx Platform Development Kit (aka Zylonite)") |
diff --git a/arch/arm/mach-pxa/zylonite_pxa300.c b/arch/arm/mach-pxa/zylonite_pxa300.c index 75bf61f1f1c3..b28d46e081d3 100644 --- a/arch/arm/mach-pxa/zylonite_pxa300.c +++ b/arch/arm/mach-pxa/zylonite_pxa300.c | |||
@@ -264,4 +264,8 @@ void __init zylonite_pxa300_init(void) | |||
264 | zylonite_mmc_slot[2].gpio_cd = EXT_GPIO(30); | 264 | zylonite_mmc_slot[2].gpio_cd = EXT_GPIO(30); |
265 | zylonite_mmc_slot[2].gpio_wp = EXT_GPIO(31); | 265 | zylonite_mmc_slot[2].gpio_wp = EXT_GPIO(31); |
266 | } | 266 | } |
267 | |||
268 | /* GPIOs for Debug LEDs */ | ||
269 | gpio_debug_led1 = EXT_GPIO(25); | ||
270 | gpio_debug_led2 = EXT_GPIO(26); | ||
267 | } | 271 | } |
diff --git a/arch/arm/mach-pxa/zylonite_pxa320.c b/arch/arm/mach-pxa/zylonite_pxa320.c index 2b4fc34919ac..2b7fba7a2921 100644 --- a/arch/arm/mach-pxa/zylonite_pxa320.c +++ b/arch/arm/mach-pxa/zylonite_pxa320.c | |||
@@ -116,6 +116,10 @@ static mfp_cfg_t mfp_cfg[] __initdata = { | |||
116 | GPIO27_MMC2_DAT3, | 116 | GPIO27_MMC2_DAT3, |
117 | GPIO28_MMC2_CLK, | 117 | GPIO28_MMC2_CLK, |
118 | GPIO29_MMC2_CMD, | 118 | GPIO29_MMC2_CMD, |
119 | |||
120 | /* Debug LEDs */ | ||
121 | GPIO1_2_GPIO | MFP_LPM_DRIVE_HIGH, | ||
122 | GPIO4_2_GPIO | MFP_LPM_DRIVE_HIGH, | ||
119 | }; | 123 | }; |
120 | 124 | ||
121 | #define NUM_LCD_DETECT_PINS 7 | 125 | #define NUM_LCD_DETECT_PINS 7 |
@@ -189,6 +193,8 @@ void __init zylonite_pxa320_init(void) | |||
189 | 193 | ||
190 | /* GPIO pin assignment */ | 194 | /* GPIO pin assignment */ |
191 | gpio_eth_irq = mfp_to_gpio(MFP_PIN_GPIO9); | 195 | gpio_eth_irq = mfp_to_gpio(MFP_PIN_GPIO9); |
196 | gpio_debug_led1 = mfp_to_gpio(MFP_PIN_GPIO1_2); | ||
197 | gpio_debug_led2 = mfp_to_gpio(MFP_PIN_GPIO4_2); | ||
192 | 198 | ||
193 | /* MMC card detect & write protect for controller 0 */ | 199 | /* MMC card detect & write protect for controller 0 */ |
194 | zylonite_mmc_slot[0].gpio_cd = mfp_to_gpio(MFP_PIN_GPIO1); | 200 | zylonite_mmc_slot[0].gpio_cd = mfp_to_gpio(MFP_PIN_GPIO1); |