Skip to content

Add support for 'tty-slaves' described by devicetree.

NeilBrown linux-devicetree lkml 1 version NAK

Status from this message: NAK - I certainly object to it being moved to uart. That's the wrong

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 30 repliesNAK

Patches in v1

#Subject and filesSizeRepliesApplied
1/3TTY: add support for "tty slave" devices.Documentation/devicetree/bindings/serial/of-serial.txt drivers/tty/tty_io.c+26 -017 replies
2/3TTY: add slave driver to power-on device via a regulator.Documentation/devicetree/bindings/serial/slave-reg.txt drivers/tty/Kconfig drivers/tty/Makefile +3 more+137 -08 replies
3/3TTY/slave: add driver for w2sg0004 GPSDocumentation/devicetree/bindings/serial/slave-w2sg0004.txt drivers/tty/slaves/Kconfig drivers/tty/slaves/Makefile +1 more+455 -15 replies

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchSebastian Reichel
1/3A-b
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] Add support for 'tty-slaves' described by devicetree.

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