From patchwork Mon Nov 20 07:00:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13460839 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CD353C5AD4C for ; Mon, 20 Nov 2023 07:02:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=isbx5T9FjeujzdeJUQLDnrU00+8Cd0kenr/C53LsSkw=; b=nA6qzzuAhPVUUP ups4JYFBCElIA62YgeeH42imd9f8q5T8fh2vAjlAoMGR45ZdOKU5/Lqk5ZU/mB5dmxSiUqTs+Cxw1 Rky15wvrYUGzmAx5IcGD+wEbtOCV4TBT23N4gWtbEFYBbg4iMJ7VZFCEoz5Ee2S1QrCTWblkn220A hMQhY+p4uGLNh5n8lm48HLhRrk3XkAAbMNJbrWkO+YnGxj5klqbZZRp0Bk8jDGXMzNbLpGUWiGou1 qYYlsrhz99b/hRikL1QEP9CJOZVkRIvOD/SQMRodyIO3YPB5uz4RDtDaD62glcRIdIfrzeqgsVZTP lpsCYv000I17iw4orNCw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r4yHe-00BJTR-2h; Mon, 20 Nov 2023 07:01:26 +0000 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r4yHX-00BJMM-28 for linux-arm-kernel@lists.infradead.org; Mon, 20 Nov 2023 07:01:21 +0000 Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-507e85ebf50so5146008e87.1 for ; Sun, 19 Nov 2023 23:01:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1700463674; x=1701068474; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6Xy2p6wKX+cRsudc9CGrTgEJFgRUbbi06MpJ65zqOIE=; b=q9c7S94T+7iLOOqpcFYQjtegrtIoAdCn/j2i63AKpLw2y58Q/x0OWbXCaqZNJ84uZC avwWrSgDRtYTLvlwDeD/sCJPhc92I5m3+RWEbOF64rspWrbUcS1KAt/SZlA6vtMpWAWS EH7cUaC11lLLjoELA5+R1ZIYqyyv+d8+18rNrl6IxATUVNIG5gYEEzOxHP7zUsbPeSvP BnBne8MSCFaUKfph86SfgD4GjXmGSIvGqkfOs83di8hyYf2Z7xmcsl3oJ+aG/IcbwOOy u5Vb0wNVYGOcPVCVYJTr6wUYVxRrh+8QYLjiy7t8J0lDFfPTorFprO0XzQ1h4mNPhlES S7uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700463674; x=1701068474; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6Xy2p6wKX+cRsudc9CGrTgEJFgRUbbi06MpJ65zqOIE=; b=qtAxXJMPQ2LcYTHE9xwkhGRKiuj3R+RACrWe+0cGTLsKojtlCQZFSx6K6TdIyt4+/Q VnGN9E5Jf6SK3E1byzwp/SqRsdaFl3vSiiNHOa/Ivc+rrASCncvLL4Kq8Z+lne5Rp76c gn6XnnllYDxYEZJRPZuYCfZoiXRzCxhVAlcgZZ6wjhOCi4tnNm9ao+M5MS639zofZ99+ ILy5JgYbM2tdeznPlhqDU1/mvG/OhTtEEOOqh+b47Umo89s6PQR1DoUgeBa9wV1ZXf7n 68jEH2HCi4Ev5iZvEq2pBM+2Inf8rx58rOo+3QIOPrO1k0Q48EC4qw/aGIYnBzxPDOrO +4cA== X-Gm-Message-State: AOJu0YzujtpYOgyMDuRtznl08R2XbYlsGvPpLgIa5cp3dzCUwkM+p2Pz 1cMTOS1PqXmLWC7ISh1SajJuKg== X-Google-Smtp-Source: AGHT+IGfGm8OEGn2UQQ//iKUEdt+02S9t97oQMZwU4ZLbFpMApxh8gOBKXhhM8jTFK7zquiEVoqJ2A== X-Received: by 2002:ac2:5639:0:b0:509:d962:3c67 with SMTP id b25-20020ac25639000000b00509d9623c67mr4876972lff.20.1700463674488; Sun, 19 Nov 2023 23:01:14 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.183]) by smtp.gmail.com with ESMTPSA id p2-20020a5d4582000000b003316d1a3b05sm8777667wrq.78.2023.11.19.23.01.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Nov 2023 23:01:13 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: s.shtylyov@omp.ru, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, linux@armlinux.org.uk, geert+renesas@glider.be, magnus.damm@gmail.com, mturquette@baylibre.com, sboyd@kernel.org, linus.walleij@linaro.org, p.zabel@pengutronix.de, arnd@arndb.de, m.szyprowski@samsung.com, alexandre.torgue@foss.st.com, afd@ti.com, broonie@kernel.org, alexander.stein@ew.tq-group.com, eugen.hristev@collabora.com, sergei.shtylyov@gmail.com, prabhakar.mahadev-lad.rj@bp.renesas.com, biju.das.jz@bp.renesas.com Cc: linux-renesas-soc@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH 06/14] pinctrl: renesas: rzg2l: Add pin configuration support for pinmux groups Date: Mon, 20 Nov 2023 09:00:16 +0200 Message-Id: <20231120070024.4079344-7-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231120070024.4079344-1-claudiu.beznea.uj@bp.renesas.com> References: <20231120070024.4079344-1-claudiu.beznea.uj@bp.renesas.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231119_230119_735129_963D0E70 X-CRM114-Status: GOOD ( 14.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Claudiu Beznea On RZ/G3S different Ethernet pins needs to be configured with different settings (e.g. power-source need to be set, RGMII TXC, TX_CTL pins need output-enable). Commit adjust driver to allow specifying pin configuration for pinmux groups. With this DT settings like the following are taken into account by driver: eth0_pins: eth0 { tx_ctl { pinmux = ; /* ET0_TX_CTL */ power-source = <1800>; output-enable; drive-strength-microamp = <5200>; }; }; Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven --- drivers/pinctrl/renesas/pinctrl-rzg2l.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/pinctrl/renesas/pinctrl-rzg2l.c b/drivers/pinctrl/renesas/pinctrl-rzg2l.c index 21ee628363fa..819698dacef0 100644 --- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c +++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c @@ -376,8 +376,11 @@ static int rzg2l_dt_subnode_to_map(struct pinctrl_dev *pctldev, goto done; } - if (num_pinmux) + if (num_pinmux) { nmaps += 1; + if (num_configs) + nmaps += 1; + } if (num_pins) nmaps += num_pins; @@ -462,6 +465,16 @@ static int rzg2l_dt_subnode_to_map(struct pinctrl_dev *pctldev, maps[idx].data.mux.function = name; idx++; + if (num_configs) { + ret = rzg2l_map_add_config(&maps[idx], name, + PIN_MAP_TYPE_CONFIGS_GROUP, + configs, num_configs); + if (ret < 0) + goto remove_group; + + idx++; + }; + dev_dbg(pctrl->dev, "Parsed %pOF with %d pins\n", np, num_pinmux); ret = 0; goto done;