From patchwork Fri Dec 28 14:08:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Lunn X-Patchwork-Id: 1915231 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 1EA7840061 for ; Fri, 28 Dec 2012 14:12:51 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Toacc-0001ib-QM; Fri, 28 Dec 2012 14:09:14 +0000 Received: from londo.lunn.ch ([80.238.139.98]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1ToacW-0001i4-De for linux-arm-kernel@lists.infradead.org; Fri, 28 Dec 2012 14:09:10 +0000 Received: from lunn by londo.lunn.ch with local (Exim 3.36 #1 (Debian)) id 1ToacO-0001IH-00; Fri, 28 Dec 2012 15:09:00 +0100 From: Andrew Lunn To: Jason Cooper , linux ARM , tero.jaasko@gmail.com Subject: [PATCH 2/3] ARM: Kirkwood: Convert NSA310 to use gpio-poweroff driver Date: Fri, 28 Dec 2012 15:08:49 +0100 Message-Id: <1356703730-4926-3-git-send-email-andrew@lunn.ch> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1356703730-4926-1-git-send-email-andrew@lunn.ch> References: <1356703730-4926-1-git-send-email-andrew@lunn.ch> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121228_090908_877318_0F8D914C X-CRM114-Status: GOOD ( 13.66 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Andrew Lunn 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 the C code and add a Device Tree node for gpio-poweroff. Signed-off-by: Andrew Lunn --- arch/arm/boot/dts/kirkwood-nsa310.dts | 5 +++++ arch/arm/mach-kirkwood/board-nsa310.c | 33 --------------------------------- 2 files changed, 5 insertions(+), 33 deletions(-) diff --git a/arch/arm/boot/dts/kirkwood-nsa310.dts b/arch/arm/boot/dts/kirkwood-nsa310.dts index 2dc1d09..85cce36 100644 --- a/arch/arm/boot/dts/kirkwood-nsa310.dts +++ b/arch/arm/boot/dts/kirkwood-nsa310.dts @@ -142,6 +142,11 @@ }; }; + gpio_poweroff { + compatible = "gpio-poweroff"; + gpios = <&gpio1 16 0>; + }; + regulators { compatible = "simple-bus"; #address-cells = <1>; diff --git a/arch/arm/mach-kirkwood/board-nsa310.c b/arch/arm/mach-kirkwood/board-nsa310.c index d04184d..7a56273 100644 --- a/arch/arm/mach-kirkwood/board-nsa310.c +++ b/arch/arm/mach-kirkwood/board-nsa310.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include @@ -19,8 +18,6 @@ #include "common.h" #include "mpp.h" -#define NSA310_GPIO_POWER_OFF 48 - static unsigned int nsa310_mpp_config[] __initdata = { MPP12_GPIO, /* led esata green */ MPP13_GPIO, /* led esata red */ @@ -45,42 +42,12 @@ static struct i2c_board_info __initdata nsa310_i2c_info[] = { { I2C_BOARD_INFO("adt7476", 0x2e) }, }; -static void nsa310_power_off(void) -{ - gpio_set_value(NSA310_GPIO_POWER_OFF, 1); -} - -static int __init nsa310_gpio_request(unsigned int gpio, unsigned long flags, - const char *label) -{ - int err; - - err = gpio_request_one(gpio, flags, label); - if (err) - pr_err("NSA-310: can't setup GPIO%u (%s), err=%d\n", - gpio, label, err); - - return err; -} - -static void __init nsa310_gpio_init(void) -{ - int err; - - err = nsa310_gpio_request(NSA310_GPIO_POWER_OFF, GPIOF_OUT_INIT_LOW, - "Power Off"); - if (!err) - pm_power_off = nsa310_power_off; -} - void __init nsa310_init(void) { u32 dev, rev; kirkwood_mpp_conf(nsa310_mpp_config); - nsa310_gpio_init(); - kirkwood_pcie_id(&dev, &rev); i2c_register_board_info(0, ARRAY_AND_SIZE(nsa310_i2c_info));