From: NeilBrown <neil@brown.name>
To: Mark Rutland <mark.rutland@arm.com>,
One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>,
Peter Hurley <peter@hurleysoftware.com>,
Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Sebastian Reichel <sre@kernel.org>,
Rob Herring <robherring2@gmail.com>, Pavel Machek <pavel@ucw.cz>,
Grant Likely <grant.likely@linaro.org>,
Jiri Slaby <jslaby@suse.cz>
Cc: GTA04 owners <gta04-owner@goldelico.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 0/4] UART slave device support - version 4
Date: Mon, 11 May 2015 11:56:14 +1000 [thread overview]
Message-ID: <20150511013540.5709.93626.stgit@notabene.brown> (raw)
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
next reply other threads:[~2015-05-11 1:59 UTC|newest]
Thread overview: 125+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-11 1:56 NeilBrown [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150511013540.5709.93626.stgit@notabene.brown \
--to=neil@brown.name \
--cc=arnd@arndb.de \
--cc=devicetree@vger.kernel.org \
--cc=gnomes@lxorguk.ukuu.org.uk \
--cc=grant.likely@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=gta04-owner@goldelico.com \
--cc=jslaby@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=pavel@ucw.cz \
--cc=peter@hurleysoftware.com \
--cc=robherring2@gmail.com \
--cc=sre@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.