summaryrefslogtreecommitdiffstats
path: root/include/linux/serdev.h
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2017-02-02 14:48:08 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-02-03 04:17:02 -0500
commitbed35c6dfa6a36233c3e1238a40dc1ae67955898 (patch)
tree03afb77346bfc39d88fd57600a3722a3fd09179a /include/linux/serdev.h
parentcd6484e1830be260abfba80a9c7d8f65531126d6 (diff)
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/serdev.h')
-rw-r--r--include/linux/serdev.h21
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)
238 238
239#endif /* CONFIG_SERIAL_DEV_BUS */ 239#endif /* CONFIG_SERIAL_DEV_BUS */
240 240
241/*
242 * serdev hooks into TTY core
243 */
244struct tty_port;
245struct tty_driver;
246
247#ifdef CONFIG_SERIAL_DEV_CTRL_TTYPORT
248struct device *serdev_tty_port_register(struct tty_port *port,
249 struct device *parent,
250 struct tty_driver *drv, int idx);
251void serdev_tty_port_unregister(struct tty_port *port);
252#else
253static inline struct device *serdev_tty_port_register(struct tty_port *port,
254 struct device *parent,
255 struct tty_driver *drv, int idx)
256{
257 return ERR_PTR(-ENODEV);
258}
259static inline void serdev_tty_port_unregister(struct tty_port *port) {}
260#endif /* CONFIG_SERIAL_DEV_CTRL_TTYPORT */
261
241#endif /*_LINUX_SERDEV_H */ 262#endif /*_LINUX_SERDEV_H */