diff options
| author | Richard Genoud <richard.genoud@gmail.com> | 2014-05-13 14:20:43 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-05-28 15:49:14 -0400 |
| commit | 84130aace83989c1dba073ed98dad721d2060258 (patch) | |
| tree | e313e54a9276328a551825f58fc867aa02f8acf1 /Documentation/serial | |
| parent | fa3909320c00286c6b9d6ade16bc6d44f940379c (diff) | |
tty/serial: Add GPIOLIB helpers for controlling modem lines
This patch add some helpers to control modem lines (CTS/RTS/DSR...) via
GPIO.
This will be useful for many boards which have a serial controller that
only handle CTS/RTS pins (or even just RX/TX).
Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Tested-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'Documentation/serial')
| -rw-r--r-- | Documentation/serial/driver | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Documentation/serial/driver b/Documentation/serial/driver index c3a7689a90e6..3bba1aeb799c 100644 --- a/Documentation/serial/driver +++ b/Documentation/serial/driver | |||
| @@ -429,3 +429,28 @@ thus: | |||
| 429 | struct uart_port port; | 429 | struct uart_port port; |
| 430 | int my_stuff; | 430 | int my_stuff; |
| 431 | }; | 431 | }; |
| 432 | |||
| 433 | Modem control lines via GPIO | ||
| 434 | ---------------------------- | ||
| 435 | |||
| 436 | Some helpers are provided in order to set/get modem control lines via GPIO. | ||
| 437 | |||
| 438 | mctrl_gpio_init(dev, idx): | ||
| 439 | This will get the {cts,rts,...}-gpios from device tree if they are | ||
| 440 | present and request them, set direction etc, and return an | ||
| 441 | allocated structure. devm_* functions are used, so there's no need | ||
| 442 | to call mctrl_gpio_free(). | ||
| 443 | |||
| 444 | mctrl_gpio_free(dev, gpios): | ||
| 445 | This will free the requested gpios in mctrl_gpio_init(). | ||
| 446 | As devm_* function are used, there's generally no need to call | ||
| 447 | this function. | ||
| 448 | |||
| 449 | mctrl_gpio_to_gpiod(gpios, gidx) | ||
| 450 | This returns the gpio structure associated to the modem line index. | ||
| 451 | |||
| 452 | mctrl_gpio_set(gpios, mctrl): | ||
| 453 | This will sets the gpios according to the mctrl state. | ||
| 454 | |||
| 455 | mctrl_gpio_get(gpios, mctrl): | ||
| 456 | This will update mctrl with the gpios values. | ||
