public inbox for linux-gpio@vger.kernel.org
 help / color / mirror / Atom feed
From: Kent Gibson <warthog618@gmail.com>
To: Stefan Wahren <wahrenst@gmx.net>
Cc: Bartosz Golaszewski <brgl@bgdev.pl>, linux-gpio@vger.kernel.org
Subject: Re: pinctrl: Questions regarding pinconf_ops and bcm2835
Date: Sat, 20 Jan 2024 20:42:47 +0800	[thread overview]
Message-ID: <20240120124247.GB85986@rigel> (raw)
In-Reply-To: <102ae999-6574-4b14-a24b-826533b47a5d@gmx.net>

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
>

  reply	other threads:[~2024-01-20 12:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-20 11:34 pinctrl: Questions regarding pinconf_ops and bcm2835 Stefan Wahren
2024-01-20 12:42 ` Kent Gibson [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-01-03 12:12 Stefan Wahren
2024-01-08  7:33 ` Stefan Wahren

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=20240120124247.GB85986@rigel \
    --to=warthog618@gmail.com \
    --cc=brgl@bgdev.pl \
    --cc=linux-gpio@vger.kernel.org \
    --cc=wahrenst@gmx.net \
    /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