diff options
author | Martin Michlmayr <tbm@cyrius.com> | 2008-07-07 14:23:09 -0400 |
---|---|---|
committer | Nicolas Pitre <nico@cam.org> | 2008-07-07 18:38:24 -0400 |
commit | 2e1117d307dba8185a72bac94e57f057e70590ca (patch) | |
tree | 900ea6f9ff31ff08eae1719af57e54aef4f72d68 | |
parent | 6b5cdf0f6d4dc3d98de20d6b0abe8500046f1cb1 (diff) |
[ARM] Orion: LED support for HP mv2120
The HP mv2120 has several LEDs that are controlled through gpio.
Export the health LED, the red SATA LEDs as well as two gpios
that control the brightness of _all_ LEDs to userland. The
Ethernet and power LEDs can't be controlled through gpio and the
blue SATA LEDs are handled via the SATA driver.
Signed-off-by: Martin Michlmayr <tbm@cyrius.com>
Signed-off-by: Nicolas Pitre <nico@marvell.com>
-rw-r--r-- | arch/arm/configs/orion5x_defconfig | 4 | ||||
-rw-r--r-- | arch/arm/mach-orion5x/mv2120-setup.c | 45 |
2 files changed, 47 insertions, 2 deletions
diff --git a/arch/arm/configs/orion5x_defconfig b/arch/arm/configs/orion5x_defconfig index 8a7cabfae574..9578b5d9f9c7 100644 --- a/arch/arm/configs/orion5x_defconfig +++ b/arch/arm/configs/orion5x_defconfig | |||
@@ -1077,7 +1077,7 @@ CONFIG_LEDS_CLASS=y | |||
1077 | # | 1077 | # |
1078 | # LED drivers | 1078 | # LED drivers |
1079 | # | 1079 | # |
1080 | # CONFIG_LEDS_GPIO is not set | 1080 | CONFIG_LEDS_GPIO=y |
1081 | 1081 | ||
1082 | # | 1082 | # |
1083 | # LED Triggers | 1083 | # LED Triggers |
@@ -1085,7 +1085,7 @@ CONFIG_LEDS_CLASS=y | |||
1085 | CONFIG_LEDS_TRIGGERS=y | 1085 | CONFIG_LEDS_TRIGGERS=y |
1086 | CONFIG_LEDS_TRIGGER_TIMER=y | 1086 | CONFIG_LEDS_TRIGGER_TIMER=y |
1087 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y | 1087 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y |
1088 | # CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set | 1088 | CONFIG_LEDS_TRIGGER_DEFAULT_ON=y |
1089 | CONFIG_RTC_LIB=y | 1089 | CONFIG_RTC_LIB=y |
1090 | CONFIG_RTC_CLASS=y | 1090 | CONFIG_RTC_CLASS=y |
1091 | CONFIG_RTC_HCTOSYS=y | 1091 | CONFIG_RTC_HCTOSYS=y |
diff --git a/arch/arm/mach-orion5x/mv2120-setup.c b/arch/arm/mach-orion5x/mv2120-setup.c index f1dcad36b13c..55f3b0fdef8b 100644 --- a/arch/arm/mach-orion5x/mv2120-setup.c +++ b/arch/arm/mach-orion5x/mv2120-setup.c | |||
@@ -137,6 +137,50 @@ static struct i2c_board_info __initdata mv2120_i2c_rtc = { | |||
137 | .irq = 0, | 137 | .irq = 0, |
138 | }; | 138 | }; |
139 | 139 | ||
140 | static struct gpio_led mv2120_led_pins[] = { | ||
141 | { | ||
142 | .name = "mv2120:blue:health", | ||
143 | .gpio = 0, | ||
144 | }, | ||
145 | { | ||
146 | .name = "mv2120:red:health", | ||
147 | .gpio = 1, | ||
148 | }, | ||
149 | { | ||
150 | .name = "mv2120:led:bright", | ||
151 | .gpio = 4, | ||
152 | .default_trigger = "default-on", | ||
153 | }, | ||
154 | { | ||
155 | .name = "mv2120:led:dimmed", | ||
156 | .gpio = 5, | ||
157 | }, | ||
158 | { | ||
159 | .name = "mv2120:red:sata0", | ||
160 | .gpio = 8, | ||
161 | .active_low = 1, | ||
162 | }, | ||
163 | { | ||
164 | .name = "mv2120:red:sata1", | ||
165 | .gpio = 9, | ||
166 | .active_low = 1, | ||
167 | }, | ||
168 | |||
169 | }; | ||
170 | |||
171 | static struct gpio_led_platform_data mv2120_led_data = { | ||
172 | .leds = mv2120_led_pins, | ||
173 | .num_leds = ARRAY_SIZE(mv2120_led_pins), | ||
174 | }; | ||
175 | |||
176 | static struct platform_device mv2120_leds = { | ||
177 | .name = "leds-gpio", | ||
178 | .id = -1, | ||
179 | .dev = { | ||
180 | .platform_data = &mv2120_led_data, | ||
181 | } | ||
182 | }; | ||
183 | |||
140 | static void mv2120_power_off(void) | 184 | static void mv2120_power_off(void) |
141 | { | 185 | { |
142 | pr_info("%s: triggering power-off...\n", __func__); | 186 | pr_info("%s: triggering power-off...\n", __func__); |
@@ -172,6 +216,7 @@ static void __init mv2120_init(void) | |||
172 | gpio_free(MV2120_GPIO_RTC_IRQ); | 216 | gpio_free(MV2120_GPIO_RTC_IRQ); |
173 | } | 217 | } |
174 | i2c_register_board_info(0, &mv2120_i2c_rtc, 1); | 218 | i2c_register_board_info(0, &mv2120_i2c_rtc, 1); |
219 | platform_device_register(&mv2120_leds); | ||
175 | 220 | ||
176 | /* register mv2120 specific power-off method */ | 221 | /* register mv2120 specific power-off method */ |
177 | if (gpio_request(MV2120_GPIO_POWER_OFF, "POWEROFF") != 0 || | 222 | if (gpio_request(MV2120_GPIO_POWER_OFF, "POWEROFF") != 0 || |