From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: Dmitry Yashin <dmt.yashin@gmail.com>,
Linus Walleij <linus.walleij@linaro.org>,
Heiko Stuebner <heiko@sntech.de>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>, Rob Herring <robh@kernel.org>
Cc: Luca Ceresoli <luca.ceresoli@bootlin.com>,
Jianqun Xu <jay.xu@rock-chips.com>,
devicetree@vger.kernel.org, linux-gpio@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] pinctrl: rockchip: add rk3308b SoC support
Date: Wed, 15 May 2024 19:00:38 +0200 [thread overview]
Message-ID: <d2c0bc2b-91a1-4533-bd14-3973277b5f6f@wanadoo.fr> (raw)
In-Reply-To: <20240515121634.23945-4-dmt.yashin@gmail.com>
Le 15/05/2024 à 14:16, Dmitry Yashin a écrit :
> Add pinctrl support for rk3308b. This pin controller much the same as
> rk3308's, but with additional iomux routes and 3bit iomuxes selected
> via gpio##_sel_src_ctrl registers. Set them up in the function
> rk3308b_soc_sel_src_init to use new 3bit iomuxes over some 2bit old ones.
>
> Fixes: 1f3e25a06883 ("pinctrl: rockchip: fix RK3308 pinmux bits")
> Signed-off-by: Dmitry Yashin <dmt.yashin@gmail.com>
> ---
> drivers/pinctrl/pinctrl-rockchip.c | 200 +++++++++++++++++++++++++++++
> drivers/pinctrl/pinctrl-rockchip.h | 1 +
> 2 files changed, 201 insertions(+)
Hi,
>
> diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
> index cc647db76927..15d2045f929e 100644
> --- a/drivers/pinctrl/pinctrl-rockchip.c
> +++ b/drivers/pinctrl/pinctrl-rockchip.c
> @@ -632,6 +632,115 @@ static struct rockchip_mux_recalced_data rk3308_mux_recalced_data[] = {
> },
> };
>
> +static struct rockchip_mux_recalced_data rk3308b_mux_recalced_data[] = {
It is likely that it would require some other changes, but it looks to
be a good candidate for static const struct.
> + {
> + /* gpio1b6_sel */
> + .num = 1,
> + .pin = 14,
> + .reg = 0x28,
> + .bit = 12,
> + .mask = 0xf
> + }, {
...
> @@ -882,6 +991,35 @@ static struct rockchip_mux_route_data rk3308_mux_route_data[] = {
> RK_MUXROUTE_SAME(2, RK_PA4, 3, 0x600, BIT(16 + 2) | BIT(2)), /* pdm-clkm-m2 */
> };
>
> +static struct rockchip_mux_route_data rk3308b_mux_route_data[] = {
Same
> + RK_MUXROUTE_SAME(0, RK_PC3, 1, 0x314, BIT(16 + 0) | BIT(0)), /* rtc_clk */
> + RK_MUXROUTE_SAME(1, RK_PC6, 2, 0x314, BIT(16 + 2) | BIT(16 + 3)), /* uart2_rxm0 */
> + RK_MUXROUTE_SAME(4, RK_PD2, 2, 0x314, BIT(16 + 2) | BIT(16 + 3) | BIT(2)), /* uart2_rxm1 */
> + RK_MUXROUTE_SAME(0, RK_PB7, 2, 0x608, BIT(16 + 8) | BIT(16 + 9)), /* i2c3_sdam0 */
...
> @@ -3746,6 +3929,21 @@ static struct rockchip_pin_ctrl rk3308_pin_ctrl = {
> .schmitt_calc_reg = rk3308_calc_schmitt_reg_and_bit,
> };
>
> +static struct rockchip_pin_ctrl rk3308b_pin_ctrl = {
This one could be constify without any other changes I think (and also
makes more sense because of its function pointers)
Just my 2c.
CJ
> + .pin_banks = rk3308_pin_banks,
> + .nr_banks = ARRAY_SIZE(rk3308_pin_banks),
> + .label = "RK3308b-GPIO",
> + .type = RK3308B,
> + .grf_mux_offset = 0x0,
> + .iomux_recalced = rk3308b_mux_recalced_data,
> + .niomux_recalced = ARRAY_SIZE(rk3308b_mux_recalced_data),
> + .iomux_routes = rk3308b_mux_route_data,
> + .niomux_routes = ARRAY_SIZE(rk3308b_mux_route_data),
> + .pull_calc_reg = rk3308_calc_pull_reg_and_bit,
> + .drv_calc_reg = rk3308_calc_drv_reg_and_bit,
> + .schmitt_calc_reg = rk3308_calc_schmitt_reg_and_bit,
> +};
...
prev parent reply other threads:[~2024-05-15 17:00 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-15 12:16 [PATCH 0/3] pinctrl: rockchip: add rk3308b SoC support Dmitry Yashin
2024-05-15 12:16 ` [PATCH 1/3] pinctrl: rockchip: update rk3308 iomux routes Dmitry Yashin
2024-05-28 11:29 ` Linus Walleij
2024-05-28 11:52 ` Heiko Stübner
2024-05-28 12:18 ` Dmitry Yashin
2024-05-28 13:23 ` Heiko Stübner
2024-05-28 11:50 ` Heiko Stübner
2024-05-29 8:56 ` Linus Walleij
2024-05-15 12:16 ` [PATCH 2/3] dt-bindings: pinctrl: rockchip: add rk3308b Dmitry Yashin
2024-05-15 16:17 ` Conor Dooley
2024-05-15 12:16 ` [PATCH 3/3] pinctrl: rockchip: add rk3308b SoC support Dmitry Yashin
2024-05-15 16:29 ` Luca Ceresoli
2024-05-16 12:06 ` Dmitry Yashin
2024-05-17 6:58 ` Luca Ceresoli
2024-05-28 8:17 ` Heiko Stübner
2024-05-28 8:43 ` Jonas Karlman
2024-05-15 17:00 ` Christophe JAILLET [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d2c0bc2b-91a1-4533-bd14-3973277b5f6f@wanadoo.fr \
--to=christophe.jaillet@wanadoo.fr \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmt.yashin@gmail.com \
--cc=heiko@sntech.de \
--cc=jay.xu@rock-chips.com \
--cc=krzk+dt@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=luca.ceresoli@bootlin.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).