]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ARM: kirkwood: Use devicetree to define DNS-32[05] fan
authorJamie Lentin <jm@lentin.co.uk>
Mon, 10 Sep 2012 13:51:52 +0000 (14:51 +0100)
committerJason Cooper <jason@lakedaemon.net>
Sat, 22 Sep 2012 14:40:58 +0000 (14:40 +0000)
Remove more board-specific code by using devicetree to define the fan
attached to both boards.

Signed-off-by: Jamie Lentin <jm@lentin.co.uk>
Acked-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
arch/arm/boot/dts/kirkwood-dnskw.dtsi
arch/arm/mach-kirkwood/board-dnskw.c

index 7408655f91b500cc5f4a4fc283c6bb30c7c43eac..9b32d0272825fcb172c0ef720c30f74c4202e0f5 100644 (file)
@@ -25,6 +25,16 @@ button@3 {
                };
        };
 
+       gpio_fan {
+               /* Fan: ADDA AD045HB-G73 40mm 6000rpm@5v */
+               compatible = "gpio-fan";
+               gpios = <&gpio1 14 1
+                        &gpio1 13 1>;
+               gpio-fan,speed-map = <0    0
+                                     3000 1
+                                     6000 2>;
+       };
+
        ocp@f1000000 {
                sata@80000 {
                        status = "okay";
index 4ab35065a144919ac264bd972f125dbf657120de..6ac7a8dc7b78ff0651e45c5c9873976b9b326812 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/of.h>
 #include <linux/gpio.h>
 #include <linux/input.h>
-#include <linux/gpio-fan.h>
 #include <linux/leds.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -67,29 +66,6 @@ static unsigned int dnskw_mpp_config[] __initdata = {
        0
 };
 
-/* Fan: ADDA AD045HB-G73 40mm 6000rpm@5v */
-static struct gpio_fan_speed dnskw_fan_speed[] = {
-       {    0,  0 },
-       { 3000,  1 },
-       { 6000,  2 },
-};
-static unsigned dnskw_fan_pins[] = {46, 45};
-
-static struct gpio_fan_platform_data dnskw_fan_data = {
-       .num_ctrl       = ARRAY_SIZE(dnskw_fan_pins),
-       .ctrl           = dnskw_fan_pins,
-       .num_speed      = ARRAY_SIZE(dnskw_fan_speed),
-       .speed          = dnskw_fan_speed,
-};
-
-static struct platform_device dnskw_fan_device = {
-       .name   = "gpio-fan",
-       .id     = -1,
-       .dev    = {
-               .platform_data  = &dnskw_fan_data,
-       },
-};
-
 static void dnskw_power_off(void)
 {
        gpio_set_value(36, 1);
@@ -114,8 +90,6 @@ void __init dnskw_init(void)
        kirkwood_ehci_init();
        kirkwood_ge00_init(&dnskw_ge00_data);
 
-       platform_device_register(&dnskw_fan_device);
-
        /* Register power-off GPIO. */
        if (gpio_request(36, "dnskw:power:off") == 0
            && gpio_direction_output(36, 0) == 0)