From patchwork Mon Sep 10 13:51:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jamie Lentin X-Patchwork-Id: 1432361 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 6EAD340220 for ; Mon, 10 Sep 2012 13:55:52 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TB4OI-0001y2-93; Mon, 10 Sep 2012 13:51:06 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TB4OE-0001x4-Ad for linux-arm-kernel@merlin.infradead.org; Mon, 10 Sep 2012 13:51:02 +0000 Received: from marmot.wormnet.eu ([2a03:9800:10:2d:3203:b3a5:8bdc:5b68]) by casper.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TB4OB-0003R2-Ed for linux-arm-kernel@lists.infradead.org; Mon, 10 Sep 2012 13:51:00 +0000 Received: from mijo.vandergast.wormnet.eu ([80.229.158.163] helo=bunsen.vandergast.wormnet.eu) by marmot.wormnet.eu with esmtpa (Exim 4.80) (envelope-from ) id 1TB4No-00071C-4B; Mon, 10 Sep 2012 14:50:36 +0100 From: Jamie Lentin To: Grant Likely , Rob Herring , Jean Delvare , Guenter Roeck , Jason Cooper , Andrew Lunn Subject: [PATCH V2 2/2] ARM: kirkwood: Use devicetree to define DNS-32[05] fan Date: Mon, 10 Sep 2012 14:51:52 +0100 Message-Id: <1347285112-13542-3-git-send-email-jm@lentin.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1347285112-13542-1-git-send-email-jm@lentin.co.uk> References: <1347035675-23907-1-git-send-email-jm@lentin.co.uk> <1347285112-13542-1-git-send-email-jm@lentin.co.uk> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20120910_145059_608545_F5A48B33 X-CRM114-Status: GOOD ( 12.47 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on casper.infradead.org summary: Content analysis details: (-1.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: devicetree-discuss@lists.ozlabs.org, Jamie Lentin , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 --- 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 #include #include -#include #include #include #include @@ -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)