[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdYam=VTXHh--fnnC+R7g=7z_4wGT8bg+=n01gEMSa5Buw@mail.gmail.com>
Date: Wed, 28 Dec 2016 14:00:58 +0100
From: Linus Walleij <linus.walleij@...aro.org>
To: Bartosz Golaszewski <bgolaszewski@...libre.com>
Cc: Lars-Peter Clausen <lars@...afoo.de>,
Jonathan Cameron <jic23@...nel.org>,
Hartmut Knaack <knaack.h@....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>,
linux-devicetree <devicetree@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Kevin Hilman <khilman@...libre.com>,
Patrick Titiano <ptitiano@...libre.com>,
Neil Armstrong <narmstrong@...libre.com>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>
Subject: Re: [PATCH] iio: misc: add a generic regulator driver
On Tue, Dec 13, 2016 at 3:28 PM, Bartosz Golaszewski
<bgolaszewski@...libre.com> wrote:
> + Linus
>
> While the new GPIO interface would be very convenient - in our case we
> could simply name the lines appropriately in the device tree - I'm not
> sure this would be the correct approach.
>
> From this year's ELCE in Berlin I remember Linus suggested during his
> talk that it's always better to write a kernel driver. Also: this way
> the relevant GPIO lines would not be reserved for exclusive use by
> power switches.
>
> Linus - do you have any thoughts/suggestions on that subject?
If the probe you are power cycling has its own DT node and is
described as a device per se in the system, then it should have
a device driver grabbing and toggling its own GPIO line.
If the probe is only really known in userspace, and driven
from userspace, it's GPIO reset line should also be driven
from userspace, using the chardev ABI as you describe.
Whether something should have a userspace or kernelspace
driver is a gray area, admittedly. There are cases for both.
The general consideration would be reuse and deployment.
If you expect all users of this probe to always use libiio and
some other userspace, I guess userspace-only makes sense?
Yours,
Linus Walleij
Powered by blists - more mailing lists