public inbox for linux-gpio@vger.kernel.org
 help / color / mirror / Atom feed
* pinctrl: Questions regarding pinconf_ops and bcm2835
@ 2024-01-03 12:12 Stefan Wahren
  2024-01-08  7:33 ` Stefan Wahren
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Wahren @ 2024-01-03 12:12 UTC (permalink / raw)
  To: linux-gpio

Hi,
i recently noticed that the BCM2711 (used on Raspberry Pi 4) doesn't
implement pin_config_get, but this SOC is able to read back the bias
settings of the pins. After looking deeper into the pinconf_ops i had
some questions:

1. Are there any other benefits from implementing pin_config_get except
of a proper debugfs output?

2. Since the pin direction of BCM2835/2711 (input/output) is already
handled by pinmux_ops via gpio_set_direction, how should pin_config_set
handle PIN_CONFIG_OUTPUT_ENABLE?

3. In case pin_config_get is implemented should the parameter
PIN_CONFIG_OUTPUT_ENABLE and PIN_CONFIG_OUTPUT be handled?

Best regards



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

* Re: pinctrl: Questions regarding pinconf_ops and bcm2835
  2024-01-03 12:12 Stefan Wahren
@ 2024-01-08  7:33 ` Stefan Wahren
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Wahren @ 2024-01-08  7:33 UTC (permalink / raw)
  To: linux-gpio

Am 03.01.24 um 13:12 schrieb Stefan Wahren:
> Hi,
> i recently noticed that the BCM2711 (used on Raspberry Pi 4) doesn't
> implement pin_config_get, but this SOC is able to read back the bias
> settings of the pins. After looking deeper into the pinconf_ops i had
> some questions:
>
> 1. Are there any other benefits from implementing pin_config_get
> except of a proper debugfs output?
>
> 2. Since the pin direction of BCM2835/2711 (input/output) is already
> handled by pinmux_ops via gpio_set_direction, how should
> pin_config_set handle PIN_CONFIG_OUTPUT_ENABLE?
>
> 3. In case pin_config_get is implemented should the parameter
> PIN_CONFIG_OUTPUT_ENABLE and PIN_CONFIG_OUTPUT be handled?
>
> Best regards
>

gentle ping

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

* pinctrl: Questions regarding pinconf_ops and bcm2835
@ 2024-01-20 11:34 Stefan Wahren
  2024-01-20 12:42 ` Kent Gibson
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Wahren @ 2024-01-20 11:34 UTC (permalink / raw)
  To: Kent Gibson, Bartosz Golaszewski; +Cc: linux-gpio

Hi,
i recently noticed that the BCM2711 (used on Raspberry Pi 4) doesn't
implement pin_config_get, but this SOC is able to read back the bias
settings of the pins. After looking deeper into the pinconf_ops i had
some questions:

1. Are there any other benefits from implementing pin_config_get except
of a proper debugfs output?

2. Since the pin direction of BCM2835/2711 (input/output) is already
handled by pinmux_ops via gpio_set_direction, how should pin_config_set
handle PIN_CONFIG_OUTPUT_ENABLE?

3. In case pin_config_get is implemented should the parameter
PIN_CONFIG_OUTPUT_ENABLE and PIN_CONFIG_OUTPUT be handled?

Best regards




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

* Re: pinctrl: Questions regarding pinconf_ops and bcm2835
  2024-01-20 11:34 pinctrl: Questions regarding pinconf_ops and bcm2835 Stefan Wahren
@ 2024-01-20 12:42 ` Kent Gibson
  0 siblings, 0 replies; 4+ messages in thread
From: Kent Gibson @ 2024-01-20 12:42 UTC (permalink / raw)
  To: Stefan Wahren; +Cc: Bartosz Golaszewski, linux-gpio

On Sat, Jan 20, 2024 at 12:34:27PM +0100, Stefan Wahren wrote:
> Hi,
> i recently noticed that the BCM2711 (used on Raspberry Pi 4) doesn't
> implement pin_config_get, but this SOC is able to read back the bias
> settings of the pins. After looking deeper into the pinconf_ops i had
> some questions:
>
> 1. Are there any other benefits from implementing pin_config_get except
> of a proper debugfs output?
>

Didn't reply to your previous sends of this question (or even read it
TBH), as this is a pinctrl question, not GPIO, so not my area.

From the GPIO subsystem perspective, no, as gpiolib doesn't use the
pinctrl API (defined in include/linux/pinctrl/pinconf.h), it uses the
struct gpio_chip defined in include/linux/gpio/driver.h.

That has no equivalent to the pinctrl pin_config_get.

That perspective also applies to the character device uAPI and libgpiod,
which provide the userspace interface to the GPIO subsystem/gpiolib.
The value those return for the bias settings are what was set by the
user when requesting the line, not what is set in the hardware (as we
have no function to call to get it from the gpio_chip).

And now I have something else I should add to the next version of the
GPIO uAPI documentation that I'm working on.

That doesn't rule out there being other benefits, but none from the GPIO
perspective, AFAIAA.

Cheers,
Kent.

> 2. Since the pin direction of BCM2835/2711 (input/output) is already
> handled by pinmux_ops via gpio_set_direction, how should pin_config_set
> handle PIN_CONFIG_OUTPUT_ENABLE?
>
> 3. In case pin_config_get is implemented should the parameter
> PIN_CONFIG_OUTPUT_ENABLE and PIN_CONFIG_OUTPUT be handled?
>
> Best regards
>

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

end of thread, other threads:[~2024-01-20 12:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-20 11:34 pinctrl: Questions regarding pinconf_ops and bcm2835 Stefan Wahren
2024-01-20 12:42 ` Kent Gibson
  -- strict thread matches above, loose matches on Subject: below --
2024-01-03 12:12 Stefan Wahren
2024-01-08  7:33 ` Stefan Wahren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox