[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180112194022.7da1e726@kemnade.info>
Date: Fri, 12 Jan 2018 19:40:35 +0100
From: Andreas Kemnade <andreas@...nade.info>
To: Johan Hovold <johan@...nel.org>
Cc: Mark Rutland <mark.rutland@....com>, devicetree@...r.kernel.org,
Discussions about the Letux Kernel
<letux-kernel@...nphoenux.org>,
Jonathan Cameron <jic23@...nel.org>,
Arnd Bergmann <arnd@...db.de>,
Tony Lindgren <tony@...mide.com>,
"H. Nikolaus Schaller" <hns@...delico.com>,
kernel@...a-handheld.com, Russell King <linux@...linux.org.uk>,
linux-kernel@...r.kernel.org, Thierry Reding <treding@...dia.com>,
Rob Herring <robh+dt@...nel.org>,
Kevin Hilman <khilman@...libre.com>,
Benoît Cousson <bcousson@...libre.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-omap@...r.kernel.org,
Andreas Färber <afaerber@...e.de>,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [Letux-kernel] [PATCH v5 3/5] misc serdev: Add w2sg0004 (gps
receiver) power control driver
On Fri, 12 Jan 2018 15:46:47 +0100
Johan Hovold <johan@...nel.org> wrote:
> On Tue, Jan 09, 2018 at 06:43:47PM +0100, Andreas Kemnade wrote:
> > On Fri, 22 Dec 2017 13:44:27 +0100
> > Johan Hovold <johan@...nel.org> wrote:
> >
> > [...]
> > > I'd suggest reiterating the problem you're trying to solve and
> > > enumerating the previously discussed potential solutions in order to
> > > find a proper abstraction level for this (before getting lost in
> > > implementation details).
> > >
> > The main point here is in short words: Having a device powered on or off
> > when the uart it is attached to, is used or not used anymore,
> > so the already available userspace applications do not need to be changed.
>
> So we'd end up with something in-between a kernel driver and a
> user-space solution. What about devices that need to be (partially)
> powered also when the port isn't open? A pure user-space solution would
> be able to handle all variants.
>
Well partly powered devices are at many places, And they hide that problem
from userspace, just get the open()/get() and close()/put() from there and power the
device accordingly.
So the question still remains why should the kernel hide some things and some
it should not.
If it all is in userspace, then there is still something needed in the devicetree
(if I understand correctly, every information about hardware which cannot be
auto-probed belongs into device tree) so that the userspace knows what kind of
device is at that port. So there can be a daemon powering on and off devices.
But that would break existing applications which just expect that they just need
to open/close the device.
Or you need to have some inotify handler in userspace and attach it there to
react on close() and open() of that device.
But this thing needs to have two kind of information:
1. the type of chip available to do the right powerup sequence.
2. how the chip is wired up to the cpu.
So to avoid having hardware information spread all over the table at least
these information would need to be in devicetree. But that also all feels
like a hack and hard to maintain.
Regards,
Andreas
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists