From: Sudeep Holla <sudeep.holla@arm.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Bartosz Golaszewski <brgl@bgdev.pl>,
Dan Carpenter <dan.carpenter@linaro.org>,
Sudeep Holla <sudeep.holla@arm.com>,
Cristian Marussi <cristian.marussi@arm.com>,
linux-gpio@vger.kernel.org, linux-sound@vger.kernel.org
Subject: Re: [PATCH] pinctrl: generic: rename PIN_CONFIG_OUTPUT to LEVEL
Date: Fri, 5 Sep 2025 11:38:37 +0100 [thread overview]
Message-ID: <20250905-pristine-bronze-avocet-2d9e0e@sudeepholla> (raw)
In-Reply-To: <20250905-output-value-just-value-v1-1-c9dd1a172d62@linaro.org>
On Fri, Sep 05, 2025 at 11:21:50AM +0200, Linus Walleij wrote:
> This generic pin config property is confusingly named so let's
> rename it to make things clearer.
>
> There are already drivers in the tree that use PIN_CONFIG_OUTPUT
> to *read* the value of an output driven pin, which is a big
> semantic confusion for the head: are we then reading the
> setting of the output or the actual value/level that is put
> out on the pin?
>
> We already have PIN_CONFIG_OUTPUT_ENABLE that turns on driver
> buffers for output, so this can by logical conclusion only
> drive the voltage level if it should be any different.
>
> But if we read the pin, are we then reading the *setting* of
> the output value or the *actual* value we can see on the
> line?
>
> If the pin has not first been set into output mode with
> PIN_CONFIG_OUTPUT_ENABLE, but is instead in some input mode
> or tristate, what will reading this property actually
> return?
>
> Reading the current users reading this property it is clear
> that what we read is the logical level of the pin as 0 or 1
> depending on if it is low or high.
>
> Rename it to PIN_CONFIG_LEVEL so it is crystal clear that
> we set or read the voltage level of the pin and nothing else.
>
For the SCMI part specifically and in general for the renaming as it
improved readability:
Acked-by: Sudeep Holla <sudeep.holla@arm.com>
--
Regards,
Sudeep
next prev parent reply other threads:[~2025-09-05 10:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-05 9:21 [PATCH] pinctrl: generic: rename PIN_CONFIG_OUTPUT to LEVEL Linus Walleij
2025-09-05 10:38 ` Sudeep Holla [this message]
2025-09-08 12:16 ` Linus Walleij
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=20250905-pristine-bronze-avocet-2d9e0e@sudeepholla \
--to=sudeep.holla@arm.com \
--cc=brgl@bgdev.pl \
--cc=cristian.marussi@arm.com \
--cc=dan.carpenter@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-sound@vger.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