linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Marek Behún" <kabel@kernel.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-gpio@vger.kernel.org,
	Gregory Clement <gregory.clement@bootlin.com>,
	Rob Herring <robh@kernel.org>,
	Patrick Williams <alpawi@amazon.com>
Subject: A37xx PWM pinctrl definitions still (maybe?) not correct
Date: Thu, 16 Sep 2021 13:55:43 +0200	[thread overview]
Message-ID: <20210916135543.0193a30a@thinkpad> (raw)

Hi Linus,

the commit baf8d6899b1e [1] I sent in July, correcting PWM pinctrl
definitions for A37xx, is not correct (maybe?).

Before my commit, the code defined groups
  pwmN      with funcs   pwm gpio
  lenN_od   with funcs   led gpio

The first group is meant to switch the controller of the pin between
GPIO subsystem and PWM subsystem.
The second group sets what should happen if the output value set is 1:
whether it should be high (func gpio), or tri-stated (func led).

This means that previously it was possible to switch these
settings separately (although I don't know what would happen if both
groups were defined in DT with "gpio" function. Would only the first
setting get applied? Since both groups define the same pin number...)

Anyway, since both groups are controlling the same pin, in my above
mentioned commit I declared it semantically incorrect, and that it
should be only in one group. Thus I removed group ledN_od, and changed
group pwmN to have these functions:
  pwm   - pin controlled by pwm, 0 low, 1 high
  led   - pin STILL controlled by pwm, 0 low, 1 tristate
  gpio  - pin controlled by gpio, 0 low, 1 high

Basically what I am trying to say here is that when user selects the
"led" function, the pin is controlled by PWM. There is no way for the
user to set "tristate on 1" setting but keep the pin controllable via
GPIO subsystem.

What do you think of this? I still think there should be only one group
controlling one pin. But maybe someone will need to control the LED
with "tristate on 1" via GPIO. Should this be a separate, fourth
function, something like "gpio_led"?

Marek

[1]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=baf8d6899b1e8906dc076ef26cc633e96a8bb0c3

             reply	other threads:[~2021-09-16 11:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-16 11:55 Marek Behún [this message]
2021-09-19 19:21 ` A37xx PWM pinctrl definitions still (maybe?) not correct 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=20210916135543.0193a30a@thinkpad \
    --to=kabel@kernel.org \
    --cc=alpawi@amazon.com \
    --cc=gregory.clement@bootlin.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=robh@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;
as well as URLs for NNTP newsgroup(s).