From 0eda937ab53144e40ebd29bb6bc5f3665fef9664 Mon Sep 17 00:00:00 2001 From: Martin Michlmayr Date: Mon, 21 Jul 2008 19:58:48 +0300 Subject: [PATCH] --- yaml --- r: 108630 b: refs/heads/master c: 4a4e30afefbfd069ef09de3514cce4886e83ff10 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/arm/mach-orion5x/ts409-setup.c | 42 +++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 0b2770b7e405..23b9b8e57cd1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ce72e36ed1a57ba086270039c7d6fac9bf1c5fbc +refs/heads/master: 4a4e30afefbfd069ef09de3514cce4886e83ff10 diff --git a/trunk/arch/arm/mach-orion5x/ts409-setup.c b/trunk/arch/arm/mach-orion5x/ts409-setup.c index 6053e76ac967..3133b73282e9 100644 --- a/trunk/arch/arm/mach-orion5x/ts409-setup.c +++ b/trunk/arch/arm/mach-orion5x/ts409-setup.c @@ -3,6 +3,9 @@ * * Maintainer: Sylver Bruneau * + * Copyright (C) 2008 Sylver Bruneau + * Copyright (C) 2008 Martin Michlmayr + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version @@ -16,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -162,6 +166,43 @@ static struct i2c_board_info __initdata qnap_ts409_i2c_rtc = { I2C_BOARD_INFO("s35390a", 0x30), }; +/***************************************************************************** + * LEDs attached to GPIO + ****************************************************************************/ + +static struct gpio_led ts409_led_pins[] = { + { + .name = "ts409:red:sata1", + .gpio = 4, + .active_low = 1, + }, { + .name = "ts409:red:sata2", + .gpio = 5, + .active_low = 1, + }, { + .name = "ts409:red:sata3", + .gpio = 6, + .active_low = 1, + }, { + .name = "ts409:red:sata4", + .gpio = 7, + .active_low = 1, + }, +}; + +static struct gpio_led_platform_data ts409_led_data = { + .leds = ts409_led_pins, + .num_leds = ARRAY_SIZE(ts409_led_pins), +}; + +static struct platform_device ts409_leds = { + .name = "leds-gpio", + .id = -1, + .dev = { + .platform_data = &ts409_led_data, + }, +}; + /**************************************************************************** * GPIO Attached Keys * Power button is attached to the PIC microcontroller @@ -255,6 +296,7 @@ static void __init qnap_ts409_init(void) if (qnap_ts409_i2c_rtc.irq == 0) pr_warning("qnap_ts409_init: failed to get RTC IRQ\n"); i2c_register_board_info(0, &qnap_ts409_i2c_rtc, 1); + platform_device_register(&ts409_leds); /* register tsx09 specific power-off method */ pm_power_off = qnap_tsx09_power_off;