aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Walle <michael@walle.cc>2012-10-20 19:34:54 -0400
committerJason Cooper <jason@lakedaemon.net>2012-11-21 15:59:05 -0500
commitb046f560d76a22589a849964145e4e60d7a160d2 (patch)
treeeb5da9ec7e302ab478521b41120047768ad90a44
parent1136b9d124bea6d978be66337b5786e6df825a6e (diff)
ARM: kirkwood: use gpio-fan DT binding on lsxl
Remove board specific gpio-fan driver registration. Moved into device tree. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
-rw-r--r--arch/arm/boot/dts/kirkwood-lsxl.dtsi11
-rw-r--r--arch/arm/mach-kirkwood/board-lsxl.c51
2 files changed, 11 insertions, 51 deletions
diff --git a/arch/arm/boot/dts/kirkwood-lsxl.dtsi b/arch/arm/boot/dts/kirkwood-lsxl.dtsi
index 8fea375c734d..798e60eeedf3 100644
--- a/arch/arm/boot/dts/kirkwood-lsxl.dtsi
+++ b/arch/arm/boot/dts/kirkwood-lsxl.dtsi
@@ -94,4 +94,15 @@
94 gpios = <&gpio1 16 1>; 94 gpios = <&gpio1 16 1>;
95 }; 95 };
96 }; 96 };
97
98 gpio_fan {
99 compatible = "gpio-fan";
100 gpios = <&gpio0 19 1
101 &gpio0 18 1>;
102 gpio-fan,speed-map = <0 3
103 1500 2
104 3250 1
105 5000 0>;
106 alarm-gpios = <&gpio1 8 0>;
107 };
97}; 108};
diff --git a/arch/arm/mach-kirkwood/board-lsxl.c b/arch/arm/mach-kirkwood/board-lsxl.c
index 83d8975592f8..a29b8bff103d 100644
--- a/arch/arm/mach-kirkwood/board-lsxl.c
+++ b/arch/arm/mach-kirkwood/board-lsxl.c
@@ -20,11 +20,6 @@
20#include <linux/spi/spi.h> 20#include <linux/spi/spi.h>
21#include <linux/mv643xx_eth.h> 21#include <linux/mv643xx_eth.h>
22#include <linux/gpio.h> 22#include <linux/gpio.h>
23#include <linux/gpio-fan.h>
24#include <linux/input.h>
25#include <asm/mach-types.h>
26#include <asm/mach/arch.h>
27#include <mach/kirkwood.h>
28#include "common.h" 23#include "common.h"
29#include "mpp.h" 24#include "mpp.h"
30 25
@@ -53,51 +48,6 @@ static unsigned int lsxl_mpp_config[] __initdata = {
53 0 48 0
54}; 49};
55 50
56#define LSXL_GPIO_FAN_HIGH 18
57#define LSXL_GPIO_FAN_LOW 19
58#define LSXL_GPIO_FAN_LOCK 40
59
60static struct gpio_fan_alarm lsxl_alarm = {
61 .gpio = LSXL_GPIO_FAN_LOCK,
62};
63
64static struct gpio_fan_speed lsxl_speeds[] = {
65 {
66 .rpm = 0,
67 .ctrl_val = 3,
68 }, {
69 .rpm = 1500,
70 .ctrl_val = 1,
71 }, {
72 .rpm = 3250,
73 .ctrl_val = 2,
74 }, {
75 .rpm = 5000,
76 .ctrl_val = 0,
77 }
78};
79
80static int lsxl_gpio_list[] = {
81 LSXL_GPIO_FAN_HIGH, LSXL_GPIO_FAN_LOW,
82};
83
84static struct gpio_fan_platform_data lsxl_fan_data = {
85 .num_ctrl = ARRAY_SIZE(lsxl_gpio_list),
86 .ctrl = lsxl_gpio_list,
87 .alarm = &lsxl_alarm,
88 .num_speed = ARRAY_SIZE(lsxl_speeds),
89 .speed = lsxl_speeds,
90};
91
92static struct platform_device lsxl_fan_device = {
93 .name = "gpio-fan",
94 .id = -1,
95 .num_resources = 0,
96 .dev = {
97 .platform_data = &lsxl_fan_data,
98 },
99};
100
101/* 51/*
102 * On the LS-XHL/LS-CHLv2, the shutdown process is following: 52 * On the LS-XHL/LS-CHLv2, the shutdown process is following:
103 * - Userland monitors key events until the power switch goes to off position 53 * - Userland monitors key events until the power switch goes to off position
@@ -128,7 +78,6 @@ void __init lsxl_init(void)
128 kirkwood_ehci_init(); 78 kirkwood_ehci_init();
129 kirkwood_ge00_init(&lsxl_ge00_data); 79 kirkwood_ge00_init(&lsxl_ge00_data);
130 kirkwood_ge01_init(&lsxl_ge01_data); 80 kirkwood_ge01_init(&lsxl_ge01_data);
131 platform_device_register(&lsxl_fan_device);
132 81
133 /* register power-off method */ 82 /* register power-off method */
134 pm_power_off = lsxl_power_off; 83 pm_power_off = lsxl_power_off;