Skip to content

Commit 1b90e06

Browse files
lentinjJason Cooper
authored andcommitted
ARM: kirkwood: Use devicetree to define DNS-32[05] fan
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>
1 parent 55fb8b0 commit 1b90e06

File tree

2 files changed

+10
-26
lines changed

2 files changed

+10
-26
lines changed

arch/arm/boot/dts/kirkwood-dnskw.dtsi

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@
2525
};
2626
};
2727

28+
gpio_fan {
29+
/* Fan: ADDA AD045HB-G73 40mm 6000rpm@5v */
30+
compatible = "gpio-fan";
31+
gpios = <&gpio1 14 1
32+
&gpio1 13 1>;
33+
gpio-fan,speed-map = <0 0
34+
3000 1
35+
6000 2>;
36+
};
37+
2838
ocp@f1000000 {
2939
sata@80000 {
3040
status = "okay";

arch/arm/mach-kirkwood/board-dnskw.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include <linux/of.h>
2020
#include <linux/gpio.h>
2121
#include <linux/input.h>
22-
#include <linux/gpio-fan.h>
2322
#include <linux/leds.h>
2423
#include <asm/mach-types.h>
2524
#include <asm/mach/arch.h>
@@ -67,29 +66,6 @@ static unsigned int dnskw_mpp_config[] __initdata = {
6766
0
6867
};
6968

70-
/* Fan: ADDA AD045HB-G73 40mm 6000rpm@5v */
71-
static struct gpio_fan_speed dnskw_fan_speed[] = {
72-
{ 0, 0 },
73-
{ 3000, 1 },
74-
{ 6000, 2 },
75-
};
76-
static unsigned dnskw_fan_pins[] = {46, 45};
77-
78-
static struct gpio_fan_platform_data dnskw_fan_data = {
79-
.num_ctrl = ARRAY_SIZE(dnskw_fan_pins),
80-
.ctrl = dnskw_fan_pins,
81-
.num_speed = ARRAY_SIZE(dnskw_fan_speed),
82-
.speed = dnskw_fan_speed,
83-
};
84-
85-
static struct platform_device dnskw_fan_device = {
86-
.name = "gpio-fan",
87-
.id = -1,
88-
.dev = {
89-
.platform_data = &dnskw_fan_data,
90-
},
91-
};
92-
9369
static void dnskw_power_off(void)
9470
{
9571
gpio_set_value(36, 1);
@@ -114,8 +90,6 @@ void __init dnskw_init(void)
11490
kirkwood_ehci_init();
11591
kirkwood_ge00_init(&dnskw_ge00_data);
11692

117-
platform_device_register(&dnskw_fan_device);
118-
11993
/* Register power-off GPIO. */
12094
if (gpio_request(36, "dnskw:power:off") == 0
12195
&& gpio_direction_output(36, 0) == 0)

0 commit comments

Comments
 (0)