From patchwork Thu Jun 18 12:50:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Drew Fustini X-Patchwork-Id: 11612021 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 E1DEB138C for ; Thu, 18 Jun 2020 12:51:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C954A20885 for ; Thu, 18 Jun 2020 12:51:48 +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="TRVf5p71" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729962AbgFRMvq (ORCPT ); Thu, 18 Jun 2020 08:51:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729889AbgFRMvo (ORCPT ); Thu, 18 Jun 2020 08:51:44 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0077CC0613ED for ; Thu, 18 Jun 2020 05:51:43 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id g10so5080243wmh.4 for ; Thu, 18 Jun 2020 05:51:43 -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=kre93dd6hT4pYBC6xQN9FkazTNYBQtZr78iwLPfwCF4=; b=TRVf5p71/Ag4UNdwc/kW3lZlfblIowK80W+zyKByyru7UHXDqLeD7vCHyYGEpt4SE8 3feY5JsWedJKgdl+5OIez+/8F1tBVDJ/4VA824OzPcsTBPPvCrjYcFFz+5R42CWGMpFk mlGZ12sNiwhEH5GEti9o1QKOKAO3W7nFkr8QTy+Z1+eE7pHgMptcgUtDt7tXkhGRvw4n cx+fObyf5nAwwcDb3tVugVuQRdrGOCmLMqYP/S8rptL6ZYej0IPNQtAirgnNgm1sqRxL vxooeW/Khk5NA3xdrlKD4ZmJ/mz/QX4rgry57toQ8SIDlnksSH7oTPVxq5NIWkRvVkpJ 4NpA== 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=kre93dd6hT4pYBC6xQN9FkazTNYBQtZr78iwLPfwCF4=; b=sxEpqG4fpbXr6JX9wjdd94LsfZA96+zQ73KWdVgJkc8ZraoiGwF70EoPolG/bxeMi+ P1Vw6Mu/rzK5ox3w3KUa7FZabweErOC2p9Zeg2d7dGNzks6LjxPiNOaOMEP562WzMkMP zJR97+VY4ccWAEf2G7Ykd1kwJGbdljdvdKkMETf7K5G5n+vL2U9MTizhCx7LzpmTMuZ5 zS5yGRlGnHVDtsb38uCgX29Tl7s7BUlTtBRDHprMld8CplrbgmMTbTbFUrKSDnlFCMr6 VuxazxSvcxxZt4gUruFmiGcEE0wbbIL8XUXGZQmLZtQ2qLcBXNk1F6HjSBCvPUwDCALk Q2Tw== X-Gm-Message-State: AOAM5310YCr4YCOqHMXJQDnBbcdCvaNX04rSqLy41GO0Ek9mAURKaB72 bYLxbUiGDDB4HqsTE6Yjx/PNBA== X-Google-Smtp-Source: ABdhPJx5wChPkJh3wqqQH8t9n3fY00xH6TQW/iPEoWFdYFr16TgedzvEFOTdfZ9BL2dZZbmQXlZ/4w== X-Received: by 2002:a1c:44c3:: with SMTP id r186mr3831425wma.67.1592484702734; Thu, 18 Jun 2020 05:51:42 -0700 (PDT) Received: from localhost.localdomain (i59F66838.versanet.de. [89.246.104.56]) by smtp.gmail.com with ESMTPSA id v27sm3714151wrv.81.2020.06.18.05.51.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jun 2020 05:51:41 -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 1/3] ARM: dts: change AM33XX_PADCONF macro separate conf and mux Date: Thu, 18 Jun 2020 14:50:55 +0200 Message-Id: <20200618125057.41252-2-drew@beagleboard.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200618125057.41252-1-drew@beagleboard.org> References: <20200618125057.41252-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 --- 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..a0974923bb1b 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 Thu Jun 18 12:50:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Drew Fustini X-Patchwork-Id: 11612027 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 8559C159A for ; Thu, 18 Jun 2020 12:52:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6B6D0208B3 for ; Thu, 18 Jun 2020 12:52:02 +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="OMeUBDJH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730057AbgFRMvx (ORCPT ); Thu, 18 Jun 2020 08:51:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730047AbgFRMvv (ORCPT ); Thu, 18 Jun 2020 08:51:51 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B0FAC0613EF for ; Thu, 18 Jun 2020 05:51:50 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id t13so3503013wrs.2 for ; Thu, 18 Jun 2020 05:51:50 -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=OMeUBDJHDfZzZVviBggQhXIHuiwJmDOMy0CPdLEzndgfIdnbwbIia7/VkAQm+c3TxQ OiAMSw+fc04yJwyx0S1da8QV881RvWFzWywcwlloVnhl8JQWdo4iypxayB6QLQKJdJ4O Pzgh5z4k0b3PE7HPSb1Mp+VVxMHCP0zgbSonNqufOsk7XaxdcCFu8fj/0m2WXk1OVZAV klAT3/qRRzQz/DBZ9cCBkctkcDxryrzlD2Es4ZIzjGFHPLxE3pN4wsDJV9WP6Wg0yzLh r2HKh3mmp93uHIm/60MuEj5oaXfDVOh8KX864DhgR1IZsCdWw2lzIwMSaCGs6ip7UUea E2OQ== 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=m/21cazttH3tnfXmbGUsAqct7GHBWNoquUs2PNs5OWOHmxN3my/KsrVxccmsiPWg0z NoUXAR/1HtGlP0FiIiRJrFtyiQ8ZNSeWgfzRMHJdtpuLkUDq3d++GHEJUXsMnN8AY8fs pBzar4QJfdyW1ZcK/jZ/c8rekZPVyuYDvy6OM9HmXuqKd4Pnhy5KfWQ3WobrI6lpUznz Qlc8JnD4/rwQ+JSgnrPoXaOpEHrw7VnZoRHHP5myA6hU1eRPXdNbGyIt60OBjGGjBj4+ aMu4K06a4Tuu5Ha7bhZBRxOTOswZwmUYPM4hl2y77GfQVdd+eXUJ9K0MupmWpy2ARrZL IutA== X-Gm-Message-State: AOAM531nCfinqrbV6yV97dNKEQmdPY1f1qJgPeicTsSvrWL5yVPam1xz ZC07C/RM/pRnweXhA5ubOJyVN+NsNkVpMHr3 X-Google-Smtp-Source: ABdhPJzzzLWwoDV3nLbm6Ab2sMpnqVmB2wmFgALKaTLgflrv17b82hlrx/jr+hAILSCqeDm4B/VMmA== X-Received: by 2002:adf:d0d0:: with SMTP id z16mr4597420wrh.308.1592484709011; Thu, 18 Jun 2020 05:51:49 -0700 (PDT) Received: from localhost.localdomain (i59F66838.versanet.de. [89.246.104.56]) by smtp.gmail.com with ESMTPSA id v27sm3714151wrv.81.2020.06.18.05.51.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jun 2020 05:51: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 2/3] ARM: dts: am33xx-l4: change #pinctrl-cells from 1 to 2 Date: Thu, 18 Jun 2020 14:50:56 +0200 Message-Id: <20200618125057.41252-3-drew@beagleboard.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200618125057.41252-1-drew@beagleboard.org> References: <20200618125057.41252-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 Thu Jun 18 12:50:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Drew Fustini X-Patchwork-Id: 11612025 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 23A771392 for ; Thu, 18 Jun 2020 12:52:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 09D3A20884 for ; Thu, 18 Jun 2020 12:52:02 +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="TiuuX/Sd" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730079AbgFRMwB (ORCPT ); Thu, 18 Jun 2020 08:52:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730061AbgFRMvx (ORCPT ); Thu, 18 Jun 2020 08:51:53 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 978F7C0613ED for ; Thu, 18 Jun 2020 05:51:53 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id f185so5531711wmf.3 for ; Thu, 18 Jun 2020 05:51: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=+0u89dpmgvQy4plYwwslEmSBiru+bR25mmVExT9ZnYw=; b=TiuuX/SdtqRxO1POZ1JiW5Hy2GFaKV93vyNQMVQOy5teZ9AgCJLGPSSnXyOmCDBEUz bs6Q6tC8Q8QCv/hVDRI53LLBfuHJ/0nBs/NAsvTv4lmXuJhKByZy1gzQS8bGO4fwryaA lHQYWy7p59e61ydNP0aYDMdjz2DklMtM/+9QBq7DYEpM9dsABml7vbZG10g//W1+YA1A CxneXxP6sZGKnfhQIs+3Ua56kKThzmDJwIyivVu20LsjbQG6TnR3my9Jq+fI4SAKbUjW C5XM251MVSf5ukXeYVaYERqX/D4WohOdPlT2zv+ly2ORU4yqREvY0CWUcgF+yV6Q1wgM jEQQ== 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=mgev8uHru0PJfM/unCTYME+mt+TVwkpyNhU9r0wLl/JvkufByt2UOt38EtEXKMagun NS2KChZutG8rYq3H4epAJU+qM+4K590EZQe35xewsxgisjz0oNfOuifg5ZVgjonVKZzr IiCPyMr66tg/UVpbV0igmk4nFuRTJjUOkaqCkxE1spgT7oE2Z8pzB5CX9A50TsInzsvW t6J5KDK506o8FVwCYzl3w52ZLhXfZ13MRcAMdecQHaFbo4AvWpon5HXMV7AkGSVztAPt 5G8yAuVV+oM8GmCG851kuAouBonqk52lXkCLyeLkcM3XsI937070o+eqfAGBdu+W8KuS a7Yw== X-Gm-Message-State: AOAM530sCXGBfMsnah+DaxbyOmjGuroW0rn4lzTuf53FX33RZmzQ2pIE nL3oSjP1zFLFH1d52CSMCQxICw== X-Google-Smtp-Source: ABdhPJzZfibMUZiL+eVz9fIQNUlgeCf8L/u/t5OdsJBEcZqoBou07CPY4UPJL2CC9XruVrC+oYqBvg== X-Received: by 2002:a1c:ddc1:: with SMTP id u184mr3705202wmg.115.1592484712360; Thu, 18 Jun 2020 05:51:52 -0700 (PDT) Received: from localhost.localdomain (i59F66838.versanet.de. [89.246.104.56]) by smtp.gmail.com with ESMTPSA id v27sm3714151wrv.81.2020.06.18.05.51.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jun 2020 05:51: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 3/3] pinctrl: single: parse #pinctrl-cells = 2 Date: Thu, 18 Jun 2020 14:50:57 +0200 Message-Id: <20200618125057.41252-4-drew@beagleboard.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200618125057.41252-1-drew@beagleboard.org> References: <20200618125057.41252-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]);