Thread (12 messages) 12 messages, 4 authors, 2012-05-02

Re: Question: How to power-manage UART-attached devices.

From: NeilBrown <hidden>
Date: 2012-05-01 00:28:04
Also in: lkml

On Mon, 30 Apr 2012 16:50:16 -0700 "H. Peter Anvin" [off-list ref] wrote:
On 04/30/2012 04:47 PM, NeilBrown wrote:
quoted
I imagine this proposal as being like a virtual DTR line.  It may
not always be appropriate to connect DTR to the power switch, but
sometimes it is.
Yeah, that's pretty much what I'm suggesting.

	-hpa
Yes, so you are :-)

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.

So I think I want to:
 1/ teach omap-serial to drive a given GPIO as a DTR line
 2/ write a 'gpio-regulator' driver which provides a single GPIO and
    turns a given regulator 'on' or 'off' depending on the state of the GPIO
 3/ write a special-purpose GPIO driver which provides a single GPIO
    and toggles another GPIO whenever the state of the first changes, and also
    monitors the serial RX pin when the device should be 'off', and toggles
    again if it sees RX activity.
 4/ Keeping using rfkill to power the GPS antenna.

Sounds like a plan.

Thanks,
NeilBrown

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help