diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-12 19:00:54 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-12 19:00:54 -0500 |
commit | dca1d9f6d7ae428c193f32bd3e9a4ca13176648b (patch) | |
tree | 02de8c3503c1c811754423d2fa3f3b4978044f6e /arch/arm/mach-orion5x/d2net-setup.c | |
parent | 9ff99339447de403a46be5e3f23d0c794d540b06 (diff) | |
parent | 91e013827c0bcbb187ecf02213c5446b6f62d445 (diff) |
Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: (370 commits)
ARM: S3C2443: Add set_rate and round_rate calls for armdiv clock
ARM: S3C2443: Remove #if 0 for clk_mpll
ARM: S3C2443: Update notes on MPLLREF clock
ARM: S3C2443: Further clksrc-clk conversions
ARM: S3C2443: Change to using plat-samsung clksrc-clk implementation
USB: Fix s3c-hsotg build following Samsung platform header moves
ARM: S3C64XX: Reintroduce unconditional build of audio device
ARM: 5961/1: ux500: fix CLKRST addresses
ARM: 5977/1: arm: Enable backtrace printing on oops when PC is corrupted
ASoC: Fix S3C64xx IIS driver for Samsung header reorg
ARM: S3C2440: Fix plat-s3c24xx move of s3c2440/s3c2442 support
[ARM] pxa: fix typo in mxm8x10.h
[ARM] pxa/raumfeld: set GPIO drive bits for LED pins
[ARM] pxa/zeus: Add support for mcp2515 CAN bus
[ARM] pxa/zeus: Add support for onboard max6369 watchdog
[ARM] pxa/zeus: Add Eurotech as the manufacturer
[ARM] pxa/zeus: Correct the USB host initialisation flags
[ARM] pxa/zeus: Allow usage of 8250-compatible UART in uncompress
[ARM] pxa: refactor uncompress.h for non-PXA uarts
[ARM] mmp2: fix incorrect calling of chip->mask_ack() for 2nd level cascaded IRQs
...
Diffstat (limited to 'arch/arm/mach-orion5x/d2net-setup.c')
-rw-r--r-- | arch/arm/mach-orion5x/d2net-setup.c | 45 |
1 files changed, 21 insertions, 24 deletions
diff --git a/arch/arm/mach-orion5x/d2net-setup.c b/arch/arm/mach-orion5x/d2net-setup.c index 9d4bf763f25b..7130904ad999 100644 --- a/arch/arm/mach-orion5x/d2net-setup.c +++ b/arch/arm/mach-orion5x/d2net-setup.c | |||
@@ -149,10 +149,7 @@ static void __init d2net_sata_power_init(void) | |||
149 | 149 | ||
150 | /* | 150 | /* |
151 | * The blue front LED is wired to the CPLD and can blink in relation with the | 151 | * The blue front LED is wired to the CPLD and can blink in relation with the |
152 | * SATA activity. This feature is disabled to make this LED compatible with | 152 | * SATA activity. |
153 | * the leds-gpio driver: MPP14 and MPP15 are configured to act like output | ||
154 | * GPIO's and have to stay in an active state. This is needed to set the blue | ||
155 | * LED in a "fix on" state regardless of the SATA activity. | ||
156 | * | 153 | * |
157 | * The following array detail the different LED registers and the combination | 154 | * The following array detail the different LED registers and the combination |
158 | * of their possible values: | 155 | * of their possible values: |
@@ -171,12 +168,11 @@ static void __init d2net_sata_power_init(void) | |||
171 | #define D2NET_GPIO_RED_LED 6 | 168 | #define D2NET_GPIO_RED_LED 6 |
172 | #define D2NET_GPIO_BLUE_LED_BLINK_CTRL 16 | 169 | #define D2NET_GPIO_BLUE_LED_BLINK_CTRL 16 |
173 | #define D2NET_GPIO_BLUE_LED_OFF 23 | 170 | #define D2NET_GPIO_BLUE_LED_OFF 23 |
174 | #define D2NET_GPIO_SATA0_ACT 14 | ||
175 | #define D2NET_GPIO_SATA1_ACT 15 | ||
176 | 171 | ||
177 | static struct gpio_led d2net_leds[] = { | 172 | static struct gpio_led d2net_leds[] = { |
178 | { | 173 | { |
179 | .name = "d2net:blue:power", | 174 | .name = "d2net:blue:sata", |
175 | .default_trigger = "default-on", | ||
180 | .gpio = D2NET_GPIO_BLUE_LED_OFF, | 176 | .gpio = D2NET_GPIO_BLUE_LED_OFF, |
181 | .active_low = 1, | 177 | .active_low = 1, |
182 | }, | 178 | }, |
@@ -201,25 +197,22 @@ static struct platform_device d2net_gpio_leds = { | |||
201 | 197 | ||
202 | static void __init d2net_gpio_leds_init(void) | 198 | static void __init d2net_gpio_leds_init(void) |
203 | { | 199 | { |
200 | int err; | ||
201 | |||
204 | /* Configure GPIO over MPP max number. */ | 202 | /* Configure GPIO over MPP max number. */ |
205 | orion_gpio_set_valid(D2NET_GPIO_BLUE_LED_OFF, 1); | 203 | orion_gpio_set_valid(D2NET_GPIO_BLUE_LED_OFF, 1); |
206 | 204 | ||
207 | if (gpio_request(D2NET_GPIO_SATA0_ACT, "LED SATA0 activity") != 0) | 205 | /* Configure register blink_ctrl to allow SATA activity LED blinking. */ |
208 | return; | 206 | err = gpio_request(D2NET_GPIO_BLUE_LED_BLINK_CTRL, "blue LED blink"); |
209 | if (gpio_direction_output(D2NET_GPIO_SATA0_ACT, 1) != 0) | 207 | if (err == 0) { |
210 | goto err_free_1; | 208 | err = gpio_direction_output(D2NET_GPIO_BLUE_LED_BLINK_CTRL, 1); |
211 | if (gpio_request(D2NET_GPIO_SATA1_ACT, "LED SATA1 activity") != 0) | 209 | if (err) |
212 | goto err_free_1; | 210 | gpio_free(D2NET_GPIO_BLUE_LED_BLINK_CTRL); |
213 | if (gpio_direction_output(D2NET_GPIO_SATA1_ACT, 1) != 0) | 211 | } |
214 | goto err_free_2; | 212 | if (err) |
215 | platform_device_register(&d2net_gpio_leds); | 213 | pr_err("d2net: failed to configure blue LED blink GPIO\n"); |
216 | return; | ||
217 | 214 | ||
218 | err_free_2: | 215 | platform_device_register(&d2net_gpio_leds); |
219 | gpio_free(D2NET_GPIO_SATA1_ACT); | ||
220 | err_free_1: | ||
221 | gpio_free(D2NET_GPIO_SATA0_ACT); | ||
222 | return; | ||
223 | } | 216 | } |
224 | 217 | ||
225 | /**************************************************************************** | 218 | /**************************************************************************** |
@@ -289,8 +282,8 @@ static struct orion5x_mpp_mode d2net_mpp_modes[] __initdata = { | |||
289 | { 11, MPP_UNUSED }, | 282 | { 11, MPP_UNUSED }, |
290 | { 12, MPP_GPIO }, /* SATA 1 power */ | 283 | { 12, MPP_GPIO }, /* SATA 1 power */ |
291 | { 13, MPP_UNUSED }, | 284 | { 13, MPP_UNUSED }, |
292 | { 14, MPP_GPIO }, /* SATA 0 active */ | 285 | { 14, MPP_SATA_LED }, /* SATA 0 active */ |
293 | { 15, MPP_GPIO }, /* SATA 1 active */ | 286 | { 15, MPP_SATA_LED }, /* SATA 1 active */ |
294 | { 16, MPP_GPIO }, /* Blue front LED blink control */ | 287 | { 16, MPP_GPIO }, /* Blue front LED blink control */ |
295 | { 17, MPP_UNUSED }, | 288 | { 17, MPP_UNUSED }, |
296 | { 18, MPP_GPIO }, /* Front button (0 = Released, 1 = Pushed ) */ | 289 | { 18, MPP_GPIO }, /* Front button (0 = Released, 1 = Pushed ) */ |
@@ -301,6 +294,8 @@ static struct orion5x_mpp_mode d2net_mpp_modes[] __initdata = { | |||
301 | /* 24: Inhibit board power off (0 = Disabled, 1 = Enabled) */ | 294 | /* 24: Inhibit board power off (0 = Disabled, 1 = Enabled) */ |
302 | }; | 295 | }; |
303 | 296 | ||
297 | #define D2NET_GPIO_INHIBIT_POWER_OFF 24 | ||
298 | |||
304 | static void __init d2net_init(void) | 299 | static void __init d2net_init(void) |
305 | { | 300 | { |
306 | /* | 301 | /* |
@@ -333,6 +328,8 @@ static void __init d2net_init(void) | |||
333 | 328 | ||
334 | i2c_register_board_info(0, d2net_i2c_devices, | 329 | i2c_register_board_info(0, d2net_i2c_devices, |
335 | ARRAY_SIZE(d2net_i2c_devices)); | 330 | ARRAY_SIZE(d2net_i2c_devices)); |
331 | |||
332 | orion_gpio_set_valid(D2NET_GPIO_INHIBIT_POWER_OFF, 1); | ||
336 | } | 333 | } |
337 | 334 | ||
338 | /* Warning: LaCie use a wrong mach-type (0x20e=526) in their bootloader. */ | 335 | /* Warning: LaCie use a wrong mach-type (0x20e=526) in their bootloader. */ |