devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jamie Lentin <jm-Pj/HzkgeCk7QXOPxS62xeg@public.gmane.org>
To: Grant Likely
	<grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>,
	Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>,
	Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>,
	Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>,
	Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>,
	Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	Jamie Lentin <jm-Pj/HzkgeCk7QXOPxS62xeg@public.gmane.org>,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: [PATCH V2 2/2] ARM: kirkwood: Use devicetree to define DNS-32[05] fan
Date: Mon, 10 Sep 2012 14:51:52 +0100	[thread overview]
Message-ID: <1347285112-13542-3-git-send-email-jm@lentin.co.uk> (raw)
In-Reply-To: <1347285112-13542-1-git-send-email-jm-Pj/HzkgeCk7QXOPxS62xeg@public.gmane.org>

Remove more board-specific code by using devicetree to define the fan
attached to both boards.

Changes since V1:-
* Remove now-useless gpio-fan.h [Andrew Lunn]

Signed-off-by: Jamie Lentin <jm-Pj/HzkgeCk7QXOPxS62xeg@public.gmane.org>
---
 arch/arm/boot/dts/kirkwood-dnskw.dtsi |   10 ++++++++++
 arch/arm/mach-kirkwood/board-dnskw.c  |   26 --------------------------
 2 files changed, 10 insertions(+), 26 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-dnskw.dtsi b/arch/arm/boot/dts/kirkwood-dnskw.dtsi
index 7408655..9b32d02 100644
--- a/arch/arm/boot/dts/kirkwood-dnskw.dtsi
+++ b/arch/arm/boot/dts/kirkwood-dnskw.dtsi
@@ -25,6 +25,16 @@
 		};
 	};
 
+	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";
diff --git a/arch/arm/mach-kirkwood/board-dnskw.c b/arch/arm/mach-kirkwood/board-dnskw.c
index 4ab3506..6ac7a8d 100644
--- a/arch/arm/mach-kirkwood/board-dnskw.c
+++ b/arch/arm/mach-kirkwood/board-dnskw.c
@@ -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)
-- 
1.7.10.4

      parent reply	other threads:[~2012-09-10 13:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-07 16:34 [PATCH 0/2] hwmon: kirkwood: Add DT bindings to gpio-fan for DNS-32[05] Jamie Lentin
2012-09-07 16:34 ` [PATCH 1/2] hwmon: Add devicetree bindings to gpio-fan Jamie Lentin
2012-09-07 18:36   ` Guenter Roeck
     [not found]   ` <1347035675-23907-2-git-send-email-jm-Pj/HzkgeCk7QXOPxS62xeg@public.gmane.org>
2012-09-08  7:32     ` Andrew Lunn
2012-09-07 16:34 ` [PATCH 2/2] ARM: kirkwood: Use devicetree to define DNS-32[05] fan Jamie Lentin
     [not found]   ` <1347035675-23907-3-git-send-email-jm-Pj/HzkgeCk7QXOPxS62xeg@public.gmane.org>
2012-09-07 21:23     ` Andrew Lunn
     [not found] ` <1347035675-23907-1-git-send-email-jm-Pj/HzkgeCk7QXOPxS62xeg@public.gmane.org>
2012-09-10 13:51   ` [PATCH V2 0/2] hwmon: kirkwood: Add DT bindings to gpio-fan for DNS-32[05] Jamie Lentin
     [not found]     ` <1347285112-13542-1-git-send-email-jm-Pj/HzkgeCk7QXOPxS62xeg@public.gmane.org>
2012-09-10 13:51       ` [PATCH V2 1/2] hwmon: Add devicetree bindings to gpio-fan Jamie Lentin
     [not found]         ` <1347285112-13542-2-git-send-email-jm-Pj/HzkgeCk7QXOPxS62xeg@public.gmane.org>
2012-09-10 15:28           ` Andrew Lunn
     [not found]             ` <20120910152814.GA6050-g2DYL2Zd6BY@public.gmane.org>
2012-09-10 16:04               ` Jamie Lentin
     [not found]                 ` <alpine.DEB.2.00.1209101656120.10589-5X291BYdrx55rAo4AelP/Ydd74u8MsAO@public.gmane.org>
2012-09-10 18:15                   ` Jason Cooper
2012-09-10 18:49         ` Guenter Roeck
     [not found]           ` <20120910184919.GA30872-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2012-09-14 16:07             ` [PATCH V3 " Jamie Lentin
2012-09-15  2:28               ` Guenter Roeck
     [not found]                 ` <20120915022833.GA20375-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2012-09-15  3:16                   ` Jason Cooper
2012-09-10 13:51       ` Jamie Lentin [this message]

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=1347285112-13542-3-git-send-email-jm@lentin.co.uk \
    --to=jm-pj/hzkgeck7qxopxs62xeg@public.gmane.org \
    --cc=andrew-g2DYL2Zd6BY@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
    --cc=jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org \
    --cc=khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org \
    --cc=linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.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).