linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: simon@sequanux.org (Simon Guinot)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] [ARM] Kirkwood: add fan support for Network Space Max v2
Date: Sun, 17 Oct 2010 17:50:12 +0200	[thread overview]
Message-ID: <1287330612-11256-2-git-send-email-simon@sequanux.org> (raw)
In-Reply-To: <1287330612-11256-1-git-send-email-simon@sequanux.org>

From: Simon Guinot <sguinot@lacie.com>

Signed-off-by: Simon Guinot <sguinot@lacie.com>
---
 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 fed264d..8e14147 100644
--- a/arch/arm/mach-kirkwood/netspace_v2-setup.c
+++ b/arch/arm/mach-kirkwood/netspace_v2-setup.c
@@ -30,6 +30,7 @@
 #include <linux/gpio.h>
 #include <linux/gpio_keys.h>
 #include <linux/leds.h>
+#include <linux/gpio-fan.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <mach/kirkwood.h>
@@ -137,6 +138,46 @@ static struct platform_device netspace_v2_leds = {
 };
 
 /*****************************************************************************
+ * GPIO fan
+ ****************************************************************************/
+
+/* Designed for fan 40x40x16: ADDA AD0412LB-D50 6000rpm at 12v */
+static struct gpio_fan_speed netspace_max_v2_fan_speed[] = {
+	{    0,  0 },
+	{ 1500,	15 },
+	{ 1700,	14 },
+	{ 1800,	13 },
+	{ 2100,	12 },
+	{ 3100,	11 },
+	{ 3300,	10 },
+	{ 4300,	 9 },
+	{ 5500,	 8 },
+};
+
+static unsigned netspace_max_v2_fan_ctrl[] = { 22, 7, 33, 23 };
+
+static struct gpio_fan_alarm netspace_max_v2_fan_alarm = {
+	.gpio		= 25,
+	.active_low	= 1,
+};
+
+static struct gpio_fan_platform_data netspace_max_v2_fan_data = {
+	.num_ctrl	= ARRAY_SIZE(netspace_max_v2_fan_ctrl),
+	.ctrl		= netspace_max_v2_fan_ctrl,
+	.alarm		= &netspace_max_v2_fan_alarm,
+	.num_speed	= ARRAY_SIZE(netspace_max_v2_fan_speed),
+	.speed		= netspace_max_v2_fan_speed,
+};
+
+static struct platform_device netspace_max_v2_gpio_fan = {
+	.name	= "gpio-fan",
+	.id	= -1,
+	.dev	= {
+		.platform_data	= &netspace_max_v2_fan_data,
+	},
+};
+
+/*****************************************************************************
  * General Setup
  ****************************************************************************/
 
@@ -205,6 +246,8 @@ static void __init netspace_v2_init(void)
 	platform_device_register(&netspace_v2_leds);
 	platform_device_register(&netspace_v2_gpio_leds);
 	platform_device_register(&netspace_v2_gpio_buttons);
+	if (machine_is_netspace_max_v2())
+		platform_device_register(&netspace_max_v2_gpio_fan);
 
 	if (gpio_request(NETSPACE_V2_GPIO_POWER_OFF, "power-off") == 0 &&
 	    gpio_direction_output(NETSPACE_V2_GPIO_POWER_OFF, 0) == 0)
-- 
1.6.3.1

  reply	other threads:[~2010-10-17 15:50 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-22 10:54 [PATCH 4/5] hwmon: DNS323 rev C1 fan support Benjamin Herrenschmidt
2010-05-22 11:00 ` Benjamin Herrenschmidt
2010-10-13 11:59 ` Simon Guinot
2010-10-13 16:34   ` [lm-sensors] " Guenter Roeck
2010-10-17 15:40     ` Simon Guinot
2010-10-17 15:50       ` [PATCH 1/2] hwmon: add generic GPIO fan driver Simon Guinot
2010-10-17 15:50         ` Simon Guinot [this message]
2010-10-22  1:53           ` [PATCH 2/2] [ARM] Kirkwood: add fan support for Network Space Max v2 Guenter Roeck
2010-10-22  2:08             ` Nicolas Pitre
2010-10-22  4:30               ` Guenter Roeck
2010-10-22  9:29                 ` [PATCH] " Simon Guinot
2010-10-22  9:59                   ` Guenter Roeck
2010-10-22  8:27               ` [PATCH 2/2] " Simon Guinot
2010-10-22  9:58                 ` Guenter Roeck
2010-10-22 18:39                 ` Guenter Roeck
2010-10-22 18:50                   ` Nicolas Pitre
2010-10-18 16:08         ` [PATCH 1/2] hwmon: add generic GPIO fan driver Guenter Roeck
2010-10-18 18:00           ` Chris Moore
2010-10-18 18:35             ` Guenter Roeck
2010-10-18 20:36           ` Simon Guinot
2010-10-18 20:50             ` Guenter Roeck
2010-10-19 11:46               ` Simon Guinot
2010-10-19 14:52                 ` Guenter Roeck
2010-10-19  6:52             ` Guenter Roeck
2010-10-19  8:36               ` Simon Guinot
2010-10-19 15:15                 ` Guenter Roeck
2010-10-19 19:30                   ` Simon Guinot
2010-10-21 20:07           ` Simon Guinot
2010-10-21 20:26             ` Guenter Roeck
2010-10-19 22:03         ` Guenter Roeck
2010-10-20  0:19           ` Simon Guinot
2010-10-20  0:50             ` Guenter Roeck
2010-10-20  7:59               ` Simon Guinot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1287330612-11256-2-git-send-email-simon@sequanux.org \
    --to=simon@sequanux.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).