diff options
author | Rob Herring | 2017-02-02 20:48:08 +0100 |
---|---|---|
committer | Greg Kroah-Hartman | 2017-02-03 10:17:02 +0100 |
commit | bed35c6dfa6a36233c3e1238a40dc1ae67955898 (patch) | |
tree | 03afb77346bfc39d88fd57600a3722a3fd09179a /include/linux | |
parent | serdev: Introduce new bus for serial attached devices (diff) | |
download | kernel-qcow2-linux-bed35c6dfa6a36233c3e1238a40dc1ae67955898.tar.gz kernel-qcow2-linux-bed35c6dfa6a36233c3e1238a40dc1ae67955898.tar.xz kernel-qcow2-linux-bed35c6dfa6a36233c3e1238a40dc1ae67955898.zip |
serdev: add a tty port controller driver
Add a serdev controller driver for tty ports.
The controller is registered with serdev when tty ports are registered
with the TTY core. As the TTY core is built-in only, this has the side
effect of making serdev built-in as well.
Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-By: Sebastian Reichel <sre@kernel.org>
Tested-By: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/serdev.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/serdev.h b/include/linux/serdev.h index 3ac26c1a8aab..9519da6253a8 100644 --- a/include/linux/serdev.h +++ b/include/linux/serdev.h @@ -238,4 +238,25 @@ static inline int serdev_device_write_room(struct serdev_device *sdev) #endif /* CONFIG_SERIAL_DEV_BUS */ +/* + * serdev hooks into TTY core + */ +struct tty_port; +struct tty_driver; + +#ifdef CONFIG_SERIAL_DEV_CTRL_TTYPORT +struct device *serdev_tty_port_register(struct tty_port *port, + struct device *parent, + struct tty_driver *drv, int idx); +void serdev_tty_port_unregister(struct tty_port *port); +#else +static inline struct device *serdev_tty_port_register(struct tty_port *port, + struct device *parent, + struct tty_driver *drv, int idx) +{ + return ERR_PTR(-ENODEV); +} +static inline void serdev_tty_port_unregister(struct tty_port *port) {} +#endif /* CONFIG_SERIAL_DEV_CTRL_TTYPORT */ + #endif /*_LINUX_SERDEV_H */ |