From: Richard Genoud <richard.genoud@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"Nicolas Ferre" <nicolas.ferre@atmel.com>,
"Linus Walleij" <linus.walleij@linaro.org>,
"Alexander Shiyan" <shc_work@mail.ru>,
linux-serial@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
"Richard Genoud" <richard.genoud@gmail.com>
Subject: [PATCH v4 0/5] tty/serial: Add helpers to use GPIOs to control modem lines and implement atmel_serial.c
Date: Wed, 26 Feb 2014 17:19:43 +0100 [thread overview]
Message-ID: <1393431588-25977-1-git-send-email-richard.genoud@gmail.com> (raw)
The USART controller on sam9x5 chips (and also all AT91/SAMA5 chips
but at91rm9200) are not capable of handling DTR/DSR/DCD/RI signal.
Moreover, even if the controller can handle CTS/RTS, the dedicated
CTS/RTS pins are already muxed for other peripherals (LCDC/EMAC/MMC).
So this patchset adds the possibility to control those lines via GPIO,
as it is done for RTS in the patch "switch atmel serial to use gpiolib"
As it was suggested by Alexander Shiyan, I made that available for
every board.
Patch 1 implements the generic helpers to control modem lines via GPIO
Patches 2 and 3 are just a little tidy up of atmel_serial.c.
Patch 4 implements modem control lines in atmel_serial atmel_serial.
Patch 5 implement the interrupts of CTS/DSR/DCD/RI.
This is based on next-20140226 + [PATCH v3 5/7] ARM: at91: gpio: implement get_direction
That Nicolas (has/will/might) appl(ied/y) on AT91 tree.
Tested on at91sam9g35, with a null modem cable between 2 serial ports,
one with CTS/RTS controlled by the USART controller, the other via GPIO,
full duplex transfers.
Did some tests also with null modem cables on a PC, and with real modems.
Updates from v3:
- add static keyword on struct uart0_gpios_table.
- add use an index at the mctrl_gpio_init() function to make it
usable by driver that allocates several ports at once.
- hide struct gpio_desc from users.
- patch "pinctrl: at91: implement get_direction" has been picked by Linus.
- patch "ARM: at91: gpio: implement get_direction" has been acked by Linus.
Updates from v2:
- remove UART_GPIO_MIN/UART_GPIO_MAX_INPUT and use a direction
boolean instead.
- implement get_direction in at91 pinctrl and mach-at91/gpio.c.
- remove the get_mctrl_gpio_name() function that was used for
logs only.
- split atmel_serial.c patch in 2.
- use a gpio lookup table to declare modem gpios in platform
devices boards. So there's no more special case for platform
data gpios in atmel_serial.c.
Updates from v1:
- Instead of controlling modem signal only on atmel board, the
code is now available for every board.
- The active low flag from device tree is now used.
Richard Genoud (5):
tty/serial: Add GPIOLIB helpers for controlling modem lines
tty/serial: at91: use dev_err instead of printk
tty/serial: at91: remove unused open/close hooks
tty/serial: at91: use mctrl_gpio helpers
tty/serial: at91: add interrupts for modem control lines
Documentation/serial/driver | 25 +++
arch/arm/mach-at91/at91rm9200_devices.c | 16 +-
arch/arm/mach-at91/at91sam9260_devices.c | 7 -
arch/arm/mach-at91/at91sam9261_devices.c | 4 -
arch/arm/mach-at91/at91sam9263_devices.c | 4 -
arch/arm/mach-at91/at91sam9g45_devices.c | 5 -
arch/arm/mach-at91/at91sam9rl_devices.c | 5 -
drivers/tty/serial/Kconfig | 4 +
drivers/tty/serial/Makefile | 3 +
drivers/tty/serial/atmel_serial.c | 259 ++++++++++++++++++++++++-------
drivers/tty/serial/serial_mctrl_gpio.c | 146 +++++++++++++++++
drivers/tty/serial/serial_mctrl_gpio.h | 109 +++++++++++++
include/linux/platform_data/atmel.h | 1 -
13 files changed, 496 insertions(+), 92 deletions(-)
create mode 100644 drivers/tty/serial/serial_mctrl_gpio.c
create mode 100644 drivers/tty/serial/serial_mctrl_gpio.h
--
1.8.5
next reply other threads:[~2014-02-26 16:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-26 16:19 Richard Genoud [this message]
2014-02-26 16:19 ` [PATCH v4 1/5] tty/serial: Add GPIOLIB helpers for controlling modem lines Richard Genoud
2014-02-26 16:37 ` Alexander Shiyan
2014-02-27 8:43 ` Richard Genoud
2014-02-26 16:19 ` [PATCH v4 2/5] tty/serial: at91: use dev_err instead of printk Richard Genoud
2014-02-26 16:19 ` [PATCH v4 3/5] tty/serial: at91: remove unused open/close hooks Richard Genoud
2014-02-26 16:19 ` [PATCH v4 4/5] tty/serial: at91: use mctrl_gpio helpers Richard Genoud
2014-02-26 16:19 ` [PATCH v4 5/5] tty/serial: at91: add interrupts for modem control lines Richard Genoud
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=1393431588-25977-1-git-send-email-richard.genoud@gmail.com \
--to=richard.genoud@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-serial@vger.kernel.org \
--cc=nicolas.ferre@atmel.com \
--cc=shc_work@mail.ru \
--cc=u.kleine-koenig@pengutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).