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: qcom-geni: Make UART port count configurable via Kconfig

Replace the hardcoded GENI_UART_PORTS macro with a new Kconfig option
SERIAL_QCOM_GENI_UART_PORTS to allow platforms to configure the maximum
number of UART ports supported by the driver at build time.

This improves flexibility for platforms that require more than the
previously fixed number of UART ports, and avoids unnecessary allocation
for unused ports.

Signed-off-by: Zong Jiang <quic_zongjian@quicinc.com>
Link: https://lore.kernel.org/r/20250812054819.3748649-3-quic_zongjian@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Zong Jiang and committed by
Greg Kroah-Hartman
9391ab1e c3e7966c

+10 -3
+8
drivers/tty/serial/Kconfig
··· 928 928 Serial console driver for Qualcomm Technologies Inc's GENI based 929 929 QUP hardware. 930 930 931 + config SERIAL_QCOM_GENI_UART_PORTS 932 + int "Maximum number of GENI UART ports" 933 + depends on SERIAL_QCOM_GENI 934 + default "8" 935 + help 936 + Set this to the maximum number of serial ports you want the driver 937 + to support. 938 + 931 939 config SERIAL_VT8500 932 940 bool "VIA VT8500 on-chip serial port support" 933 941 depends on ARCH_VT8500 || COMPILE_TEST
+2 -3
drivers/tty/serial/qcom_geni_serial.c
··· 77 77 #define STALE_TIMEOUT 16 78 78 #define DEFAULT_BITS_PER_CHAR 10 79 79 #define GENI_UART_CONS_PORTS 1 80 - #define GENI_UART_PORTS 3 81 80 #define DEF_FIFO_DEPTH_WORDS 16 82 81 #define DEF_TX_WM 2 83 82 #define DEF_FIFO_WIDTH_BITS 32 ··· 260 261 static struct qcom_geni_serial_port *get_port_from_line(int line, bool console, struct device *dev) 261 262 { 262 263 struct qcom_geni_serial_port *port; 263 - int nr_ports = console ? GENI_UART_CONS_PORTS : GENI_UART_PORTS; 264 + int nr_ports = console ? GENI_UART_CONS_PORTS : CONFIG_SERIAL_QCOM_GENI_UART_PORTS; 264 265 265 266 if (console) { 266 267 if (line < 0 || line >= nr_ports) ··· 1651 1652 .owner = THIS_MODULE, 1652 1653 .driver_name = "qcom_geni_uart", 1653 1654 .dev_name = "ttyHS", 1654 - .nr = GENI_UART_PORTS, 1655 + .nr = CONFIG_SERIAL_QCOM_GENI_UART_PORTS, 1655 1656 }; 1656 1657 1657 1658 static int geni_serial_resources_on(struct uart_port *uport)