linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pinctrl: meson: define the pull up/down resistor value as 60 kOhm
@ 2025-03-29 19:01 Martin Blumenstingl
  2025-03-31  6:41 ` neil.armstrong
  2025-04-15  7:48 ` Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: Martin Blumenstingl @ 2025-03-29 19:01 UTC (permalink / raw)
  To: linux-amlogic, linux-gpio
  Cc: linux-kernel, linux-arm-kernel, linus.walleij,
	Martin Blumenstingl

The public datasheets of the following Amlogic SoCs describe a typical
resistor value for the built-in pull up/down resistor:
- Meson8/8b/8m2: not documented
- GXBB (S905): 60 kOhm
- GXL (S905X): 60 kOhm
- GXM (S912): 60 kOhm
- G12B (S922X): 60 kOhm
- SM1 (S905D3): 60 kOhm

The public G12B and SM1 datasheets additionally state min and max
values:
- min value: 50 kOhm for both, pull-up and pull-down
- max value for the pull-up: 70 kOhm
- max value for the pull-down: 130 kOhm

Use 60 kOhm in the pinctrl-meson driver as well so it's shown in the
debugfs output. It may not be accurate for Meson8/8b/8m2 but in reality
60 kOhm is closer to the actual value than 1 Ohm.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
 drivers/pinctrl/meson/pinctrl-meson.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c
index 253a0cc57e39..e5a32a0532ee 100644
--- a/drivers/pinctrl/meson/pinctrl-meson.c
+++ b/drivers/pinctrl/meson/pinctrl-meson.c
@@ -487,7 +487,7 @@ static int meson_pinconf_get(struct pinctrl_dev *pcdev, unsigned int pin,
 	case PIN_CONFIG_BIAS_PULL_DOWN:
 	case PIN_CONFIG_BIAS_PULL_UP:
 		if (meson_pinconf_get_pull(pc, pin) == param)
-			arg = 1;
+			arg = 60000;
 		else
 			return -EINVAL;
 		break;
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] pinctrl: meson: define the pull up/down resistor value as 60 kOhm
  2025-03-29 19:01 [PATCH] pinctrl: meson: define the pull up/down resistor value as 60 kOhm Martin Blumenstingl
@ 2025-03-31  6:41 ` neil.armstrong
  2025-04-15  7:48 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: neil.armstrong @ 2025-03-31  6:41 UTC (permalink / raw)
  To: Martin Blumenstingl, linux-amlogic, linux-gpio
  Cc: linux-kernel, linux-arm-kernel, linus.walleij

On 29/03/2025 20:01, Martin Blumenstingl wrote:
> The public datasheets of the following Amlogic SoCs describe a typical
> resistor value for the built-in pull up/down resistor:
> - Meson8/8b/8m2: not documented
> - GXBB (S905): 60 kOhm
> - GXL (S905X): 60 kOhm
> - GXM (S912): 60 kOhm
> - G12B (S922X): 60 kOhm
> - SM1 (S905D3): 60 kOhm
> 
> The public G12B and SM1 datasheets additionally state min and max
> values:
> - min value: 50 kOhm for both, pull-up and pull-down
> - max value for the pull-up: 70 kOhm
> - max value for the pull-down: 130 kOhm
> 
> Use 60 kOhm in the pinctrl-meson driver as well so it's shown in the
> debugfs output. It may not be accurate for Meson8/8b/8m2 but in reality
> 60 kOhm is closer to the actual value than 1 Ohm.
> 
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> ---
>   drivers/pinctrl/meson/pinctrl-meson.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c
> index 253a0cc57e39..e5a32a0532ee 100644
> --- a/drivers/pinctrl/meson/pinctrl-meson.c
> +++ b/drivers/pinctrl/meson/pinctrl-meson.c
> @@ -487,7 +487,7 @@ static int meson_pinconf_get(struct pinctrl_dev *pcdev, unsigned int pin,
>   	case PIN_CONFIG_BIAS_PULL_DOWN:
>   	case PIN_CONFIG_BIAS_PULL_UP:
>   		if (meson_pinconf_get_pull(pc, pin) == param)
> -			arg = 1;
> +			arg = 60000;
>   		else
>   			return -EINVAL;
>   		break;

Nice finding !

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] pinctrl: meson: define the pull up/down resistor value as 60 kOhm
  2025-03-29 19:01 [PATCH] pinctrl: meson: define the pull up/down resistor value as 60 kOhm Martin Blumenstingl
  2025-03-31  6:41 ` neil.armstrong
@ 2025-04-15  7:48 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2025-04-15  7:48 UTC (permalink / raw)
  To: Martin Blumenstingl
  Cc: linux-amlogic, linux-gpio, linux-kernel, linux-arm-kernel

On Sat, Mar 29, 2025 at 8:01 PM Martin Blumenstingl
<martin.blumenstingl@googlemail.com> wrote:

> The public datasheets of the following Amlogic SoCs describe a typical
> resistor value for the built-in pull up/down resistor:
> - Meson8/8b/8m2: not documented
> - GXBB (S905): 60 kOhm
> - GXL (S905X): 60 kOhm
> - GXM (S912): 60 kOhm
> - G12B (S922X): 60 kOhm
> - SM1 (S905D3): 60 kOhm
>
> The public G12B and SM1 datasheets additionally state min and max
> values:
> - min value: 50 kOhm for both, pull-up and pull-down
> - max value for the pull-up: 70 kOhm
> - max value for the pull-down: 130 kOhm
>
> Use 60 kOhm in the pinctrl-meson driver as well so it's shown in the
> debugfs output. It may not be accurate for Meson8/8b/8m2 but in reality
> 60 kOhm is closer to the actual value than 1 Ohm.
>
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>

Patch applied for fixes!

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-04-15  7:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-29 19:01 [PATCH] pinctrl: meson: define the pull up/down resistor value as 60 kOhm Martin Blumenstingl
2025-03-31  6:41 ` neil.armstrong
2025-04-15  7:48 ` Linus Walleij

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 NNTP newsgroup(s).