Hi Biju,
On Sat, 29 Nov 2025 at 17:43, Biju <biju.das.au@gmail.com> wrote:
> From: Biju Das <biju.das.jz@bp.renesas.com>
>
> 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>
> ---
> v5:
> * New patch.
Thanks for your patch, which is now commit b346e5d7dbf66961 ("serial:
rsci: Add set_rtrg() callback") in tty/tty-next.
> --- a/drivers/tty/serial/rsci.c
> +++ b/drivers/tty/serial/rsci.c
> @@ -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);
FIELD_PREP(), as FCR_RTRG4_0 is a constant.
However, this can be combined with the previous line, using
FIELD_MODIFY().
I have sent a follow-up patch: "[PATCH] serial: rsci: Convert to
FIELD_MODIFY()".
https://lore.kernel.org/ada3faf4698155a618ae6371b35eab121eb8b19c.1766411924.git.geert+renesas@glider.be
> + 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)
> {
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds