mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 16:44:58 +02:00
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>
This commit is contained in:
parent
3a3ab10245
commit
b346e5d7db
|
|
@ -151,6 +151,22 @@ static void rsci_start_rx(struct uart_port *port)
|
|||
rsci_serial_out(port, CCR0, ctrl);
|
||||
}
|
||||
|
||||
static int rsci_scif_set_rtrg(struct uart_port *port, int rx_trig)
|
||||
{
|
||||
u32 fcr = rsci_serial_in(port, FCR);
|
||||
|
||||
if (rx_trig >= port->fifosize)
|
||||
rx_trig = port->fifosize - 1;
|
||||
else if (rx_trig < 1)
|
||||
rx_trig = 0;
|
||||
|
||||
fcr &= ~FCR_RTRG4_0;
|
||||
fcr |= field_prep(FCR_RTRG4_0, rx_trig);
|
||||
rsci_serial_out(port, FCR, fcr);
|
||||
|
||||
return rx_trig;
|
||||
}
|
||||
|
||||
static void rsci_set_termios(struct uart_port *port, struct ktermios *termios,
|
||||
const struct ktermios *old)
|
||||
{
|
||||
|
|
@ -454,6 +470,7 @@ static const struct sci_port_ops rsci_port_ops = {
|
|||
.poll_put_char = rsci_poll_put_char,
|
||||
.prepare_console_write = rsci_prepare_console_write,
|
||||
.suspend_regs_size = rsci_suspend_regs_size,
|
||||
.set_rtrg = rsci_scif_set_rtrg,
|
||||
.shutdown_complete = rsci_shutdown_complete,
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user