mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Yu-Chun Lin [林祐君]" <eleanor.lin@realtek.com>
To: "Baek Kyu, Kim" <pocj8ur4in@gmail.com>,
	Linus Walleij <linusw@kernel.org>
Cc: "James Tai [戴志峰]" <james.tai@realtek.com>,
	"Andreas Färber" <afaerber@suse.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-realtek-soc@lists.infradead.org"
	<linux-realtek-soc@lists.infradead.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] pinctrl: realtek: Write the encoded slew rate value
Date: Tue, 3 Nov 2026 12:40:02 +0000	[thread overview]
Message-ID: <727f8462393544b1bb2a816069f16b4e@realtek.com> (raw)
In-Reply-To: <20261031081804.218566-1-pocj8ur4in@gmail.com>

> rtd_pconf_parse_conf() maps slew-rate arguments 1, 10, 20 and 30 to the
> two-bit field values 0, 1, 2 and 3. However, it shifts the original argument into
> the register value instead of using the computed encoding.
> After masking, these arguments write 1, 2, 0 and 2 respectively. In particular,
> the distinct 10 and 30 settings write the same field value.
> 
> Use set_val when constructing the register value so that both individual pin
> and group configuration apply the existing conversion. Leave argument
> validation, field offsets, masks and regmap error handling unchanged.
> 
> Fixes: dcc9334435b0 ("pinctrl: realtek: add support for slew rate, input voltage
> and high VIL")
> Signed-off-by: Baek Kyu, Kim <pocj8ur4in@gmail.com>

Reviewed-by: Yu-Chun Lin <eleanor.lin@realtek.com>
Tested-by: Yu-Chun Lin <eleanor.lin@realtek.com>

Thanks!
Yu-Chun

> ---
> An arm64 QEMU kernel exercised the RTD1625 MAIN2 pin and group
> state-selection paths using the real pinctrl callbacks and a synthetic regmap
> backend. A slew-rate request of 10 wrote field value 2 before the change and 1
> after it, while adjacent bits were preserved. No board device tree, physical
> MMIO or signal timing was tested.
> 
>  drivers/pinctrl/realtek/pinctrl-rtd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pinctrl/realtek/pinctrl-rtd.c
> b/drivers/pinctrl/realtek/pinctrl-rtd.c
> index 60222339726b4..656c281c557ac 100644
> --- a/drivers/pinctrl/realtek/pinctrl-rtd.c
> +++ b/drivers/pinctrl/realtek/pinctrl-rtd.c
> @@ -438,7 +438,7 @@ static int rtd_pconf_parse_conf(struct rtd_pinctrl
> *data,
>                 sr_off = config_desc->base_bit +
> config_desc->slew_rate_offset;
>                 reg_off = config_desc->reg_offset;
>                 mask = 0x3 << sr_off;
> -               val = arg << sr_off;
> +               val = set_val << sr_off;
>                 break;
> 
>         case PIN_CONFIG_INPUT_VOLTAGE_UV:
> --
> 2.55.0


      reply	other threads:[~2026-11-03 12:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-31  8:18 Baek Kyu, Kim
2026-11-03 12:40 ` Yu-Chun Lin [林祐君] [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=727f8462393544b1bb2a816069f16b4e@realtek.com \
    --to=eleanor.lin@realtek.com \
    --cc=afaerber@suse.com \
    --cc=james.tai@realtek.com \
    --cc=linusw@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-realtek-soc@lists.infradead.org \
    --cc=pocj8ur4in@gmail.com \
    /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

all inboxes | Powered by JetHome®