linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: Eugeniu Rosca <roscaeugeniu@gmail.com>
Cc: Eugeniu Rosca <erosca@de.adit-jv.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Harish Jenny K N <harish_kandiga@mentor.com>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Balasubramani Vivekanandan 
	<balasubramani_vivekanandan@mentor.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Stephen Warren <swarren@nvidia.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Phil Reid <preid@electromag.com.au>,
	Enrico Weigelt <info@metux.net>,
	linux-gpio@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH V4 2/2] gpio: inverter: document the inverter bindings
Date: Mon, 7 Oct 2019 09:36:10 -0600	[thread overview]
Message-ID: <f4359c04-bb1d-6c4c-6725-90e661c1aab3@wwwdotorg.org> (raw)
In-Reply-To: <20191005175024.GA25394@x230>

On 10/5/19 11:50 AM, Eugeniu Rosca wrote:
> Hi Stephen,
> 
> On Fri, Oct 04, 2019 at 01:07:23PM -0600, Stephen Warren wrote:
> 
> [..]
> 
>> I think the DT should represent the device that's attached to the GPIOs.
>> That way, there's already a clear way to represent the GPIO polarity, as
>> described in the document linked by Eugenui in [2] below.
>>
>> If for some reason that's not possible, then I think keeping track of the
>> GPIO polarity in user-space is entirely reasonable, and is the correct
>> approach. To claim that tracking GPIO polarity in user-space is too much
>> burden, yet to also allow user-space to control GPIOs at all, and hence to
>> know exactly which GPIOs must be controlled, is an inconsistent assertion.
>>
>> Put another way: If a piece of user-space SW controls GPIOs, it must know
>> which GPIO number to use for each logical purpose. This information
>> presumably varies on different platforms, so the SW must have a list of GPIO
>> numbers and GPIO controller IDs per platform. Additionally storing a
>> polarity bit along with that information seems entirely trivial to me.
>>
>> Is there some other issue that I'm overlooking?
> 
> Based on the discussions so far, the user who requested this feature
> intends to (in fact already does) "mark" the userspace-relevant gpio
> lines via the "gpio-line-names" [5] DT property, implemented by Linus
> in v4.7 commit [6]. By keeping track of "gpio line name" both in DT and
> in user-space, apparently the user is able to accurately map the
> "line name" (visible in userspace) to the corresponding gpio chip/name
> and gpio line offset in a "platform/board-independent" way.
> 
> Do you think this is unorthodox?

No, that sounds reasonable.

Given that, it might be plausible to extend that DT scheme to represent 
more information, but it's still better to represent the actual end 
device (that's connected to the GPIO) in DT, since that also represents 
the semantics.

> [6] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fd9c55315db9

  reply	other threads:[~2019-10-07 15:36 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-28  9:30 [PATCH V4 2/2] gpio: inverter: document the inverter bindings Harish Jenny K N
2019-07-04  5:01 ` Harish Jenny K N
2019-07-08 22:36 ` Rob Herring
2019-07-09  5:25   ` Harish Jenny K N
2019-07-09 16:08     ` Rob Herring
2019-07-10  8:28       ` Harish Jenny K N
2019-07-17 13:51         ` Harish Jenny K N
2019-07-29 11:07           ` Harish Jenny K N
2019-08-05 11:15         ` Linus Walleij
2019-08-09 14:08           ` Rob Herring
2019-08-10  8:51             ` Linus Walleij
2019-08-19  9:36               ` Harish Jenny K N
2019-08-27  7:47                 ` Harish Jenny K N
2019-08-30  5:21                   ` Harish Jenny K N
2019-09-04  4:58                     ` Harish Jenny K N
2019-09-10  7:47                       ` Rob Herring
2019-09-11 12:52                         ` Harish Jenny K N
2019-09-25 16:51 ` Eugeniu Rosca
2019-09-27  5:52   ` Phil Reid
2019-09-27  9:07   ` Geert Uytterhoeven
2019-10-05 13:07     ` Eugeniu Rosca
2019-10-07  8:18       ` Geert Uytterhoeven
2019-10-11  4:35         ` Harish Jenny K N
2019-11-12 11:52           ` Harish Jenny K N
2019-11-12 12:19             ` Geert Uytterhoeven
2019-10-04 19:07   ` Stephen Warren
2019-10-05 17:50     ` Eugeniu Rosca
2019-10-07 15:36       ` Stephen Warren [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-06-28  5:20 [PATCH V4 0/2] Add Inverter controller for gpio configuration Harish Jenny K N
2019-06-28  5:20 ` [PATCH V4 2/2] gpio: inverter: document the inverter bindings Harish Jenny K N

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=f4359c04-bb1d-6c4c-6725-90e661c1aab3@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=balasubramani_vivekanandan@mentor.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=devicetree@vger.kernel.org \
    --cc=erosca@de.adit-jv.com \
    --cc=geert@linux-m68k.org \
    --cc=harish_kandiga@mentor.com \
    --cc=info@metux.net \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=preid@electromag.com.au \
    --cc=robh+dt@kernel.org \
    --cc=roscaeugeniu@gmail.com \
    --cc=swarren@nvidia.com \
    /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).