summaryrefslogtreecommitdiffstats
path: root/Documentation/driver-api
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2022-12-16 03:31:56 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2022-12-16 03:31:56 -0800
commitdd6f9b17cd7af68b6a5090deedf1f5e84f66f4e6 (patch)
treea03ca96cddd4520555981e51d8e6072f2d48c416 /Documentation/driver-api
parentb83a7080d30032cf70832bc2bb04cc342e203b88 (diff)
parent6373ab4dfee731deec62b4452ea641611feff9b3 (diff)
downloadlinux-dd6f9b17cd7af68b6a5090deedf1f5e84f66f4e6.tar.bz2
Merge tag 'tty-6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull tty/serial driver updates from Greg KH: "Here is the "big" set of tty/serial driver changes for 6.2-rc1. As in previous kernel releases, nothing big here at all, just some small incremental serial/tty layer cleanups and some individual driver additions and fixes. Highlights are: - serial helper macros from Jiri Slaby to reduce the amount of duplicated code in serial drivers - api cleanups and consolidations from Ilpo Järvinen in lots of serial drivers - the usual set of n_gsm fixes from Daniel Starke as that code gets exercised more - TIOCSTI is finally able to be disabled if requested (security hardening feature from Kees Cook) - fsl_lpuart driver fixes and features added - other small serial driver additions and fixes All of these have been in linux-next for a while with no reported problems" * tag 'tty-6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (97 commits) serial: atmel: don't stop the transmitter when doing PIO serial: atmel: cleanup atmel_start+stop_tx() tty: serial: fsl_lpuart: switch to new dmaengine_terminate_* API serial: sunsab: Fix error handling in sunsab_init() serial: altera_uart: fix locking in polling mode serial: pch: Fix PCI device refcount leak in pch_request_dma() tty: serial: fsl_lpuart: Use pm_ptr() to avoid need to make pm __maybe_unused tty: serial: fsl_lpuart: Add runtime pm support tty: serial: fsl_lpuart: enable wakeup source for lpuart serdev: Replace poll loop by readx_poll_timeout() macro tty: synclink_gt: unwind actions in error path of net device open serial: stm32: move dma_request_chan() before clk_prepare_enable() dt-bindings: serial: xlnx,opb-uartlite: Drop 'contains' from 'xlnx,use-parity' serial: pl011: Do not clear RX FIFO & RX interrupt in unthrottle. serial: amba-pl011: avoid SBSA UART accessing DMACR register tty: serial: altera_jtaguart: remove struct altera_jtaguart tty: serial: altera_jtaguart: use uart_port::read_status_mask tty: serial: altera_jtaguart: remove unused altera_jtaguart::sigs tty: serial: altera_jtaguart: remove flag from altera_jtaguart_rx_chars() n_tty: Rename tail to old_tail in n_tty_read() ...
Diffstat (limited to 'Documentation/driver-api')
-rw-r--r--Documentation/driver-api/serial/driver.rst3
-rw-r--r--Documentation/driver-api/serial/serial-rs485.rst56
2 files changed, 33 insertions, 26 deletions
diff --git a/Documentation/driver-api/serial/driver.rst b/Documentation/driver-api/serial/driver.rst
index 23c6b956cd90..98d268555dcc 100644
--- a/Documentation/driver-api/serial/driver.rst
+++ b/Documentation/driver-api/serial/driver.rst
@@ -78,6 +78,9 @@ Other functions
uart_get_lsr_info uart_handle_dcd_change uart_handle_cts_change
uart_try_toggle_sysrq uart_get_console
+.. kernel-doc:: include/linux/serial_core.h
+ :identifiers: uart_port_tx_limited uart_port_tx
+
Other notes
-----------
diff --git a/Documentation/driver-api/serial/serial-rs485.rst b/Documentation/driver-api/serial/serial-rs485.rst
index 6ebad75c74ed..dce061ef7647 100644
--- a/Documentation/driver-api/serial/serial-rs485.rst
+++ b/Documentation/driver-api/serial/serial-rs485.rst
@@ -29,23 +29,28 @@ RS485 Serial Communications
3. Data Structures Already Available in the Kernel
==================================================
- The Linux kernel provides the serial_rs485 structure (see [1]) to handle
- RS485 communications. This data structure is used to set and configure RS485
+ The Linux kernel provides the struct serial_rs485 to handle RS485
+ communications. This data structure is used to set and configure RS485
parameters in the platform data and in ioctls.
- The device tree can also provide RS485 boot time parameters (see [2]
- for bindings). The driver is in charge of filling this data structure from
- the values given by the device tree.
+ The device tree can also provide RS485 boot time parameters
+ [#DT-bindings]_. The serial core fills the struct serial_rs485 from the
+ values given by the device tree when the driver calls
+ uart_get_rs485_mode().
Any driver for devices capable of working both as RS232 and RS485 should
- implement the rs485_config callback and provide rs485_supported in the
- uart_port structure. The serial core calls rs485_config to do the device
- specific part in response to TIOCSRS485 ioctl (see below). The rs485_config
- callback receives a pointer to a sanitizated serial_rs485 structure. The
- serial_rs485 userspace provides is sanitized before calling rs485_config
- using rs485_supported that indicates what RS485 features the driver supports
- for the uart_port. TIOCGRS485 ioctl can be used to read back the
- serial_rs485 structure matching to the current configuration.
+ implement the ``rs485_config`` callback and provide ``rs485_supported``
+ in the ``struct uart_port``. The serial core calls ``rs485_config`` to do
+ the device specific part in response to TIOCSRS485 ioctl (see below). The
+ ``rs485_config`` callback receives a pointer to a sanitizated struct
+ serial_rs485. The struct serial_rs485 userspace provides is sanitized
+ before calling ``rs485_config`` using ``rs485_supported`` that indicates
+ what RS485 features the driver supports for the ``struct uart_port``.
+ TIOCGRS485 ioctl can be used to read back the struct serial_rs485
+ matching to the current configuration.
+
+.. kernel-doc:: include/uapi/linux/serial.h
+ :identifiers: serial_rs485 uart_get_rs485_mode
4. Usage from user-level
========================
@@ -103,29 +108,28 @@ RS485 Serial Communications
========================
The Linux kernel provides addressing mode for multipoint RS-485 serial
- communications line. The addressing mode is enabled with SER_RS485_ADDRB
- flag in serial_rs485. Struct serial_rs485 has two additional flags and
- fields for enabling receive and destination addresses.
+ communications line. The addressing mode is enabled with
+ ``SER_RS485_ADDRB`` flag in struct serial_rs485. The struct serial_rs485
+ has two additional flags and fields for enabling receive and destination
+ addresses.
Address mode flags:
- - SER_RS485_ADDRB: Enabled addressing mode (sets also ADDRB in termios).
- - SER_RS485_ADDR_RECV: Receive (filter) address enabled.
- - SER_RS485_ADDR_DEST: Set destination address.
+ - ``SER_RS485_ADDRB``: Enabled addressing mode (sets also ADDRB in termios).
+ - ``SER_RS485_ADDR_RECV``: Receive (filter) address enabled.
+ - ``SER_RS485_ADDR_DEST``: Set destination address.
- Address fields (enabled with corresponding SER_RS485_ADDR_* flag):
- - addr_recv: Receive address.
- - addr_dest: Destination address.
+ Address fields (enabled with corresponding ``SER_RS485_ADDR_*`` flag):
+ - ``addr_recv``: Receive address.
+ - ``addr_dest``: Destination address.
Once a receive address is set, the communication can occur only with the
particular device and other peers are filtered out. It is left up to the
receiver side to enforce the filtering. Receive address will be cleared
- if SER_RS485_ADDR_RECV is not set.
+ if ``SER_RS485_ADDR_RECV`` is not set.
Note: not all devices supporting RS485 support multipoint addressing.
6. References
=============
- [1] include/uapi/linux/serial.h
-
- [2] Documentation/devicetree/bindings/serial/rs485.txt
+.. [#DT-bindings] Documentation/devicetree/bindings/serial/rs485.txt