diff options
author | Simon Guinot <sguinot@lacie.com> | 2010-10-22 05:29:18 -0400 |
---|---|---|
committer | Guenter Roeck <guenter.roeck@ericsson.com> | 2010-10-25 17:11:37 -0400 |
commit | 0ab83a7ce5c566b84d492d598dc64a19bfaef9ab (patch) | |
tree | 3fe4d96dbea255b9a4c33861d77b9a1e33a7bb82 /arch/arm/mach-kirkwood | |
parent | d6fe1360f42e86262153927986dea6502daff703 (diff) |
Kirkwood: add fan support for Network Space Max v2
Signed-off-by: Simon Guinot <sguinot@lacie.com>
Acked-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Diffstat (limited to 'arch/arm/mach-kirkwood')
-rw-r--r-- | arch/arm/mach-kirkwood/netspace_v2-setup.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/arch/arm/mach-kirkwood/netspace_v2-setup.c b/arch/arm/mach-kirkwood/netspace_v2-setup.c index 5e286441b8f4..5ea66f1f4178 100644 --- a/arch/arm/mach-kirkwood/netspace_v2-setup.c +++ b/arch/arm/mach-kirkwood/netspace_v2-setup.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/gpio.h> | 30 | #include <linux/gpio.h> |
31 | #include <linux/gpio_keys.h> | 31 | #include <linux/gpio_keys.h> |
32 | #include <linux/leds.h> | 32 | #include <linux/leds.h> |
33 | #include <linux/gpio-fan.h> | ||
33 | #include <asm/mach-types.h> | 34 | #include <asm/mach-types.h> |
34 | #include <asm/mach/arch.h> | 35 | #include <asm/mach/arch.h> |
35 | #include <mach/kirkwood.h> | 36 | #include <mach/kirkwood.h> |
@@ -137,6 +138,46 @@ static struct platform_device netspace_v2_leds = { | |||
137 | }; | 138 | }; |
138 | 139 | ||
139 | /***************************************************************************** | 140 | /***************************************************************************** |
141 | * GPIO fan | ||
142 | ****************************************************************************/ | ||
143 | |||
144 | /* Designed for fan 40x40x16: ADDA AD0412LB-D50 6000rpm@12v */ | ||
145 | static struct gpio_fan_speed netspace_max_v2_fan_speed[] = { | ||
146 | { 0, 0 }, | ||
147 | { 1500, 15 }, | ||
148 | { 1700, 14 }, | ||
149 | { 1800, 13 }, | ||
150 | { 2100, 12 }, | ||
151 | { 3100, 11 }, | ||
152 | { 3300, 10 }, | ||
153 | { 4300, 9 }, | ||
154 | { 5500, 8 }, | ||
155 | }; | ||
156 | |||
157 | static unsigned netspace_max_v2_fan_ctrl[] = { 22, 7, 33, 23 }; | ||
158 | |||
159 | static struct gpio_fan_alarm netspace_max_v2_fan_alarm = { | ||
160 | .gpio = 25, | ||
161 | .active_low = 1, | ||
162 | }; | ||
163 | |||
164 | static struct gpio_fan_platform_data netspace_max_v2_fan_data = { | ||
165 | .num_ctrl = ARRAY_SIZE(netspace_max_v2_fan_ctrl), | ||
166 | .ctrl = netspace_max_v2_fan_ctrl, | ||
167 | .alarm = &netspace_max_v2_fan_alarm, | ||
168 | .num_speed = ARRAY_SIZE(netspace_max_v2_fan_speed), | ||
169 | .speed = netspace_max_v2_fan_speed, | ||
170 | }; | ||
171 | |||
172 | static struct platform_device netspace_max_v2_gpio_fan = { | ||
173 | .name = "gpio-fan", | ||
174 | .id = -1, | ||
175 | .dev = { | ||
176 | .platform_data = &netspace_max_v2_fan_data, | ||
177 | }, | ||
178 | }; | ||
179 | |||
180 | /***************************************************************************** | ||
140 | * General Setup | 181 | * General Setup |
141 | ****************************************************************************/ | 182 | ****************************************************************************/ |
142 | 183 | ||
@@ -205,6 +246,8 @@ static void __init netspace_v2_init(void) | |||
205 | platform_device_register(&netspace_v2_leds); | 246 | platform_device_register(&netspace_v2_leds); |
206 | platform_device_register(&netspace_v2_gpio_leds); | 247 | platform_device_register(&netspace_v2_gpio_leds); |
207 | platform_device_register(&netspace_v2_gpio_buttons); | 248 | platform_device_register(&netspace_v2_gpio_buttons); |
249 | if (machine_is_netspace_max_v2()) | ||
250 | platform_device_register(&netspace_max_v2_gpio_fan); | ||
208 | 251 | ||
209 | if (gpio_request(NETSPACE_V2_GPIO_POWER_OFF, "power-off") == 0 && | 252 | if (gpio_request(NETSPACE_V2_GPIO_POWER_OFF, "power-off") == 0 && |
210 | gpio_direction_output(NETSPACE_V2_GPIO_POWER_OFF, 0) == 0) | 253 | gpio_direction_output(NETSPACE_V2_GPIO_POWER_OFF, 0) == 0) |