[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACRpkdZRGygeNjK=mujT-veCW+oC_vEED9Z0fSiMxFrDT0hqzA@mail.gmail.com>
Date: Mon, 2 Jan 2017 22:53:54 +0100
From: Linus Walleij <linus.walleij@...aro.org>
To: Jonathan Cameron <jic23@...nel.org>
Cc: Sebastian Reichel <sre@...nel.org>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
Hartmut Knaack <knaack.h@....de>,
Lars-Peter Clausen <lars@...afoo.de>,
Peter Meerwald-Stadler <pmeerw@...erw.net>,
Rob Herring <robh+dt@...nel.org>,
Mark Rutland <mark.rutland@....com>,
"linux-iio@...r.kernel.org" <linux-iio@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Kevin Hilman <khilman@...libre.com>,
Patrick Titiano <ptitiano@...libre.com>,
Neil Armstrong <narmstrong@...libre.com>,
Alexandre Courbot <gnurou@...il.com>,
"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
Mark Brown <broonie@...nel.org>,
Liam Girdwood <lgirdwood@...il.com>
Subject: Re: [PATCH 2/2] iio: misc: add support for GPIO power switches
On Fri, Dec 30, 2016 at 4:15 PM, Jonathan Cameron <jic23@...nel.org> wrote:
> On 30/12/16 13:05, Linus Walleij wrote:
>> So this needs to be re-architected to either describe the remote system
>> in DT and handle it in the kernel, or handle it all from userspace if it
>> is a one-off non-product thing.
>
> I'm not sure this is always true (though it might be here). There is always
> a need to describe the edge of the known world. Be it that we have
> an accelerometer - ultimately we could describe the device generating the
> acceleration but we have no way of knowing what it is or what it will do..
>
> What we have here is a rather simple case, but what about an I/O bank on
> a PLC. Obviously we can handle that as a bunch of GPIOs but if we know
> more about it we should have means to describe that. Say we know they are
> always driving relays, we should be able to describe that additional known
> stuff. Relays have characteristics such as bounce times etc that if described
> would allow us to do the relevant filtering on inputs to handle this.
>
> Here the fact it is a power supply switch should be describable. Hard to
> get right in a generic way though so in cases like this perhaps you
> are right and it should just be left undescribed and handled in userspace.
>
> Anyhow, here I think leaving it as a gpio interface is probably the way to
> go, but I'm not sure that will always be the case.
No you are right. We are at the fuzzy system perimeter.
For GPIO we currently only have asserted/unasserted, polarity
of that, open drain/source and debounce time. But we will need the whole
slew of pin control settings in the future: drive strength, schmitt-trigger
hysteresis etc etc. And if there is a further component beyond that it
may need a driver in turn even if it is "only" a relay.
Let's see about this one...
Yours,
Linus Walleij
Powered by blists - more mailing lists