aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-orion5x/dns323-setup.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-03-12 19:00:54 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-12 19:00:54 -0500
commitdca1d9f6d7ae428c193f32bd3e9a4ca13176648b (patch)
tree02de8c3503c1c811754423d2fa3f3b4978044f6e /arch/arm/mach-orion5x/dns323-setup.c
parent9ff99339447de403a46be5e3f23d0c794d540b06 (diff)
parent91e013827c0bcbb187ecf02213c5446b6f62d445 (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/dns323-setup.c')
-rw-r--r--arch/arm/mach-orion5x/dns323-setup.c36
1 files changed, 33 insertions, 3 deletions
diff --git a/arch/arm/mach-orion5x/dns323-setup.c b/arch/arm/mach-orion5x/dns323-setup.c
index 8f159db4d08a..421b82f7c63d 100644
--- a/arch/arm/mach-orion5x/dns323-setup.c
+++ b/arch/arm/mach-orion5x/dns323-setup.c
@@ -34,7 +34,8 @@
34#define DNS323_GPIO_LED_RIGHT_AMBER 1 34#define DNS323_GPIO_LED_RIGHT_AMBER 1
35#define DNS323_GPIO_LED_LEFT_AMBER 2 35#define DNS323_GPIO_LED_LEFT_AMBER 2
36#define DNS323_GPIO_SYSTEM_UP 3 36#define DNS323_GPIO_SYSTEM_UP 3
37#define DNS323_GPIO_LED_POWER 5 37#define DNS323_GPIO_LED_POWER1 4
38#define DNS323_GPIO_LED_POWER2 5
38#define DNS323_GPIO_OVERTEMP 6 39#define DNS323_GPIO_OVERTEMP 6
39#define DNS323_GPIO_RTC 7 40#define DNS323_GPIO_RTC 7
40#define DNS323_GPIO_POWER_OFF 8 41#define DNS323_GPIO_POWER_OFF 8
@@ -237,11 +238,31 @@ error_fail:
237 * GPIO LEDs (simple - doesn't use hardware blinking support) 238 * GPIO LEDs (simple - doesn't use hardware blinking support)
238 */ 239 */
239 240
241#define ORION_BLINK_HALF_PERIOD 100 /* ms */
242
243static int dns323_gpio_blink_set(unsigned gpio,
244 unsigned long *delay_on, unsigned long *delay_off)
245{
246 static int value = 0;
247
248 if (!*delay_on && !*delay_off)
249 *delay_on = *delay_off = ORION_BLINK_HALF_PERIOD;
250
251 if (ORION_BLINK_HALF_PERIOD == *delay_on
252 && ORION_BLINK_HALF_PERIOD == *delay_off) {
253 value = !value;
254 orion_gpio_set_blink(gpio, value);
255 return 0;
256 }
257
258 return -EINVAL;
259}
260
240static struct gpio_led dns323_leds[] = { 261static struct gpio_led dns323_leds[] = {
241 { 262 {
242 .name = "power:blue", 263 .name = "power:blue",
243 .gpio = DNS323_GPIO_LED_POWER, 264 .gpio = DNS323_GPIO_LED_POWER2,
244 .default_state = LEDS_GPIO_DEFSTATE_ON, 265 .default_trigger = "timer",
245 }, { 266 }, {
246 .name = "right:amber", 267 .name = "right:amber",
247 .gpio = DNS323_GPIO_LED_RIGHT_AMBER, 268 .gpio = DNS323_GPIO_LED_RIGHT_AMBER,
@@ -256,6 +277,7 @@ static struct gpio_led dns323_leds[] = {
256static struct gpio_led_platform_data dns323_led_data = { 277static struct gpio_led_platform_data dns323_led_data = {
257 .num_leds = ARRAY_SIZE(dns323_leds), 278 .num_leds = ARRAY_SIZE(dns323_leds),
258 .leds = dns323_leds, 279 .leds = dns323_leds,
280 .gpio_blink_set = dns323_gpio_blink_set,
259}; 281};
260 282
261static struct platform_device dns323_gpio_leds = { 283static struct platform_device dns323_gpio_leds = {
@@ -412,6 +434,14 @@ static void __init dns323_init(void)
412 orion5x_setup_dev_boot_win(DNS323_NOR_BOOT_BASE, DNS323_NOR_BOOT_SIZE); 434 orion5x_setup_dev_boot_win(DNS323_NOR_BOOT_BASE, DNS323_NOR_BOOT_SIZE);
413 platform_device_register(&dns323_nor_flash); 435 platform_device_register(&dns323_nor_flash);
414 436
437 /* The 5181 power LED is active low and requires
438 * DNS323_GPIO_LED_POWER1 to also be low.
439 */
440 if (dns323_dev_id() == MV88F5181_DEV_ID) {
441 dns323_leds[0].active_low = 1;
442 gpio_direction_output(DNS323_GPIO_LED_POWER1, 0);
443 }
444
415 platform_device_register(&dns323_gpio_leds); 445 platform_device_register(&dns323_gpio_leds);
416 446
417 platform_device_register(&dns323_button_device); 447 platform_device_register(&dns323_button_device);