From: richard.genoud@gmail.com (Richard Genoud)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 0/4] tty/serial: Add helpers to use GPIOs to control modem lines
Date: Tue, 11 Feb 2014 18:45:11 +0100 [thread overview]
Message-ID: <1392140715-15295-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.
This is based on 3.14-rc2 + Linus Walleij/Nicolas Ferre's patch:
354e57f3a0a2 ARM/serial: at91: switch atmel serial to use gpiolib
(in Uwe's tree git://git.pengutronix.de/git/ukl/linux.git dropmachtimexh )
and Philipp Zabel's patch:
gpiolib: make gpiod_direction_output take a logical value, add gpiod_direction_output_raw
(there won't be a merge conflict if this last patch is not present, the
gpios will "just" be on the wrong direction.)
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.
Updates from v2:
- 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 (4):
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
.../devicetree/bindings/serial/atmel-usart.txt | 12 +-
Documentation/serial/driver | 21 ++
arch/arm/mach-at91/at91rm9200_devices.c | 25 ++
arch/arm/mach-at91/at91sam9260_devices.c | 35 +++
arch/arm/mach-at91/at91sam9261_devices.c | 20 ++
arch/arm/mach-at91/at91sam9263_devices.c | 20 ++
arch/arm/mach-at91/at91sam9g45_devices.c | 25 ++
arch/arm/mach-at91/at91sam9rl_devices.c | 25 ++
drivers/tty/serial/Kconfig | 4 +
drivers/tty/serial/Makefile | 3 +
drivers/tty/serial/atmel_serial.c | 313 +++++++++++++++++----
drivers/tty/serial/serial_mctrl_gpio.c | 113 ++++++++
drivers/tty/serial/serial_mctrl_gpio.h | 56 ++++
include/linux/platform_data/atmel.h | 5 +
14 files changed, 615 insertions(+), 62 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-11 17:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-11 17:45 Richard Genoud [this message]
2014-02-11 17:45 ` [PATCH v2 1/4] tty/serial: Add GPIOLIB helpers for controlling modem lines Richard Genoud
2014-02-11 18:23 ` Alexander Shiyan
2014-02-12 8:33 ` Richard Genoud
2014-02-11 17:45 ` [PATCH v2 2/4] tty/serial: at91: use dev_err instead of printk Richard Genoud
2014-02-11 17:45 ` [PATCH v2 3/4] tty/serial: at91: remove unused open/close hooks Richard Genoud
2014-02-11 17:45 ` [PATCH v2 4/4] tty/serial: at91: use mctrl_gpio helpers Richard Genoud
2014-02-13 17:37 ` [PATCH v2 0/4] tty/serial: Add helpers to use GPIOs to control modem lines Greg Kroah-Hartman
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=1392140715-15295-1-git-send-email-richard.genoud@gmail.com \
--to=richard.genoud@gmail.com \
--cc=linux-arm-kernel@lists.infradead.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 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).