1 May 2012 01:35
Re: Question: How to power-manage UART-attached devices.
NeilBrown <neilb <at> suse.de>
2012-04-30 23:35:59 GMT
2012-04-30 23:35:59 GMT
On Mon, 30 Apr 2012 23:33:22 +0100 Mark Brown
<broonie <at> opensource.wolfsonmicro.com> wrote:
> On Tue, May 01, 2012 at 08:22:09AM +1000, NeilBrown wrote:
>
> > The question is how can user-space tell the kernel that these devices are
> > 'inactive'?
>
> > I would like to integrate this into Linux in the most "natural" way that I
> > can but am having trouble. My current approach involves using "rfkill" but
> > that doesn't work very well for reasons that are probably not very relevant
> > here. It probably does make sense for powering the GPS antenna, but not
> > much else.
>
> The userspace consumer was added for users like this that live entirely
> in userspace.
Hi Mark,
thanks for the reply.
I assume you mean REGULATOR_VIRTUAL_CONSUMER (drivers/regulator/virtual.c)?
The one where the Kconfig entry says:
This is mainly useful for test purposes.
That certainly was useful for test purposes but I want to move beyond
testing.
One of the purposes of an operating system is to provide useful abstractions
and hide irrelevant details, so I don't want user-space to have to
(Continue reading)
I was distracted by the TIOCPOWER suggestion, and I really didn't want any
new action by user-space, I would much prefer it all "just works".
But you also mentioned "termios flags" but by that I suspect you are
referring to HUPCL which is documented as:
HUPCL Lower modem control lines after last process closes the device
(hang up).
without really saying which modem control lines. Looking at the code it
seems to be talking about DTR and RTS. It only says "lower on last close"
but doesn't say "raise on first open" but maybe that is assumed.
So as long as HUPCL is the default, defining a virtual DTR line might be just
what I want, and HUPCL could be disabled of someone want to keep the device
powered on while it is closed.

RSS Feed