[v2,04/11] pinctrl: renesas: rzg2l: Add pin configuration support for pinmux groups
Message ID | 20231207070700.4156557-5-claudiu.beznea.uj@bp.renesas.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp4610915vqy; Wed, 6 Dec 2023 23:35:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IGeqwsbhBWRWgtwMgIhbN/pZbBhMnbWtUEEaL1mRAtWSh/q2tGhyTTNtHyGmwOTC0D+f8q4 X-Received: by 2002:a05:6830:3686:b0:6d8:4837:e8e7 with SMTP id bk6-20020a056830368600b006d84837e8e7mr2892149otb.33.1701934512438; Wed, 06 Dec 2023 23:35:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701934511; cv=none; d=google.com; s=arc-20160816; b=tX9deQG4CztWXexzlpEJabyu8yNtniI5YapMa+yn42WUepF5ffS450Arv9uN/8qyuF QH+b5wVwIPW0vwp5heaqLw8lv4HYtnHC0bwo1FCVrK2CyfX829wMvGQOeqb7wXvBlLQJ VdMNCACC/sOueHLu0dntuNdGUoJD5ESi34hQXn49iMNCjyTomNDaeMQ2tQk6mn9mUMAW 8J4f442j3e6nj6MsftJgfvv6pD1LObguPhrLJsg6QS4b29iIYSo3VmGBrAxiAB3Jbv0g 0/FZtk30Q/XI2NMP60a+3KsSdZHazVm5EGy4bvWrbnVOWfixiDsmwwdrlCHgHEybThxa Jqjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Bx/sdnsKumQx6XdP19I/alVAivyipyzs0ZyhJTZLb5E=; fh=0Q5nThHpcqxhTuYPafxHj+TuRjwsk4lTGXpM+LoLmQc=; b=IMTKAlS9XmUw92N8ulVvdFt/EB3b8dROZpk/YZUpO57PitqZXw8CYs2aqtn6wn2Bcy TEJjGmBYE0kcAAQBUC91oF53LM1gErXUmCZvY14jFJshJTsS3FZt0fyRIqfIMUvKryU6 lOvAZ7zP4caq4qeIR5cQyye8tNKIgdvIEGCMX1CVBqFHfWYLa8BaXSAcG4IWRJ6WfB09 7Uj1sFH7maQDEp16vbNqH7PdN75o5JwYSqoZ2zf0mPfiC87niqeQ46myyzpXpfsSf3nR e05R26T0uLsVwji1AV/bJU/fbeiUJ3vvoBOg2oodfHoWcs1VUMGyxG7CB+UU9H04E58D gdag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=atIfVdYm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id n2-20020a632702000000b005c6260b688esi710212pgn.606.2023.12.06.23.35.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 23:35:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=atIfVdYm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 3BE3680E06B3; Wed, 6 Dec 2023 23:08:36 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377771AbjLGHIU (ORCPT <rfc822;pusanteemu@gmail.com> + 99 others); Thu, 7 Dec 2023 02:08:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377758AbjLGHIH (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 7 Dec 2023 02:08:07 -0500 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF24010D1 for <linux-kernel@vger.kernel.org>; Wed, 6 Dec 2023 23:08:12 -0800 (PST) Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-54ca43031d1so526589a12.0 for <linux-kernel@vger.kernel.org>; Wed, 06 Dec 2023 23:08:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1701932891; x=1702537691; darn=vger.kernel.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=Bx/sdnsKumQx6XdP19I/alVAivyipyzs0ZyhJTZLb5E=; b=atIfVdYmxCxfrKWv5XsbU7Ivdwh+kvCNIS4lirqhAAuyJaUKgiTwqlGE6WOVnqhM70 1oXohLQNaVxgtszeqlaPRkudR/+1GKYuemk2/JUrg4iCcnBqtNZOt7RRcT8x6aewP2GV LqW6Uka7FjzWKJIKXzxAyoA3u9q8ZZWNOfM24cKYWIlGhbp3ROoTIAepLu4dg6deEvKi FZWfJi1qmoLE/rWwTwSRaDCPtcWBNQd8TOVO14Wqg8D1gthYg8om73pWxSILGw4hKMS9 z8uCyK4B3BseonkBtoH1jz9NhfaCzTmKftnvLYqWKdY/13w6BbAuwUKOYhQfCDDfN4tQ EE6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701932891; x=1702537691; 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=Bx/sdnsKumQx6XdP19I/alVAivyipyzs0ZyhJTZLb5E=; b=p3c2Nb8YmzFFIL9VUoDt9nMaWuADVCyeh2wREA+SbnKrwiY+2viFC3CJ5cU7PiznxO AqGFid11HJXznkDj7cipH6TMhfse8ejP0rsSiN22f8cjpVplDYOFshfR8AvcffR+3IHN Ss6GrpjdSKVObsWgBPuolEIgg4/dTSDsaD+DiSoJPeGCIaePpLDwzGyI+5SdnX0V8Yg6 89qUSiqnj0ECbHzYEBxmglDwzdS/i/+YV+Wp5qsccZZAs/hqSnJ5+XY9uBhxS9KzhpOs ZAD5aOBhg8A1Cf0H7tFsIrf/eL2rj/ylzt+sq4Hv2NFM0gILba5udOJzu8HDotKr1k05 DC5Q== X-Gm-Message-State: AOJu0Ywa1Qc1cQ1ssRQ2uFQ4a1Dc1QWpyMCGwXDgxmkAvV+568Ni8vLO 3wur/M/JwqxcJXlNe4ZAqbvXHg== X-Received: by 2002:a05:6402:3185:b0:54c:4837:9035 with SMTP id di5-20020a056402318500b0054c48379035mr1460439edb.45.1701932891279; Wed, 06 Dec 2023 23:08:11 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.22]) by smtp.gmail.com with ESMTPSA id b41-20020a509f2c000000b0054cb88a353dsm420818edf.14.2023.12.06.23.08.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 23:08:10 -0800 (PST) From: Claudiu <claudiu.beznea@tuxon.dev> X-Google-Original-From: Claudiu <claudiu.beznea.uj@bp.renesas.com> 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, geert+renesas@glider.be, magnus.damm@gmail.com, mturquette@baylibre.com, sboyd@kernel.org, linus.walleij@linaro.org, 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-clk@vger.kernel.org, linux-gpio@vger.kernel.org, Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> Subject: [PATCH v2 04/11] pinctrl: renesas: rzg2l: Add pin configuration support for pinmux groups Date: Thu, 7 Dec 2023 09:06:53 +0200 Message-Id: <20231207070700.4156557-5-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231207070700.4156557-1-claudiu.beznea.uj@bp.renesas.com> References: <20231207070700.4156557-1-claudiu.beznea.uj@bp.renesas.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 06 Dec 2023 23:08:36 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784607682875617588 X-GMAIL-MSGID: 1784607682875617588 |
Series |
renesas: rzg3s: Add support for Ethernet
|
|
Commit Message
claudiu beznea
Dec. 7, 2023, 7:06 a.m. UTC
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> On RZ/G3S different Ethernet pins need to be configured with different settings (e.g., power-source needs to be set, RGMII TXC and 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 = <RZG2L_PORT_PINMUX(1, 1, 1)>; /* ET0_TX_CTL */ power-source = <1800>; output-enable; drive-strength-microamp = <5200>; }; }; Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> --- Changes in v2: - moved num_configs check under num_pinmux check as suggested - collected Rb tag drivers/pinctrl/renesas/pinctrl-rzg2l.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
Comments
Hi Claudiu, On Thu, Dec 7, 2023 at 8:08 AM Claudiu <claudiu.beznea@tuxon.dev> wrote: > From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> > > On RZ/G3S different Ethernet pins need to be configured with different > settings (e.g., power-source needs to be set, RGMII TXC and 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 = <RZG2L_PORT_PINMUX(1, 1, 1)>; /* ET0_TX_CTL */ > power-source = <1800>; > output-enable; > drive-strength-microamp = <5200>; > }; > }; > > Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> > Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> > --- > > Changes in v2: Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> i.e. will queue in renesas-pinctrl-for-v6.8. > - moved num_configs check under num_pinmux check as suggested Actually my comment was wrong, as I had misunderstood the code flow ("goto done") in case num_pins is non-zero. I will revert to v1 while queuing in renesas-pinctrl-for-v6.8. Gr{oetje,eeting}s, Geert
diff --git a/drivers/pinctrl/renesas/pinctrl-rzg2l.c b/drivers/pinctrl/renesas/pinctrl-rzg2l.c index 2eb240b731d5..58786455ecf3 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) { + if (num_configs) + nmaps += 1; 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;