devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Add support for 'tty-slaves' described by devicetree.
@ 2014-12-11 21:59 NeilBrown
  2014-12-11 21:59 ` [PATCH 2/3] TTY: add slave driver to power-on device via a regulator NeilBrown
                   ` (2 more replies)
  0 siblings, 3 replies; 34+ messages in thread
From: NeilBrown @ 2014-12-11 21:59 UTC (permalink / raw)
  To: Grant Likely, Greg Kroah-Hartman, Mark Rutland, Jiri Slaby
  Cc: devicetree, linux-kernel

Greetings TTY and Devicetree folks.

On my phone (GTA04) there are two devices which are each accessed via
a UART: the bluetooth module and the GPS.

I would like these to be powered on when the relevant /dev/ttyXX
is opened, and to be powered off when the tty is closed.

This patch series adds support for "tty slaves" and creates two
appropriate drivers of this type.

A "tty slave" is a platform device which is primarily attached by a
TTY (i.e. a uart).  Like other platform devices it might have other
interconnections like gpios and regulators etc.

In devicetree, any child node of a uart with a 'compatible' attribute
is treated as a 'tty slave'.  This means that it is probed like any
other platform device.  Also, when the tty is opened the device is
powered on by taking a pm_runtime reference..  Similarly when the tty is
closed the pm_runtime reference is dropped.

One of the drivers is a generic "tty-regulator" drive which simply
enables a regulator when powered on, and disables it when no longer
in use.  This suffices for my bluetooth device.

The other handles the slightly awkward details of powering on my
particular GPS as well as a regulator which powers the antenna.
It also registers an 'rfkill' which can power-off the antenna
independently of the TTY.

Comments and review most welcome.

Thanks,
NeilBrown


---

NeilBrown (3):
      TTY: add support for "tty slave" devices.
      TTY: add slave driver to power-on device via a regulator.
      TTY/slave: add driver for w2sg0004 GPS


 .../devicetree/bindings/serial/of-serial.txt       |    4 
 .../devicetree/bindings/serial/slave-reg.txt       |   18 +
 .../devicetree/bindings/serial/slave-w2sg0004.txt  |   35 ++
 drivers/tty/Kconfig                                |    2 
 drivers/tty/Makefile                               |    1 
 drivers/tty/slaves/Kconfig                         |   18 +
 drivers/tty/slaves/Makefile                        |    3 
 drivers/tty/slaves/tty-reg.c                       |  102 +++++
 drivers/tty/slaves/tty-w2sg0004.c                  |  412 ++++++++++++++++++++
 drivers/tty/tty_io.c                               |   22 +
 10 files changed, 617 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/serial/slave-reg.txt
 create mode 100644 Documentation/devicetree/bindings/serial/slave-w2sg0004.txt
 create mode 100644 drivers/tty/slaves/Kconfig
 create mode 100644 drivers/tty/slaves/Makefile
 create mode 100644 drivers/tty/slaves/tty-reg.c
 create mode 100644 drivers/tty/slaves/tty-w2sg0004.c

--
Signature

^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2015-01-05 16:28 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-11 21:59 [PATCH 0/3] Add support for 'tty-slaves' described by devicetree NeilBrown
2014-12-11 21:59 ` [PATCH 2/3] TTY: add slave driver to power-on device via a regulator NeilBrown
     [not found]   ` <20141211215944.4127.4186.stgit-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
2014-12-11 22:58     ` Sebastian Reichel
2014-12-12  0:46       ` Marcel Holtmann
2014-12-12  1:31         ` Sebastian Reichel
2014-12-12  5:01       ` NeilBrown
2014-12-11 23:32     ` Peter Hurley
2014-12-12  5:27       ` NeilBrown
     [not found]         ` <20141212162714.3a2378df-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
2014-12-12 11:59           ` Peter Hurley
2014-12-12 12:05   ` Grant Likely
2014-12-11 21:59 ` [PATCH 1/3] TTY: add support for "tty slave" devices NeilBrown
     [not found]   ` <20141211215943.4127.24792.stgit-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
2014-12-11 22:41     ` Sebastian Reichel
2014-12-11 23:18     ` Peter Hurley
     [not found]       ` <548A264D.8070103-WaGBZJeGNqdsbIuE7sb01tBPR1lH4CV8@public.gmane.org>
2014-12-12  5:23         ` NeilBrown
     [not found]           ` <20141212162352.66be5b5e-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
2014-12-12 13:02             ` Peter Hurley
2014-12-13 14:23               ` One Thousand Gnomes
     [not found]                 ` <20141213142344.61372b92-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org>
2014-12-16 16:14                   ` Peter Hurley
2014-12-13 14:12         ` One Thousand Gnomes
2014-12-12 11:59   ` Grant Likely
2014-12-13 17:46     ` Sebastian Reichel
2014-12-13 22:22       ` Grant Likely
2014-12-28 14:20   ` Pavel Machek
2015-01-02 21:33     ` NeilBrown
2015-01-04 10:18       ` Pavel Machek
2015-01-05  7:09         ` NeilBrown
     [not found]           ` <20150105200936.2ba8f596-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
2015-01-05 13:43             ` Pavel Machek
2015-01-05 15:41       ` One Thousand Gnomes
2015-01-05 16:28         ` Pavel Machek
2014-12-11 21:59 ` [PATCH 3/3] TTY/slave: add driver for w2sg0004 GPS NeilBrown
     [not found]   ` <20141211215944.4127.57146.stgit-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
2014-12-11 23:04     ` Sebastian Reichel
2014-12-11 23:11     ` One Thousand Gnomes
     [not found]       ` <20141211231100.05782a30-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org>
2014-12-12  5:06         ` NeilBrown
     [not found]           ` <20141212160607.361d20db-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
2014-12-15 11:39             ` One Thousand Gnomes
2014-12-12 12:11   ` Grant Likely

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).