All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] UART slave device support - version 4
@ 2015-05-11  1:56 NeilBrown
  2015-05-11  1:56 ` [PATCH 1/4] TTY: use class_find_device to find port in uart_suspend/resume NeilBrown
                   ` (6 more replies)
  0 siblings, 7 replies; 125+ messages in thread
From: NeilBrown @ 2015-05-11  1:56 UTC (permalink / raw)
  To: Mark Rutland, One Thousand Gnomes, Peter Hurley, Arnd Bergmann,
	Greg Kroah-Hartman, Sebastian Reichel, Rob Herring, Pavel Machek,
	Grant Likely, Jiri Slaby
  Cc: GTA04 owners, devicetree, linux-kernel

Hi all,
 here is version 4 of my "UART slave device" patch set, previously
 known as "tty slave devices".

 The most obvious change is the name.  I realized that this isn't
 really about "tty"s at all - it is about UARTs.

 When a device is connected to a UART via RS-232 (or similar), there
 is a DTR line that can be used for power management, and other "modem
 control" lines.

 On an embedded board, it is very likely that there is no "DTR", and
 any power management need to be done using some completely separate
 mechanism.

 So these "slaves" are really just for devices permanently attached to
 UARTs without a full "RS-232" (or similar) connection.  The driver
 does all the extra control beyond Tx/Rx.

 The core serial code now "initializes" the "tty device" but may not
 "add" it.
 If it successfully finds a slave device, it gives the tty device to
 the slave.  If not, it calls "device_add()" itself.

 The slave device is responsible for adding the tty device when it is
 ready.

 There are two things that I'm not entirely happy with.

 Firstly there is the "uart_slave_activate()" call in tty_init_dev().
 Possibly this belongs more in tty_driver_install_tty(), but it is a
 bit out-off-place in either.
 To make it really clean I think I would need to create my own
 "tty_driver" which mirrors the one supplied by the uart but has a
 few little modification.  But that seems like a lot of clumsy work
 for very little gain.

 Secondly, between the creation of the slave device and the binding of
 a driver to it I'm holding an extra reference to the "tty_driver".
 This is to prevent calls to destruct_tty_driver().
 destruct_tty_driver() will unregister all the tty devices.
 But it cannot get at the uart_slave devices.
 I'm not at all sure I have the device unregistering side of things
 right.  As I was writing the code I imagined that I could arrange it
 so that then the tty was unregistered, that would drop the last ref
 on the slave and it would go away... I don't think that is right
 after all.  So that bit needs more work.

 Should the slave devices only be removed when the "uart_slave_core"
 modules is removed?

 And I'd very much like comment on the changed to be uart-based
 rather than tty-based.

 I've tested this set and it seems to work ... except that something
 is sadly broken with bluetooth support in 4.1-rc1 so I've only really
 tested the GPS driver.  I guess it is time to rebase to -rc3.


Thanks,
NeilBrown

---

NeilBrown (4):
      TTY: use class_find_device to find port in uart_suspend/resume.
      TTY: split tty_register_device_attr into 'initialize' and 'add' parts.
      TTY: add support for uart_slave devices.
      tty/slaves: add a driver to power on/off UART attached devices.


 .../bindings/uart_slave/wi2wi,w2cbw003.txt         |   19 +
 .../bindings/uart_slave/wi2wi,w2sg0004.txt         |   37 +
 .../devicetree/bindings/vendor-prefixes.txt        |    1 
 drivers/tty/serial/Kconfig                         |    1 
 drivers/tty/serial/Makefile                        |    2 
 drivers/tty/serial/serial_core.c                   |   30 +
 drivers/tty/serial/slave/Kconfig                   |   21 +
 drivers/tty/serial/slave/Makefile                  |    3 
 drivers/tty/serial/slave/serial-power-manager.c    |  510 ++++++++++++++++++++
 drivers/tty/serial/slave/uart_slave_core.c         |  168 +++++++
 drivers/tty/tty_io.c                               |  111 +++-
 drivers/tty/tty_port.c                             |   24 +
 include/linux/tty.h                                |   10 
 include/linux/uart_slave.h                         |   29 +
 14 files changed, 918 insertions(+), 48 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/uart_slave/wi2wi,w2cbw003.txt
 create mode 100644 Documentation/devicetree/bindings/uart_slave/wi2wi,w2sg0004.txt
 create mode 100644 drivers/tty/serial/slave/Kconfig
 create mode 100644 drivers/tty/serial/slave/Makefile
 create mode 100644 drivers/tty/serial/slave/serial-power-manager.c
 create mode 100644 drivers/tty/serial/slave/uart_slave_core.c
 create mode 100644 include/linux/uart_slave.h

