From patchwork Fri Sep 26 14:28:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 4984951 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A454C9F2BB for ; Fri, 26 Sep 2014 14:32:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 99A6B201FE for ; Fri, 26 Sep 2014 14:32:08 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BA7C7201ED for ; Fri, 26 Sep 2014 14:32:07 +0000 (UTC) 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 1XXWWp-0007PA-Ai; Fri, 26 Sep 2014 14:29:47 +0000 Received: from mail-wi0-x231.google.com ([2a00:1450:400c:c05::231]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XXWWm-0007F1-4p for linux-arm-kernel@lists.infradead.org; Fri, 26 Sep 2014 14:29:44 +0000 Received: by mail-wi0-f177.google.com with SMTP id q5so11712599wiv.10 for ; Fri, 26 Sep 2014 07:29:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=tnSFphS14L3k7v/LpiPgdVS62UwnuwgoBs7IEGkzrNU=; b=ttAZuWh2ze3u6X+mb2djU7DgCt74PTfibWlWoGv+/gs8Oj7rmOx3SEGDPaK77A36MB Fwgi11s1qbbxOJHaI+n175KREpSImogu3a4t5HnVUBm6pJBCimoo9nqIRoTxJ2QQevnt 1XdkSszpPi6AH5WU5yH/5SfW0NCDPhhVx2Lo7WO2A/C+WaFIL/J0XQs7RO21rq8TRiLn 0N0LzmAIkj8ZJxpDVUJzxtYL1b4I7hGuj4HgUTMXyoDuf1SDSZQvuqHJBNSJDen3/1pr oTCI3kcFGh4bxg+acIKakKHK7DLjR8yI0wO8AdN9nkeV92KcpAFJQqMPlO59Xxkj+IDV 2bww== X-Received: by 10.194.216.74 with SMTP id oo10mr3473190wjc.126.1411741761226; Fri, 26 Sep 2014 07:29:21 -0700 (PDT) Received: from linux-tdhb.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by mx.google.com with ESMTPSA id ka3sm6376074wjc.3.2014.09.26.07.29.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Sep 2014 07:29:20 -0700 (PDT) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: "John W. Linville" , linux-wireless@vger.kernel.org Subject: [PATCH] bcma: use device from DT (brcm,bus-gpio) for SoC GPIO chip Date: Fri, 26 Sep 2014 16:28:53 +0200 Message-Id: <1411741733-13888-1-git-send-email-zajec5@gmail.com> X-Mailer: git-send-email 1.8.4.5 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140926_072944_334959_504504C2 X-CRM114-Status: GOOD ( 10.11 ) X-Spam-Score: -0.6 (/) Cc: Hauke Mehrtens , =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , arnd@arndb.de, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This will allow us to define GPIO-attached devices (LEDs, buttons) in the the device tree. Signed-off-by: Rafa? Mi?ecki --- This is based on top of [PATCH v6] bcma: register bcma as device tree driver that I hope will reach wireless-next git tree. --- Documentation/devicetree/bindings/bus/bcma.txt | 15 +++++++++++++++ drivers/bcma/driver_gpio.c | 5 +++++ 2 files changed, 20 insertions(+) diff --git a/Documentation/devicetree/bindings/bus/bcma.txt b/Documentation/devicetree/bindings/bus/bcma.txt index e9070c1..f1b381e 100644 --- a/Documentation/devicetree/bindings/bus/bcma.txt +++ b/Documentation/devicetree/bindings/bus/bcma.txt @@ -6,6 +6,15 @@ Required properties: - reg : iomem address range of chipcommon core +The top-level axi bus may contain following children: + +- gpio: GPIO chip on the SoC + + Required properties: + - compatible: "brcm,bus-gpio" + - gpio-controller : makes the node a GPIO controller + - #gpio-cells : size of the GPIO specifier, must be 2 + The cores on the AXI bus are automatically detected by bcma with the memory ranges they are using and they get registered afterwards. @@ -17,4 +26,10 @@ Example: ranges = <0x00000000 0x18000000 0x00100000>; #address-cells = <1>; #size-cells = <1>; + + gpio@0 { + compatible = "brcm,bus-gpio"; + gpio-controller; + #gpio-cells = <2>; + }; }; diff --git a/drivers/bcma/driver_gpio.c b/drivers/bcma/driver_gpio.c index 8ea497c..7ae39a8 100644 --- a/drivers/bcma/driver_gpio.c +++ b/drivers/bcma/driver_gpio.c @@ -218,6 +218,11 @@ int bcma_gpio_init(struct bcma_drv_cc *cc) #if IS_BUILTIN(CONFIG_BCM47XX) chip->to_irq = bcma_gpio_to_irq; #endif +#if IS_BUILTIN(CONFIG_OF) + if (cc->core->bus->hosttype == BCMA_HOSTTYPE_SOC) + chip->of_node = of_find_compatible_node(NULL, NULL, + "brcm,bus-gpio"); +#endif switch (cc->core->bus->chipinfo.id) { case BCMA_CHIP_ID_BCM5357: case BCMA_CHIP_ID_BCM53572: