public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH] staging: greybus: uart: document c_cflag handling in set_termios
@ 2026-04-19  3:26 Debjeet Banerjee
  0 siblings, 0 replies; only message in thread
From: Debjeet Banerjee @ 2026-04-19  3:26 UTC (permalink / raw)
  To: dtwlin
  Cc: johan, elder, gregkh, greybus-dev, linux-staging, linux-kernel,
	debjeetbanerjee48

gb_tty_set_termios() derives UART line configuration from a subset of
termios->c_cflag bits, namely CSIZE, CSTOPB, PARENB, PARODD, CMSPAR,
CRTSCTS, CLOCAL and CBAUD. Other c_cflag bits are not interpreted by
the driver and are not represented in the Greybus UART protocol
messages.

The existing FIXME suggests clearing unsupported bits from termios.
However, the driver already limits its behavior to the supported subset
when constructing line coding, and unused bits are effectively ignored.
No invalid or unsupported values are propagated to the hardware.

Replace the FIXME with a comment documenting which c_cflag bits are
consumed by the driver and clarifying that other bits are ignored.

No functional change intended.

Signed-off-by: Debjeet Banerjee <debjeetbanerjee48@gmail.com>
---
 drivers/staging/greybus/uart.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/greybus/uart.c b/drivers/staging/greybus/uart.c
index 7d060b4cd33d..49d685a6ad8c 100644
--- a/drivers/staging/greybus/uart.c
+++ b/drivers/staging/greybus/uart.c
@@ -494,8 +494,20 @@ static void gb_tty_set_termios(struct tty_struct *tty,
 				(termios->c_cflag & CMSPAR ? 2 : 0) : 0;
 
 	newline.data_bits = tty_get_char_size(termios->c_cflag);
-
-	/* FIXME: needs to clear unsupported bits in the termios */
+	/*
+	 * The Greybus UART driver only interprets a subset of termios
+	 * c_cflag bits when configuring line settings:
+	 *
+	 *   - CSIZE via tty_get_char_size() for data bits
+	 *   - CSTOPB for stop-bit format
+	 *   - PARENB, PARODD, CMSPAR for parity encoding
+	 *   - CRTSCTS for hardware flow control
+	 *   - CLOCAL for modem control handling
+	 *   - CBAUD via C_BAUD() for baud rate and B0 semantics
+	 *
+	 * Other c_cflag bits are ignored as they are not represented in
+	 * the Greybus UART protocol.
+	 */
 	gb_tty->clocal = ((termios->c_cflag & CLOCAL) != 0);
 
 	if (C_BAUD(tty) == B0) {
-- 
2.53.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-04-19  3:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-19  3:26 [PATCH] staging: greybus: uart: document c_cflag handling in set_termios Debjeet Banerjee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox