Commit 1863178b authored by Shubhrajyoti Datta's avatar Shubhrajyoti Datta Committed by Greg Kroah-Hartman

serial: uartps: Add support for cts-override

Having flow is configurable. Add support for the same by
checking for cts-override.
Signed-off-by: default avatarShubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b1072b4f
...@@ -193,6 +193,7 @@ struct cdns_uart { ...@@ -193,6 +193,7 @@ struct cdns_uart {
int id; int id;
struct notifier_block clk_rate_change_nb; struct notifier_block clk_rate_change_nb;
u32 quirks; u32 quirks;
bool cts_override;
}; };
struct cdns_platform_data { struct cdns_platform_data {
u32 quirks; u32 quirks;
...@@ -1000,6 +1001,11 @@ static void cdns_uart_config_port(struct uart_port *port, int flags) ...@@ -1000,6 +1001,11 @@ static void cdns_uart_config_port(struct uart_port *port, int flags)
*/ */
static unsigned int cdns_uart_get_mctrl(struct uart_port *port) static unsigned int cdns_uart_get_mctrl(struct uart_port *port)
{ {
struct cdns_uart *cdns_uart_data = port->private_data;
if (cdns_uart_data->cts_override)
return 0;
return TIOCM_CTS | TIOCM_DSR | TIOCM_CAR; return TIOCM_CTS | TIOCM_DSR | TIOCM_CAR;
} }
...@@ -1007,6 +1013,10 @@ static void cdns_uart_set_mctrl(struct uart_port *port, unsigned int mctrl) ...@@ -1007,6 +1013,10 @@ static void cdns_uart_set_mctrl(struct uart_port *port, unsigned int mctrl)
{ {
u32 val; u32 val;
u32 mode_reg; u32 mode_reg;
struct cdns_uart *cdns_uart_data = port->private_data;
if (cdns_uart_data->cts_override)
return;
val = readl(port->membase + CDNS_UART_MODEMCR); val = readl(port->membase + CDNS_UART_MODEMCR);
mode_reg = readl(port->membase + CDNS_UART_MR); mode_reg = readl(port->membase + CDNS_UART_MR);
...@@ -1665,6 +1675,8 @@ static int cdns_uart_probe(struct platform_device *pdev) ...@@ -1665,6 +1675,8 @@ static int cdns_uart_probe(struct platform_device *pdev)
console_port = NULL; console_port = NULL;
#endif #endif
cdns_uart_data->cts_override = of_property_read_bool(pdev->dev.of_node,
"cts-override");
return 0; return 0;
err_out_pm_disable: err_out_pm_disable:
......
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