From patchwork Thu Oct 5 20:54:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 9987965 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 9BB6C60247 for ; Thu, 5 Oct 2017 20:55:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8CF4628D3B for ; Thu, 5 Oct 2017 20:55:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 81AFB28D42; Thu, 5 Oct 2017 20:55:31 +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=unavailable 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 0F14A28D3B for ; Thu, 5 Oct 2017 20:55:31 +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=/dyqrat8zDc/4/1WUmhOOXFzS1lgyZFtWu3nXoqg+GQ=; b=dZWCpItSDw/i74m6GBXDsD04nm qLQ8TrwujhCIX4kvlPh29b1OEAnFE/uyL4huz7tXVeHjGqTLS6OVTqaLdRivw8dWfbfKoqy8Yh+YY p5aUtE0CuW3kuJcvm6Pb3v82GCJ5TBvYrzIbFq1xFEOO6eJS/xLvfRr+PPM3p3mUisarGjkMTBTQv ymRMDJEyaldbvh/MVgnrGVjbGCqeo4l8BubAYUPtLYn32gmtsGicVP3MGCDL4I6Odqd5lWG5YyhqJ EAcMXrzk9XQXtumgdo+BzyHwScnC0WnkEOrxDawHD3eSmzGMkhRjsi/oE1Vj1zxFaveVcfhrqNF1y wNhMgfGQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e0DAz-000151-II; Thu, 05 Oct 2017 20:55:25 +0000 Received: from mail.free-electrons.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e0DAE-0007eI-DL for linux-arm-kernel@lists.infradead.org; Thu, 05 Oct 2017 20:54:42 +0000 Received: by mail.free-electrons.com (Postfix, from userid 110) id AB9BB20974; Thu, 5 Oct 2017 22:54:12 +0200 (CEST) Received: from localhost (unknown [91.126.32.14]) by mail.free-electrons.com (Postfix) with ESMTPSA id 7A49B20914; Thu, 5 Oct 2017 22:54:12 +0200 (CEST) From: Maxime Ripard To: Chen-Yu Tsai , Maxime Ripard , linus.walleij@linaro.org Subject: [PATCH 1/3] pinctrl: sunxi: Introduce the strict flag Date: Thu, 5 Oct 2017 22:54:06 +0200 Message-Id: X-Mailer: git-send-email 2.13.5 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171005_135438_671143_3753180D X-CRM114-Status: GOOD ( 13.66 ) 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: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, 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 Our pinctrl device should have had strict set all along. However, it wasn't the case, and most of our old device trees also have a pinctrl group in addition to the GPIOs properties, which mean that we can't really turn it on now. All our new SoCs don't have that group, so we should still enable that mode on the newer one though. In order to enable it by default, add a flag that will allow to disable that mode that should be set by pinctrl drivers that cannot be migrated. Signed-off-by: Maxime Ripard --- drivers/pinctrl/sunxi/pinctrl-sunxi.c | 5 ++++- drivers/pinctrl/sunxi/pinctrl-sunxi.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c index 52edf3b5988d..1753a5b1573f 100644 --- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c +++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c @@ -690,7 +690,7 @@ sunxi_pmx_gpio_set_direction(struct pinctrl_dev *pctldev, return 0; } -static const struct pinmux_ops sunxi_pmx_ops = { +static struct pinmux_ops sunxi_pmx_ops = { .get_functions_count = sunxi_pmx_get_funcs_cnt, .get_function_name = sunxi_pmx_get_func_name, .get_function_groups = sunxi_pmx_get_func_groups, @@ -1307,6 +1307,9 @@ int sunxi_pinctrl_init_with_variant(struct platform_device *pdev, pctrl_desc->pctlops = &sunxi_pctrl_ops; pctrl_desc->pmxops = &sunxi_pmx_ops; + if (desc->disable_strict_mode) + sunxi_pmx_ops.strict = false; + pctl->pctl_dev = devm_pinctrl_register(&pdev->dev, pctrl_desc, pctl); if (IS_ERR(pctl->pctl_dev)) { dev_err(&pdev->dev, "couldn't register pinctrl driver\n"); diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.h b/drivers/pinctrl/sunxi/pinctrl-sunxi.h index 1bfc0d8a55df..11b128f54ed2 100644 --- a/drivers/pinctrl/sunxi/pinctrl-sunxi.h +++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.h @@ -112,6 +112,7 @@ struct sunxi_pinctrl_desc { unsigned irq_banks; unsigned irq_bank_base; bool irq_read_needs_mux; + bool disable_strict_mode; }; struct sunxi_pinctrl_function {