]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
serial: sh-sci: Make sci_scbrr_calc() public
authorBiju Das <biju.das.jz@bp.renesas.com>
Sat, 29 Nov 2025 16:43:10 +0000 (16:43 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Dec 2025 14:07:07 +0000 (15:07 +0100)
Make the function sci_scbrr_calc() public for code reuse to support RZ/G3E
RSCI IP.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
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-15-biju.das.jz@bp.renesas.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/sh-sci-common.h
drivers/tty/serial/sh-sci.c

index 5d30771278b4289509062515b5b032df06e92c3a..976e394ab9686aa6bf77c98b93817bb9fd223bfb 100644 (file)
@@ -169,6 +169,9 @@ void sci_port_enable(struct sci_port *sci_port);
 int sci_startup(struct uart_port *port);
 void sci_shutdown(struct uart_port *port);
 
+int sci_scbrr_calc(struct sci_port *s, unsigned int bps, unsigned int *brr,
+                  unsigned int *srr, unsigned int *cks);
+
 #define min_sr(_port)          ffs((_port)->sampling_rate_mask)
 #define max_sr(_port)          fls((_port)->sampling_rate_mask)
 
index 5d7e78f95c70626bda185ce05f6674a7f07206a1..e2ba752f9c16ae3fa9225545530ac91e28e4ff03 100644 (file)
@@ -2573,9 +2573,8 @@ static int sci_brg_calc(struct sci_port *s, unsigned int bps,
 }
 
 /* calculate sample rate, BRR, and clock select */
-static int sci_scbrr_calc(struct sci_port *s, unsigned int bps,
-                  unsigned int *brr, unsigned int *srr,
-                  unsigned int *cks)
+int sci_scbrr_calc(struct sci_port *s, unsigned int bps, unsigned int *brr,
+                  unsigned int *srr, unsigned int *cks)
 {
        unsigned long freq = s->clk_rates[SCI_FCK];
        unsigned int sr, br, prediv, scrate, c;
@@ -2639,6 +2638,7 @@ found:
                min_err, *brr, *srr + 1, *cks);
        return min_err;
 }
+EXPORT_SYMBOL_NS_GPL(sci_scbrr_calc, "SH_SCI");
 
 static void sci_reset(struct uart_port *port)
 {