Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

serial: samsung: get fifosize via device tree

UART modules on some SoCs only differ in the fifosize of each
UART channel. Its useless to duplicate the drv_data structure
or create a compatible name for such a change.

We can get fifosize via the device tree nodes (not mandating it).

Also updates the documentation.

Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Naveen Krishna Chatradhi and committed by
Greg Kroah-Hartman
135f07c3 b1261c86

+13 -3
+4
Documentation/devicetree/bindings/serial/samsung_uart.txt
··· 29 29 [1] Documentation/devicetree/bindings/interrupt-controller/interrupts.txt 30 30 [2] Documentation/devicetree/bindings/clock/clock-bindings.txt 31 31 32 + Optional properties: 33 + - samsung,uart-fifosize: The fifo size supported by the UART channel 34 + 32 35 Note: Each Samsung UART should have an alias correctly numbered in the 33 36 "aliases" node, according to serialN format, where N is the port number 34 37 (non-negative decimal integer) as specified by User's Manual of respective ··· 54 51 "clk_uart_baud3"; 55 52 clocks = <&clocks PCLK_UART1>, <&clocks PCLK_UART1>, 56 53 <&clocks SCLK_UART>; 54 + samsung,uart-fifosize = <16>; 57 55 };
+9 -3
drivers/tty/serial/samsung.c
··· 1295 1295 dev_get_platdata(&pdev->dev) : 1296 1296 ourport->drv_data->def_cfg; 1297 1297 1298 - ourport->port.fifosize = (ourport->info->fifosize) ? 1299 - ourport->info->fifosize : 1300 - ourport->drv_data->fifosize[index]; 1298 + if (pdev->dev.of_node) 1299 + of_property_read_u32(pdev->dev.of_node, 1300 + "samsung,uart-fifosize", &ourport->port.fifosize); 1301 + 1302 + if (!ourport->port.fifosize) { 1303 + ourport->port.fifosize = (ourport->info->fifosize) ? 1304 + ourport->info->fifosize : 1305 + ourport->drv_data->fifosize[index]; 1306 + } 1301 1307 1302 1308 probe_index++; 1303 1309