From patchwork Fri Jun 19 09:06:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Drew Fustini X-Patchwork-Id: 11613525 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4DA4C13B1 for ; Fri, 19 Jun 2020 09:07:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 355E620890 for ; Fri, 19 Jun 2020 09:07:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=beagleboard-org.20150623.gappssmtp.com header.i=@beagleboard-org.20150623.gappssmtp.com header.b="X1XJo4xQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731869AbgFSJG6 (ORCPT ); Fri, 19 Jun 2020 05:06:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731783AbgFSJGx (ORCPT ); Fri, 19 Jun 2020 05:06:53 -0400 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1ABE9C061795 for ; Fri, 19 Jun 2020 02:06:51 -0700 (PDT) Received: by mail-ej1-x644.google.com with SMTP id o15so9366186ejm.12 for ; Fri, 19 Jun 2020 02:06:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beagleboard-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5mEvzhD8ZDNfnKNW5KPSqhD16ebDefQ348OLXK7WNy4=; b=X1XJo4xQqza5Gpmu5TS6+sFT/+90kfsxQwDVnSGPwQaL6hbFdH21IfK5LnIvWKmlTj gaFsYadBj8FbAs0pNrTKRZlA2+66YP2SeubU9X26yVbBRXWPqGIEO4OICu2sRQ+9lY5e EmZukeqFRzEyTIrBogjX7YxfkkdIGPAdOsFtIZG/LitU3ZAAJzNsjJN0pk79wYWA/Pc1 zGxL6jpw6nuzBg6Xo7s8ntORdfcO4qJ71Z2wnBSOYm4n3qiTtJbILegg5sR2/ArWTZpt bBCGfw+hcBzTiosEQbvpF8Jo//TjbtthL0cHnwhvniO8Rva4MAeOcucbi5FK/wEdjmQN sWKA== 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:mime-version:content-transfer-encoding; bh=5mEvzhD8ZDNfnKNW5KPSqhD16ebDefQ348OLXK7WNy4=; b=MNohrZxnMfLxYH1M+KBvNSwY2HoZo8bul+MDQYZGiPWSLaVPFopqMdxUnD7S3Dsh12 cvP1FGPzxUnMFvw+y5pZ06uwcCrmgCuyooEQKoGuijVsxRliJ+bfkLRTsclyrrVc8yNH qBi6Ba8wNeAgaciyQQP/IRtlXF9NF1OpGy14ukggzay4ZWszDu7bzzrKEVrtqRf7GMwg YpQGQmapctdSG9/I1WeNBpEdNugKjXFzw7oc3Yn1ytfY33xk+T2u5CrkyFRB8XNgZpEm 33bjxmkSuxMgbCZJDJe0nzFxYk/XhNqlZzWeNgA9kc93uk0S5lQeDAWZlru4bP361nHT 52gQ== X-Gm-Message-State: AOAM533WTIbG6TSofm3CNXR8wy1Md1kOsl4vU4WcG3GPkzt0UFzxuGl9 QI8MdjXal76uR2JP8hXsmOM6jDj6WAzgLqsB X-Google-Smtp-Source: ABdhPJzO4kbHdFvwlDaJ4wJ4m/s3iIdkdw6eY8mxMyd30QFl7MlUDUx58T6KaBdKzzwhRHx6KyznLA== X-Received: by 2002:a17:907:35c2:: with SMTP id ap2mr2547627ejc.530.1592557609833; Fri, 19 Jun 2020 02:06:49 -0700 (PDT) Received: from localhost.localdomain ([2001:16b8:5c68:7901:5c06:6064:338b:4004]) by smtp.gmail.com with ESMTPSA id dm1sm4653650ejc.99.2020.06.19.02.06.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jun 2020 02:06:48 -0700 (PDT) From: Drew Fustini To: Tony Lindgren , Rob Herring , linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Linus Walleij , Haojian Zhuang , devicetree@vger.kernel.org, =?utf-8?q?Beno=C3=AEt_Cousson?= , Jason Kridner , Robert Nelson Cc: Drew Fustini Subject: [PATCH v2 1/3] ARM: dts: change AM33XX_PADCONF macro separate conf and mux Date: Fri, 19 Jun 2020 11:06:06 +0200 Message-Id: <20200619090608.94948-2-drew@beagleboard.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200619090608.94948-1-drew@beagleboard.org> References: <20200619090608.94948-1-drew@beagleboard.org> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org AM33XX_PADCONF macro is modified to keep pin conf and pin mux separate. This requires #pinctrl-cells = 2 in am33xx-l4.dtsi pinctrl-single.c but also be changed to support "pinctrl-single,pins" with 3 arguments (offset, conf, mux) Signed-off-by: Drew Fustini --- v2 change: - remove outer parentheses from AM33XX_PADCONF macro as it causes a compile error in dtc. I had added it per suggestion from checkpatch about having parentheses around complex values. include/dt-bindings/pinctrl/omap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/dt-bindings/pinctrl/omap.h b/include/dt-bindings/pinctrl/omap.h index 625718042413..2d2a8c737822 100644 --- a/include/dt-bindings/pinctrl/omap.h +++ b/include/dt-bindings/pinctrl/omap.h @@ -65,7 +65,7 @@ #define DM814X_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x0800) (val) #define DM816X_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x0800) (val) #define AM33XX_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x0800) (val) -#define AM33XX_PADCONF(pa, dir, mux) OMAP_IOPAD_OFFSET((pa), 0x0800) ((dir) | (mux)) +#define AM33XX_PADCONF(pa, conf, mux) OMAP_IOPAD_OFFSET((pa), 0x0800) (conf) (mux) /* * Macros to allow using the offset from the padconf physical address From patchwork Fri Jun 19 09:06:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Drew Fustini X-Patchwork-Id: 11613527 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6BC7D13B1 for ; Fri, 19 Jun 2020 09:07:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 52567208DB for ; Fri, 19 Jun 2020 09:07:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=beagleboard-org.20150623.gappssmtp.com header.i=@beagleboard-org.20150623.gappssmtp.com header.b="hbsAZmXN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731027AbgFSJHE (ORCPT ); Fri, 19 Jun 2020 05:07:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731813AbgFSJGy (ORCPT ); Fri, 19 Jun 2020 05:06:54 -0400 Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 767A8C0613EF for ; Fri, 19 Jun 2020 02:06:53 -0700 (PDT) Received: by mail-ej1-x641.google.com with SMTP id q19so9409216eja.7 for ; Fri, 19 Jun 2020 02:06:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beagleboard-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EF3uQr3RQED1YKYkNKEVE2Xoq5JyRRd7hiTR6pRsTG4=; b=hbsAZmXNE2TaOrADyfhZ4LncxAlKOcWNbKLbDeF2rsahruJQCNzLprdZsGdbsUDjbq qrzTvHV7mlFcoGs5wRL1DmgYNtpfTYJn4yUmv3wLcxZn6ifXoTmBYaKDalxxjprE4H75 OFcrYnlQQb3DyBgekcLt/QElT7wo5S4Fx2JoOrZuAHEe640Rad0m9k1WfJvRz++zkTS7 c4Xc2hdrnjqNTUCgQk4kqi9gGZAT/y0MHgN+y3t734xefMs29v8NjuC/JpsypOd6R2t4 Si6ZesNDYvk6F49qAjkeO/QV73MqqosehLo+mhVjGQDVaAiRozB3VWBJFDg8zbopksMe ClXw== 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:mime-version:content-transfer-encoding; bh=EF3uQr3RQED1YKYkNKEVE2Xoq5JyRRd7hiTR6pRsTG4=; b=eaHZmQBFwe08MshLRY8RfRbsyABNVk4w3oAfQVmPHQq/Ls+nTKHxpJWktdZh4vmJKj ylDJ2dsjwd+PIjYEeWo59vY9+k1ZLSLLZcgb4n51exR2IUHfhFzWHiYAZQFRERXbuD1s mGzi62ObyRCNNa2PIo5Bs9cqLUfk8yw3Ij/v339XjeV90c8H8JJqK7tKKkaotROvpQP9 LB4xcOBGk3IVL/cRyIBYK6xzOyMfX5qfmdUh5dxfDeZmQhAeIfzbCeGDbw5jY8935FT9 KRShwZtOZ0UU/s6+GRKoV+vEW0cYaX3/K/nCyhsAvuRBbzEWAIMCawxHmDSG8VaRP8UD Ci4w== X-Gm-Message-State: AOAM531zVJu8hlC9CT//p/o0ax1J/9e5HICH39mjY/yW2D3JfPBh+W4+ zirARbKzLz0HfO3p/V/E0rex+g== X-Google-Smtp-Source: ABdhPJwcHprUUq00PuchIFIQbAmYwvW8uI0PLiIJTeBXZedE5iHqZtnO5Gza2w34X9TiFWfp14Ftgg== X-Received: by 2002:a17:906:2615:: with SMTP id h21mr2624881ejc.84.1592557612232; Fri, 19 Jun 2020 02:06:52 -0700 (PDT) Received: from localhost.localdomain ([2001:16b8:5c68:7901:5c06:6064:338b:4004]) by smtp.gmail.com with ESMTPSA id dm1sm4653650ejc.99.2020.06.19.02.06.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jun 2020 02:06:51 -0700 (PDT) From: Drew Fustini To: Tony Lindgren , Rob Herring , linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Linus Walleij , Haojian Zhuang , devicetree@vger.kernel.org, =?utf-8?q?Beno=C3=AEt_Cousson?= , Jason Kridner , Robert Nelson Cc: Drew Fustini Subject: [PATCH v2 2/3] ARM: dts: am33xx-l4: change #pinctrl-cells from 1 to 2 Date: Fri, 19 Jun 2020 11:06:07 +0200 Message-Id: <20200619090608.94948-3-drew@beagleboard.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200619090608.94948-1-drew@beagleboard.org> References: <20200619090608.94948-1-drew@beagleboard.org> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org This requires AM33XX_PADCONF macro in omap.h to be modified to keep pin conf and pin mux values separate. pinctrl-single.c must also be changed to support "pinctrl-single,pins" with 3 arguments (offset, conf, mux). Signed-off-by: Drew Fustini --- arch/arm/boot/dts/am33xx-l4.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/am33xx-l4.dtsi b/arch/arm/boot/dts/am33xx-l4.dtsi index 340ea331e54d..f9b99cfa93b6 100644 --- a/arch/arm/boot/dts/am33xx-l4.dtsi +++ b/arch/arm/boot/dts/am33xx-l4.dtsi @@ -290,7 +290,7 @@ scm: scm@0 { am33xx_pinmux: pinmux@800 { compatible = "pinctrl-single"; reg = <0x800 0x238>; - #pinctrl-cells = <1>; + #pinctrl-cells = <2>; pinctrl-single,register-width = <32>; pinctrl-single,function-mask = <0x7f>; }; From patchwork Fri Jun 19 09:06:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Drew Fustini X-Patchwork-Id: 11613535 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BDF2313B1 for ; Fri, 19 Jun 2020 09:07:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A5D92208DB for ; Fri, 19 Jun 2020 09:07:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=beagleboard-org.20150623.gappssmtp.com header.i=@beagleboard-org.20150623.gappssmtp.com header.b="UB/REUZq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731874AbgFSJHZ (ORCPT ); Fri, 19 Jun 2020 05:07:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731860AbgFSJG5 (ORCPT ); Fri, 19 Jun 2020 05:06:57 -0400 Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43CCDC061799 for ; Fri, 19 Jun 2020 02:06:55 -0700 (PDT) Received: by mail-ed1-x542.google.com with SMTP id o26so7044684edq.0 for ; Fri, 19 Jun 2020 02:06:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beagleboard-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+0u89dpmgvQy4plYwwslEmSBiru+bR25mmVExT9ZnYw=; b=UB/REUZqGhSab2IhwMetGxClUkd/oH91Eb1YMtnqkqAxIYIsM5YWJ4a17MUa8/08et 0KoPGo9oOwe1emR2wQSQNrT5mDdb5rPGbQPYSjM7oAM0AmVr3nITPyO5xBU0y99uSaYS GceF0JPmFhlA4OqkmdjhyRfE1guxkExlPCp0DWWvNnsOZnKJIUT+xfTjyP1zTVLFmjP2 dMylqWecptZAOuQnxr4pfUQnYY3XKand3fm9DpP1DYG41QiDNvEzeMJVk82vaFfE2K9D qtb13ihfkOU5g1JKWZXaspFlc8GMvyr56s1ipcyGwqqbQPiOZwcx/nYfvYwyMjpAPLcZ I8Jw== 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:mime-version:content-transfer-encoding; bh=+0u89dpmgvQy4plYwwslEmSBiru+bR25mmVExT9ZnYw=; b=bANKpP6vZEgCwWppKQS4ASVnDXsddIcjCQi0wJ1qXVEJxO4HcLZH+lLtH3AnORm5w6 9n7XfMmsBokMCdaOsEdsAAlmQQ7eECEk0S/gbvdlwvLVzVVJsCjdWVqCXLG/gqvyugnf NYaHuBho4YTF2qENmsT63sXphUauNrsx99eQCCKnEuuUhi3nrj7uVScBEYI65Pm0466w 7J3cNIOU3J7yr9bEJfODsx/VuZ4wuaXP5DV/Eq8wqcPmgt2Xj+hiS4q9Oum3xnVF4Nkv 8jrCJmtAFep7CXN+kifUHxJ1/Uvhw5DPNRDujVe11wQEETrWNsybA+xscofZdHGXFFbs ELtA== X-Gm-Message-State: AOAM530NkTh6vO34NZJuI/Yctk15snj3E2QPGNU3U9czNoMe1DLr9Qb8 4jHuwVwuIXa5CETJIVVnjR3hhQ== X-Google-Smtp-Source: ABdhPJy/3Bg56TEDS6v87nEXxy3icDzdDUs8cujpuQA8aXHR5JzzlkpBgh63TY4ie6qdHZydvU1qVg== X-Received: by 2002:aa7:d7ca:: with SMTP id e10mr2271039eds.45.1592557613971; Fri, 19 Jun 2020 02:06:53 -0700 (PDT) Received: from localhost.localdomain ([2001:16b8:5c68:7901:5c06:6064:338b:4004]) by smtp.gmail.com with ESMTPSA id dm1sm4653650ejc.99.2020.06.19.02.06.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jun 2020 02:06:53 -0700 (PDT) From: Drew Fustini To: Tony Lindgren , Rob Herring , linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Linus Walleij , Haojian Zhuang , devicetree@vger.kernel.org, =?utf-8?q?Beno=C3=AEt_Cousson?= , Jason Kridner , Robert Nelson Cc: Drew Fustini Subject: [PATCH v2 3/3] pinctrl: single: parse #pinctrl-cells = 2 Date: Fri, 19 Jun 2020 11:06:08 +0200 Message-Id: <20200619090608.94948-4-drew@beagleboard.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200619090608.94948-1-drew@beagleboard.org> References: <20200619090608.94948-1-drew@beagleboard.org> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org If "pinctrl-single,pins" has 3 arguments (offset, conf, mux) then pcs_parse_one_pinctrl_entry() does an OR operation on to get the value to store in the register. Signed-off-by: Drew Fustini --- drivers/pinctrl/pinctrl-single.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c index 02f677eb1d53..e6d1cf25782c 100644 --- a/drivers/pinctrl/pinctrl-single.c +++ b/drivers/pinctrl/pinctrl-single.c @@ -1017,10 +1017,17 @@ static int pcs_parse_one_pinctrl_entry(struct pcs_device *pcs, break; } - /* Index plus one value cell */ offset = pinctrl_spec.args[0]; vals[found].reg = pcs->base + offset; - vals[found].val = pinctrl_spec.args[1]; + + switch (pinctrl_spec.args_count) { + case 2: + vals[found].val = pinctrl_spec.args[1]; + break; + case 3: + vals[found].val = (pinctrl_spec.args[1] | pinctrl_spec.args[2]); + break; + } dev_dbg(pcs->dev, "%pOFn index: 0x%x value: 0x%x\n", pinctrl_spec.np, offset, pinctrl_spec.args[1]);