From patchwork Sun Aug 2 21:55:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 51806 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by patches.linaro.org (Postfix) with ESMTPS id 0F7FC229FD for ; Sun, 2 Aug 2015 21:58:22 +0000 (UTC) Received: by wicmv11 with SMTP id mv11sf23154777wic.1 for ; Sun, 02 Aug 2015 14:58:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:cc:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list; bh=+r5lDioltFr/pL4f8tl0IBrbNcjCJgm340lhjb53AUg=; b=UoniAGpZNw02QYVOp1aAL+oygNSLulu3kr2pLGNwkEChE4O0GfxXnLVIXwW1eGNFVf gMVb+iRbR0vHdok94Kz7nWR/sDwNcF8WLzd8O2vV/JGxyUO3rhkjVPkX6cEQpNJjDOF4 5lZ1jOmh4wsE5y1ZxMdDcX15IVSeYCPz2NkOBZUNNwrRtLWvEfy56PrQi7Dp5W0cekJt BhkFliu0Z+g2WPDT/XSlzSv9osYeoQq2d56Q/5OycGbUP+oGb4kfGszlIYpATQP04OKx MLJiry9gXvq0j0glRZ9k9p0tu195BQelUYI8qimlaNIJrUqV/xzB5nyySq/ssJ5Hx8cy EQTA== X-Gm-Message-State: ALoCoQnjil3SyTO/+gef7Q6VjTmdUv40ltKmjc6iNOmMC72vRMHWdnKnV32pMaeXUgsK9lEiuwuE X-Received: by 10.194.19.33 with SMTP id b1mr1824146wje.6.1438552701240; Sun, 02 Aug 2015 14:58:21 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.204 with SMTP id ba12ls204559lab.62.gmail; Sun, 02 Aug 2015 14:58:20 -0700 (PDT) X-Received: by 10.112.168.102 with SMTP id zv6mr13917910lbb.45.1438552700943; Sun, 02 Aug 2015 14:58:20 -0700 (PDT) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id d7si10298793lag.88.2015.08.02.14.58.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Aug 2015 14:58:20 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by labgo9 with SMTP id go9so16032803lab.3 for ; Sun, 02 Aug 2015 14:58:20 -0700 (PDT) X-Received: by 10.112.126.101 with SMTP id mx5mr14068434lbb.35.1438552700853; Sun, 02 Aug 2015 14:58:20 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.7.198 with SMTP id l6csp1548161lba; Sun, 2 Aug 2015 14:58:19 -0700 (PDT) X-Received: by 10.70.133.42 with SMTP id oz10mr29658697pdb.85.1438552695681; Sun, 02 Aug 2015 14:58:15 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id jt12si9484128pbb.8.2015.08.02.14.58.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Aug 2015 14:58:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZM1FM-0001WY-8H; Sun, 02 Aug 2015 21:56:44 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZM1FJ-0001W7-FL for linux-arm-kernel@bombadil.infradead.org; Sun, 02 Aug 2015 21:56:41 +0000 Received: from mail-la0-f49.google.com ([209.85.215.49]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZM1FG-00054y-3T for linux-arm-kernel@lists.infradead.org; Sun, 02 Aug 2015 21:56:39 +0000 Received: by labpt2 with SMTP id pt2so4072526lab.0 for ; Sun, 02 Aug 2015 14:56:12 -0700 (PDT) X-Received: by 10.112.157.36 with SMTP id wj4mr13798967lbb.115.1438552572545; Sun, 02 Aug 2015 14:56:12 -0700 (PDT) Received: from localhost.localdomain.localdomain (c-297471d5.01-192-6c756e10.cust.bredbandsbolaget.se. [213.113.116.41]) by smtp.gmail.com with ESMTPSA id df8sm2564234lac.3.2015.08.02.14.56.09 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Aug 2015 14:56:11 -0700 (PDT) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/4] ARM: nomadik: move hog code to use DT hogs Date: Sun, 2 Aug 2015 23:55:51 +0200 Message-Id: <1438552551-4480-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150802_225638_208610_63044455 X-CRM114-Status: GOOD ( 18.37 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.0 on casper.infradead.org summary: Content analysis details: (-2.6 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.215.49 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.215.49 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Cc: Linus Walleij MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Instead of introducing a board-specific DT node for biasing the MMC/SD and SATA ports, use the new device tree hogs. Signed-off-by: Linus Walleij --- arch/arm/boot/dts/ste-nomadik-nhk15.dts | 18 +++++++++-------- arch/arm/boot/dts/ste-nomadik-s8815.dts | 18 +++++++++-------- arch/arm/mach-nomadik/cpu-8815.c | 36 --------------------------------- 3 files changed, 20 insertions(+), 52 deletions(-) diff --git a/arch/arm/boot/dts/ste-nomadik-nhk15.dts b/arch/arm/boot/dts/ste-nomadik-nhk15.dts index 3d25dba143a5..0e167ed2857b 100644 --- a/arch/arm/boot/dts/ste-nomadik-nhk15.dts +++ b/arch/arm/boot/dts/ste-nomadik-nhk15.dts @@ -131,6 +131,16 @@ #gpio-cells = <2>; interrupt-controller; #interrupt-cells = <2>; + /* + * This will turn off SATA so that MMC/SD + * can thrive + */ + mmcsd-gpio { + gpio-hog; + gpios = <2 0x0>; + output-low; + line-name = "SATA EN"; + }; }; }; }; @@ -141,12 +151,4 @@ wp-gpios = <&stmpe_gpio44 18 GPIO_ACTIVE_HIGH>; }; }; - - /* Custom board node with GPIO pins to active etc */ - usb-s8815 { - /* This will turn off SATA so that MMC/SD can thrive */ - mmcsd-gpio { - gpios = <&stmpe_gpio44 2 0x1>; - }; - }; }; diff --git a/arch/arm/boot/dts/ste-nomadik-s8815.dts b/arch/arm/boot/dts/ste-nomadik-s8815.dts index 3c140d05f796..edcfe2413ee7 100644 --- a/arch/arm/boot/dts/ste-nomadik-s8815.dts +++ b/arch/arm/boot/dts/ste-nomadik-s8815.dts @@ -19,6 +19,16 @@ serial1 = &uart1; }; + gpio3: gpio@101e7000 { + /* This hog will bias the MMC/SD card detect line */ + mmcsd-gpio { + gpio-hog; + gpios = <16 0x0>; + output-low; + line-name = "card detect bias"; + }; + }; + src@101e0000 { /* These chrystal drivers are not used on this board */ disable-sxtalo; @@ -109,14 +119,6 @@ }; }; - /* Custom board node with GPIO pins to active etc */ - usb-s8815 { - /* This will bias the MMC/SD card detect line */ - mmcsd-gpio { - gpios = <&gpio3 16 0x1>; - }; - }; - /* The user LED on the board is set up to be used for heartbeat */ leds { compatible = "gpio-leds"; diff --git a/arch/arm/mach-nomadik/cpu-8815.c b/arch/arm/mach-nomadik/cpu-8815.c index 9bda46f1fab7..82831dc6122f 100644 --- a/arch/arm/mach-nomadik/cpu-8815.c +++ b/arch/arm/mach-nomadik/cpu-8815.c @@ -26,10 +26,8 @@ #include #include #include -#include #include #include -#include #include #include @@ -109,40 +107,6 @@ static void cpu8815_restart(enum reboot_mode mode, const char *cmd) writel(1, srcbase + 0x18); } -/* - * This GPIO pin turns on a line that is used to detect card insertion - * on this board. - */ -static int __init cpu8815_mmcsd_init(void) -{ - struct device_node *cdbias; - int gpio, err; - - cdbias = of_find_node_by_path("/usb-s8815/mmcsd-gpio"); - if (!cdbias) { - pr_info("could not find MMC/SD card detect bias node\n"); - return 0; - } - gpio = of_get_gpio(cdbias, 0); - if (gpio < 0) { - pr_info("could not obtain MMC/SD card detect bias GPIO\n"); - return 0; - } - err = gpio_request(gpio, "card detect bias"); - if (err) { - pr_info("failed to request card detect bias GPIO %d\n", gpio); - return -ENODEV; - } - err = gpio_direction_output(gpio, 0); - if (err){ - pr_info("failed to set GPIO %d as output, low\n", gpio); - return err; - } - pr_info("enabled USB-S8815 CD bias GPIO %d, low\n", gpio); - return 0; -} -device_initcall(cpu8815_mmcsd_init); - static const char * cpu8815_board_compat[] = { "st,nomadik-nhk-15", "calaosystems,usb-s8815",