From patchwork Wed Jan 31 02:36:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 10193079 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 008B960383 for ; Wed, 31 Jan 2018 02:37:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E373327C0B for ; Wed, 31 Jan 2018 02:37:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D46CD283F2; Wed, 31 Jan 2018 02:37:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7432D27C0B for ; Wed, 31 Jan 2018 02:37:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=HPuPhf1jbOb7DHgdNN81cL4Y45X0a+HnYDch20cGqdQ=; b=UYANrP65G0cPWc80KsdHez6r3k n76CpcO/C+m1tTAknCC/pSBH/pXdfhMSIyfFzhMtF8alCqzkCbAPlHhCw6IbLkQkOHWo5kocnBxcW fUS8GGRuYSbZNe7K4PMO/Eil7C2ic36ifRX9htGZSGjF20mjhDTK5BKZ/BszBzqg5I1/PM3mw+Sm9 Eqz/88NY3JakGWzPvItNZnS/H4Shed8I888wfRN15qqC/dj1/+zLM/KyCIl2W6llooIM8PHeJjq8+ L17FxatMSQ02GNUzGvv29Sq2TIHDvdiYUXUr2pkPC3C+timb912kJQ18PKORJsmaLi3E8Z1sEBoDF YtUgL9Mw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1egiHD-0003No-6g; Wed, 31 Jan 2018 02:37:31 +0000 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1egiGT-0002VY-7F for linux-arm-kernel@lists.infradead.org; Wed, 31 Jan 2018 02:36:48 +0000 Received: by mail-pf0-x244.google.com with SMTP id i66so11089149pfd.7 for ; Tue, 30 Jan 2018 18:36:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xo1pIR1xvBvDy/Pi7Idp95Txk3h0Vvmdq3pnieCBYpI=; b=bKFCnZal/oAqamBCP0C2MwVt66KKRCliQ9Iv0/elfCkdMPue+xMBjNOrOctj4RDwni 9zwr5qmtooLQIJgNi7ejdkcDLijAB1VCe0X0SfHXJHk/6FeexYsWvh01cTxASFv6mwTy LL6tP1RCw9+KO+9KKKGdXJQ2FOe28QNft4oQk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=xo1pIR1xvBvDy/Pi7Idp95Txk3h0Vvmdq3pnieCBYpI=; b=I7YJK3HhcM2XZ3H+YzLcCVoiKZ0EInp4dF2v7PtXLONIARqriPfsDcph1cOG3EG96c RxzBh+5cQDD8+qwZ7doTXF4h1iGALpOng2l5EKkzZOq5bF5DBAPGqZfFk0MkTdpIaKRB c4yn6The8PeEJuTCM2koPlexLbznztRv9Cn1Ydr1e9gJrHJrVyfLs5S5NttxDNIqOWLE VvbScz+uWEDOg2td40WnS5uVBx4KNAvtW/aKz0kpQm9qeEikFDEWQJj7LwscFwDBVMwP pYYOir3oEKHp0ZxUjorJEbcsGqS/s8CInZ5p0/B7ZHWnJfPsmJjF+qTLlhPxuAQ3kwYO tuHg== X-Gm-Message-State: AKwxytesNxXFDJRDqUE5vHMgtCXU0JnIsgueBHFUDCsKqbk74fxxMW5b WiCk8KjU3A9/GBpXy1emUA3Ukw== X-Google-Smtp-Source: AH8x2244b9bBt4BF/WfErbm7j7SvSmySw8gH6Ix+DlpOdsW4xgzSyJuIvYvLzVBRHJkh38KljVHY5w== X-Received: by 2002:a17:902:42a5:: with SMTP id h34-v6mr26274614pld.265.1517366194486; Tue, 30 Jan 2018 18:36:34 -0800 (PST) Received: from localhost.localdomain (pat_11.qualcomm.com. [192.35.156.11]) by smtp.gmail.com with ESMTPSA id z2sm24126828pgz.22.2018.01.30.18.36.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 30 Jan 2018 18:36:34 -0800 (PST) From: Stephen Boyd To: Rob Herring , Frank Rowand Subject: [PATCH v5 4/4] gpio: Support gpio nexus dt bindings Date: Tue, 30 Jan 2018 18:36:18 -0800 Message-Id: <20180131023618.14292-5-stephen.boyd@linaro.org> X-Mailer: git-send-email 2.14.GIT In-Reply-To: <20180131023618.14292-1-stephen.boyd@linaro.org> References: <20180131023618.14292-1-stephen.boyd@linaro.org> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, devicetree-spec@vger.kernel.org, Pantelis Antoniou , linux-kernel@vger.kernel.org, Russell King - ARM Linux , Mark Brown , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Platforms like 96boards have a standardized connector/expansion slot that exposes signals like GPIOs to expansion boards in an SoC agnostic way. We'd like the DT overlays for the expansion boards to be written once without knowledge of the SoC on the other side of the connector. This avoids the unscalable combinatorial explosion of a different DT overlay for each expansion board and SoC pair. Now that we have nexus support in the OF core let's change the function call here that parses the phandle lists of gpios to use the nexus variant. This allows us to remap phandles and their arguments through any number of nexus nodes and end up with the actual gpio provider being used. Cc: Pantelis Antoniou Acked-by: Linus Walleij Cc: Mark Brown Signed-off-by: Stephen Boyd --- drivers/gpio/gpiolib-of.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index 72a0695d2ac3..09217a87e7ff 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c @@ -75,8 +75,8 @@ struct gpio_desc *of_get_named_gpiod_flags(struct device_node *np, struct gpio_desc *desc; int ret; - ret = of_parse_phandle_with_args(np, propname, "#gpio-cells", index, - &gpiospec); + ret = of_parse_phandle_with_args_map(np, propname, "gpio", index, + &gpiospec); if (ret) { pr_debug("%s: can't parse '%s' property of node '%pOF[%d]'\n", __func__, propname, np, index);