Commit ffea0439 authored by Thor Thayer's avatar Thor Thayer Committed by Greg Kroah-Hartman

serial: 8250: of: Load TX FIFO Threshold from DT

Initialize the tx_loadsz parameter from passed in devicetree
tx-threshold parameter.
The tx_loadsz is calculated as the number of bytes to fill FIFO
when tx-threshold is triggered.
Signed-off-by: default avatarThor Thayer <tthayer@opensource.altera.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 51311eaa
...@@ -195,6 +195,7 @@ static int of_platform_serial_probe(struct platform_device *ofdev) ...@@ -195,6 +195,7 @@ static int of_platform_serial_probe(struct platform_device *ofdev)
switch (port_type) { switch (port_type) {
case PORT_8250 ... PORT_MAX_8250: case PORT_8250 ... PORT_MAX_8250:
{ {
u32 tx_threshold;
struct uart_8250_port port8250; struct uart_8250_port port8250;
memset(&port8250, 0, sizeof(port8250)); memset(&port8250, 0, sizeof(port8250));
port8250.port = port; port8250.port = port;
...@@ -202,6 +203,12 @@ static int of_platform_serial_probe(struct platform_device *ofdev) ...@@ -202,6 +203,12 @@ static int of_platform_serial_probe(struct platform_device *ofdev)
if (port.fifosize) if (port.fifosize)
port8250.capabilities = UART_CAP_FIFO; port8250.capabilities = UART_CAP_FIFO;
/* Check for TX FIFO threshold & set tx_loadsz */
if ((of_property_read_u32(ofdev->dev.of_node, "tx-threshold",
&tx_threshold) == 0) &&
(tx_threshold < port.fifosize))
port8250.tx_loadsz = port.fifosize - tx_threshold;
if (of_property_read_bool(ofdev->dev.of_node, if (of_property_read_bool(ofdev->dev.of_node,
"auto-flow-control")) "auto-flow-control"))
port8250.capabilities |= UART_CAP_AFE; port8250.capabilities |= UART_CAP_AFE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment