From: "H. Peter Anvin" <hpa@zytor.com>
To: NeilBrown <neilb@suse.de>, Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: linux-serial@vger.kernel.org, linux-pm@vger.kernel.org,
lkml <linux-kernel@vger.kernel.org>
Subject: Re: Question: How to power-manage UART-attached devices.
Date: Mon, 30 Apr 2012 15:51:59 -0700 [thread overview]
Message-ID: <4F9F178F.3030408@zytor.com> (raw)
In-Reply-To: <20120501082209.0b560708@notabene.brown>
On 04/30/2012 03:22 PM, NeilBrown wrote:
>
> What I would really like is to integrate it closely with the state
> of the UART. i.e. if the /dev/ttyO1 device is open, then the GPS
> is "on". If not then it is "off". Similarly if /dev/tty/O0 is
> open, bluetooth is "on", else "off". However I cannot find any way
> to "plug in" to the tty or serial drivers to perform an arbitrary
> action on first-open or last-close. Is something like that
> possible? If not, is it a reasonable thing to ask? Any suggests
> about where to put such a hook?
>
I don't think that's the right interface. Just because the port is
currently open doesn't mean the device is active, nor vice versa. ALL
it means is that someone currently has an access handle to it.
Since a serial port models, well, a *port*, it is logical to think of
a (hypothetical) socket containing an RS-232 connector as well as a
power outlet. Given that, it would be logical to drive the "power
connector" using the same type of interface used for the other parts
of an RS-232 control, meaning either with termios flags or via a
dedicated control ioctl (TIOCPOWER?).
-hpa
next prev parent reply other threads:[~2012-04-30 22:51 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-30 22:22 Question: How to power-manage UART-attached devices NeilBrown
2012-04-30 22:33 ` Mark Brown
2012-04-30 23:35 ` NeilBrown
2012-05-01 16:33 ` Mark Brown
2012-05-01 23:15 ` NeilBrown
2012-05-02 9:02 ` Mark Brown
2012-04-30 22:51 ` H. Peter Anvin [this message]
2012-04-30 23:34 ` Alan Cox
2012-05-01 0:12 ` NeilBrown
2012-04-30 23:47 ` NeilBrown
2012-04-30 23:50 ` H. Peter Anvin
2012-05-01 0:27 ` NeilBrown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F9F178F.3030408@zytor.com \
--to=hpa@zytor.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=neilb@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).