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: 115002 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp1015195qgn; Thu, 5 Oct 2017 13:54:55 -0700 (PDT) X-Google-Smtp-Source: AOwi7QC47w/Ek/Bb//MfHP9d31ErjVvnQmFPJ6xTIRprPbUpWHzXlRVihN2VxQmEX5oVGVTKj57N X-Received: by 10.101.90.68 with SMTP id z4mr22342482pgs.76.1507236895395; Thu, 05 Oct 2017 13:54:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507236895; cv=none; d=google.com; s=arc-20160816; b=B5UymrwzB841Vm3smZfx3m+SL/QNxtp8rVxjB8DFaitkZ3Pg5gB+SeXIrjoEtG/LjD ysNu+Pr893KjaFC/JbgAXnv2p23evJXFDYP6S/QO/9/a1+Yk6Nrv4rKUOhmG4etBKHNJ xWuILpoWedUAhobbvEXACZwW6rscyFPyqsmhVtv40IPF/NGSOaZar9KobcrFwYy/KnpC Ik6nKYIfGeoBWlITKUnXr7Rcmq3wHU7VvSEldW5z1SiaMgocfnrum0p1N6xD2SfDHB4L /DpB2oYRoTiAD7nfvO2P4Ku3/irGvBH/hRMiK1PgXyfGe8AJ7pIo3k1xrG6RWW37UaZM 19NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=8CksfARoq2X8boTwAiCJaY5Oi13WLG16KSVy4v7yTnM=; b=JahKC/FT6NtNethsu4gb2lDUQQwUAtTliA/MoscTLyjmhn1lsj42sMYzK17OSXMBGS dCQ5mKKAw3qG0TLhL72sZGTOBRe5Z0nl8cqw7nvLpFv5hGyKiYyEg2TVIqb3CJsp89Gf q+0SdCJutp4h9pC0safL8nxqbyEYm3NKYQJ6tmBnDJsMWgsGmWYLfTZ/P2MP0uZMacy2 kzv53fJ3ehZaLAoO0ZeHI/lvvInzkIzsi5zuJcvlEz2GrVE+YoqZ33JOkH6uN+9WxfoD d+m9gX05NuuoGlmoreSdAQyvvg7mx/EwC8/PNDt6+Zp7hMIaikhofCL5cl9iUGGr8m9N 5xAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u59si6871954plb.707.2017.10.05.13.54.55; Thu, 05 Oct 2017 13:54:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751446AbdJEUyy (ORCPT + 5 others); Thu, 5 Oct 2017 16:54:54 -0400 Received: from mail.free-electrons.com ([62.4.15.54]:32857 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751500AbdJEUyP (ORCPT ); Thu, 5 Oct 2017 16:54:15 -0400 Received: by mail.free-electrons.com (Postfix, from userid 110) id AB9BB20974; Thu, 5 Oct 2017 22:54:12 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 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 Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.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: Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org 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(-) -- git-series 0.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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 {