Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

serial: rsci: Add set_rtrg() callback

The rtrg variable is populated in sci_init_single() for RZ/T2H. Add
set_rtrg() callback for setting the rtrg value.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://patch.msgid.link/20251129164325.209213-4-biju.das.jz@bp.renesas.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Biju Das and committed by
Greg Kroah-Hartman
b346e5d7 3a3ab102

+17
+17
drivers/tty/serial/rsci.c
··· 151 151 rsci_serial_out(port, CCR0, ctrl); 152 152 } 153 153 154 + static int rsci_scif_set_rtrg(struct uart_port *port, int rx_trig) 155 + { 156 + u32 fcr = rsci_serial_in(port, FCR); 157 + 158 + if (rx_trig >= port->fifosize) 159 + rx_trig = port->fifosize - 1; 160 + else if (rx_trig < 1) 161 + rx_trig = 0; 162 + 163 + fcr &= ~FCR_RTRG4_0; 164 + fcr |= field_prep(FCR_RTRG4_0, rx_trig); 165 + rsci_serial_out(port, FCR, fcr); 166 + 167 + return rx_trig; 168 + } 169 + 154 170 static void rsci_set_termios(struct uart_port *port, struct ktermios *termios, 155 171 const struct ktermios *old) 156 172 { ··· 470 454 .poll_put_char = rsci_poll_put_char, 471 455 .prepare_console_write = rsci_prepare_console_write, 472 456 .suspend_regs_size = rsci_suspend_regs_size, 457 + .set_rtrg = rsci_scif_set_rtrg, 473 458 .shutdown_complete = rsci_shutdown_complete, 474 459 }; 475 460