--
Signature


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

end of thread, other threads:[~2016-01-25 10:37 UTC | newest]

Thread overview: 125+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-11  1:56 [PATCH 0/4] UART slave device support - version 4 NeilBrown
2015-05-11  1:56 ` [PATCH 1/4] TTY: use class_find_device to find port in uart_suspend/resume NeilBrown
2015-05-11  1:56 ` [PATCH 3/4] TTY: add support for uart_slave devices NeilBrown
2015-05-12  8:31   ` Paul Bolle
2015-05-12 23:35     ` NeilBrown
2015-05-12 23:35       ` NeilBrown
2015-05-11  1:56 ` [PATCH 4/4] tty/slaves: add a driver to power on/off UART attached devices NeilBrown
2015-05-11  1:56   ` NeilBrown
2015-05-11  1:56 ` [PATCH 2/4] TTY: split tty_register_device_attr into 'initialize' and 'add' parts NeilBrown
2015-05-31 22:01 ` [PATCH 0/4] UART slave device support - version 4 Greg Kroah-Hartman
2015-08-07 13:01 ` Linus Walleij
2015-08-07 13:01   ` Linus Walleij
2015-08-11 23:20   ` NeilBrown
2015-08-28  5:52     ` [Gta04-owner] " Dr. H. Nikolaus Schaller
2015-08-28  5:52       ` Dr. H. Nikolaus Schaller
2015-08-28  7:02       ` Pavel Machek
2015-08-28  7:02         ` Pavel Machek
2015-08-28  9:43         ` Dr. H. Nikolaus Schaller
2015-08-28  9:43           ` Dr. H. Nikolaus Schaller
2015-08-28 11:04           ` Pavel Machek
2015-08-28 11:04             ` Pavel Machek
2015-08-28 20:04             ` Christ van Willegen
2015-08-28 20:04               ` Christ van Willegen
2016-01-12 13:06 ` Tomeu Vizoso
2016-01-12 13:06   ` Tomeu Vizoso
2016-01-12 13:28   ` [Gta04-owner] " H. Nikolaus Schaller
2016-01-12 13:28     ` H. Nikolaus Schaller
2016-01-13 19:15     ` Mark Rutland
2016-01-13 19:15       ` Mark Rutland
2016-01-15  9:34       ` H. Nikolaus Schaller
2016-01-15 11:01         ` Mark Rutland
2016-01-15 11:01           ` Mark Rutland
2016-01-15 15:05           ` H. Nikolaus Schaller
2016-01-15 15:05             ` H. Nikolaus Schaller
2016-01-15 15:43             ` Andrey Vostrikov
2016-01-15 15:43               ` Andrey Vostrikov
2016-01-15 16:08               ` H. Nikolaus Schaller
2016-01-15 16:08                 ` H. Nikolaus Schaller
2016-01-15 17:16                 ` Peter Hurley
2016-01-15 17:16                   ` Peter Hurley
2016-01-15 17:32                   ` H. Nikolaus Schaller
2016-01-15 17:32                     ` H. Nikolaus Schaller
2016-01-15 17:43                     ` Peter Hurley
2016-01-15 17:43                       ` Peter Hurley
2016-01-15 17:58                       ` H. Nikolaus Schaller
2016-01-15 17:58                         ` H. Nikolaus Schaller
2016-01-15 19:23                         ` Peter Hurley
2016-01-15 19:23                           ` Peter Hurley
2016-01-15 21:24                           ` H. Nikolaus Schaller
2016-01-15 21:24                             ` H. Nikolaus Schaller
2016-01-15 22:40                   ` Rob Herring
2016-01-15 22:40                     ` Rob Herring
2016-01-16  7:34                     ` Vostrikov Andrey
2016-01-16  7:34                       ` Vostrikov Andrey
2016-01-16 23:31                       ` Rob Herring
2016-01-16 23:31                         ` Rob Herring
2016-01-17  8:53                         ` H. Nikolaus Schaller
2016-01-17  8:53                           ` H. Nikolaus Schaller
2016-01-17 14:19                           ` One Thousand Gnomes
2016-01-17 14:19                             ` One Thousand Gnomes
2016-01-17 17:57                             ` H. Nikolaus Schaller
2016-01-17 17:57                               ` H. Nikolaus Schaller
2016-01-17 19:38                               ` One Thousand Gnomes
2016-01-17 19:38                                 ` One Thousand Gnomes
2016-01-18  8:17                                 ` H. Nikolaus Schaller
2016-01-18  8:17                                   ` H. Nikolaus Schaller
2016-01-18  8:56                                   ` Andrey Vostrikov
2016-01-18  8:56                                     ` Andrey Vostrikov
2016-01-18 11:52                                     ` H. Nikolaus Schaller
2016-01-18 11:52                                       ` H. Nikolaus Schaller
2016-01-18 11:19                                   ` One Thousand Gnomes
2016-01-18 11:19                                     ` One Thousand Gnomes
2016-01-18 20:58                                     ` H. Nikolaus Schaller
2016-01-18 20:58                                       ` H. Nikolaus Schaller
2016-01-18 22:03                                       ` One Thousand Gnomes
2016-01-18 22:03                                         ` One Thousand Gnomes
2016-01-18 22:32                                         ` H. Nikolaus Schaller
2016-01-18 22:32                                           ` H. Nikolaus Schaller
2016-01-19 14:25                                           ` One Thousand Gnomes
2016-01-19 14:25                                             ` One Thousand Gnomes
2016-01-20 17:33                                             ` H. Nikolaus Schaller
2016-01-20 17:33                                               ` H. Nikolaus Schaller
2016-01-20 16:11                                           ` H. Nikolaus Schaller
2016-01-20 16:11                                             ` H. Nikolaus Schaller
2016-01-20 17:46                                             ` One Thousand Gnomes
2016-01-20 17:46                                               ` One Thousand Gnomes
2016-01-20 18:03                                               ` H. Nikolaus Schaller
2016-01-20 18:03                                                 ` H. Nikolaus Schaller
2016-01-21 10:01                                                 ` Radek Polak
2016-01-22 15:45                                                 ` Tomeu Vizoso
2016-01-22 15:45                                                   ` Tomeu Vizoso
2016-01-22 16:49                                                   ` Rob Herring
2016-01-22 16:49                                                     ` Rob Herring
2016-01-22 20:12                                                   ` One Thousand Gnomes
2016-01-22 20:12                                                     ` One Thousand Gnomes
2016-01-23  7:40                                                     ` Andreas Kemnade
2016-01-23  7:40                                                       ` Andreas Kemnade
2016-01-23 12:19                                                     ` H. Nikolaus Schaller
2016-01-23 12:19                                                       ` H. Nikolaus Schaller
2016-01-23 17:28                                                       ` One Thousand Gnomes
2016-01-23 17:28                                                         ` One Thousand Gnomes
2016-01-23 22:04                                                         ` H. Nikolaus Schaller
2016-01-23 22:04                                                           ` H. Nikolaus Schaller
2016-01-24 17:10                                                           ` One Thousand Gnomes
2016-01-24 17:10                                                             ` One Thousand Gnomes
2016-01-25 10:36                                                             ` H. Nikolaus Schaller
2016-01-25 10:36                                                               ` H. Nikolaus Schaller
2016-01-19  6:32                                         ` Andreas Kemnade
2016-01-19  6:32                                           ` Andreas Kemnade
2016-01-20 19:38                       ` Dmitry Torokhov
2016-01-20 19:38                         ` Dmitry Torokhov
2016-01-20 20:09                         ` Vostrikov Andrey
2016-01-20 20:09                           ` Vostrikov Andrey
2016-01-15 16:12             ` Mark Rutland
2016-01-15 16:12               ` Mark Rutland
2016-01-15 19:16               ` H. Nikolaus Schaller
2016-01-15 19:16                 ` H. Nikolaus Schaller
2016-01-15 19:40         ` Pavel Machek
2016-01-15 19:40           ` Pavel Machek
2016-01-15 20:35           ` H. Nikolaus Schaller
2016-01-15 20:35             ` H. Nikolaus Schaller
2016-01-12 21:28   ` NeilBrown
2016-01-12 21:28     ` NeilBrown
2016-01-13 19:00     ` Pavel Machek
2016-01-13 19:00       ` Pavel Machek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.