]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
serial: 8250_dw: build Renesas RZN1 CPR value from DW_UART_CPR_* definitions
authorJia Wang <wangjia@ultrarisc.com>
Wed, 29 Apr 2026 09:13:26 +0000 (17:13 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 May 2026 15:00:42 +0000 (17:00 +0200)
commit07bb8459c443b840c55293cee1c726431dd749cf
treebf006d77c184a31d393cfb97bcc3ad8beef9e7f1
parent6d7f4890bbb6fc8b70f618aa0407043b32bc738a
serial: 8250_dw: build Renesas RZN1 CPR value from DW_UART_CPR_* definitions

Replace the magic CPR value for Renesas RZ/N1 with a composition using
DW_UART_CPR_* bit/field definitions and FIELD_PREP_CONST().

Introduce a helper macro to convert a FIFO size (bytes) into the CPR
FIFO_MODE field value, with BUILD_BUG_ON_ZERO() checks for alignment and
bounds. Use it to replace the literal FIFO_MODE values in the RZN1.

Signed-off-by: Jia Wang <wangjia@ultrarisc.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://patch.msgid.link/20260429-ultrarisc-serial-v7-2-e475cce9e274@ultrarisc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_dw.c
drivers/tty/serial/8250/8250_dwlib.h