From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian Reichel Subject: [RFC 2/7] tty: add support for "tty slave" devices Date: Sat, 13 Aug 2016 05:14:33 +0200 Message-ID: <1471058078-5579-3-git-send-email-sre@kernel.org> References: <1471058078-5579-1-git-send-email-sre@kernel.org> Return-path: In-Reply-To: <1471058078-5579-1-git-send-email-sre@kernel.org> Sender: linux-kernel-owner@vger.kernel.org To: Sebastian Reichel , Tony Lindgren , Rob Herring , Mark Rutland , Marcel Holtmann , Greg Kroah-Hartman , Jiri Slaby Cc: Ville Tervo , =?UTF-8?q?Filip=20Matijevi=C4=87?= , Aaro Koskinen , Pavel Machek , =?UTF-8?q?Pali=20Roh=C3=A1r?= , ivo.g.dimitrov.75@gmail.com, linux-bluetooth@vger.kernel.org, linux-serial@vger.kernel.org, linux-omap@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, NeilBrown List-Id: devicetree@vger.kernel.org From: NeilBrown A "tty slave" is a device connected via UART. It may need a driver to, for example, power the device on when the tty is opened, and power it off when the tty is released. Signed-off-by: NeilBrown Signed-off-by: Sebastian Reichel --- Documentation/devicetree/bindings/serial/8250.txt | 4 ++++ drivers/tty/tty_io.c | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/Documentation/devicetree/bindings/serial/8250.txt b/Documentation/devicetree/bindings/serial/8250.txt index f5561ac7e17e..ecb74730f71b 100644 --- a/Documentation/devicetree/bindings/serial/8250.txt +++ b/Documentation/devicetree/bindings/serial/8250.txt @@ -46,6 +46,10 @@ Optional properties: line respectively. It will use specified GPIO instead of the peripheral function pin for the UART feature. If unsure, don't specify this property. +Optional child node: +- a device connected to the uart can be specified as child node with + compatible value. + Note: * fsl,ns16550: ------------ diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 734a635e7363..39ff5dcdfd50 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c @@ -95,6 +95,7 @@ #include #include #include +#include #include @@ -3317,6 +3318,11 @@ struct device *tty_register_device_attr(struct tty_driver *driver, retval = device_register(dev); if (retval) goto error; + if (device && device->of_node) + /* Children are platform devices and will be + * runtime_pm managed by this tty. + */ + of_platform_populate(device->of_node, NULL, NULL, dev); return dev; -- 2.8.1