Commit 4b8038dc authored by Qipan Li's avatar Qipan Li Committed by Greg Kroah-Hartman

Revert "serial: sirf: add a new uart type support"

This reverts commit 52bec4ed("serial: sirf: add a new uart type
support").
we misunderstood the clock dependency in atlas7. Actually involved
several clocks are in a tree structure. we still only need to take
the leaf clock node for BT uarts.
Signed-off-by: default avatarQipan Li <Qipan.Li@csr.com>
Signed-off-by: default avatarBarry Song <Barry.Song@csr.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 507224aa
...@@ -2,8 +2,7 @@ ...@@ -2,8 +2,7 @@
Required properties: Required properties:
- compatible : Should be "sirf,prima2-uart", "sirf, prima2-usp-uart", - compatible : Should be "sirf,prima2-uart", "sirf, prima2-usp-uart",
"sirf,atlas7-uart" or "sirf,atlas7-bt-uart" which means "sirf,atlas7-uart" or "sirf,atlas7-usp-uart".
uart located in BT module and used for BT.
- reg : Offset and length of the register set for the device - reg : Offset and length of the register set for the device
- interrupts : Should contain uart interrupt - interrupts : Should contain uart interrupt
- fifosize : Should define hardware rx/tx fifo size - fifosize : Should define hardware rx/tx fifo size
...@@ -33,15 +32,3 @@ usp@b0090000 { ...@@ -33,15 +32,3 @@ usp@b0090000 {
rts-gpios = <&gpio 15 0>; rts-gpios = <&gpio 15 0>;
cts-gpios = <&gpio 46 0>; cts-gpios = <&gpio 46 0>;
}; };
for uart use in BT module,
uart6: uart@11000000 {
cell-index = <6>;
compatible = "sirf,atlas7-bt-uart", "sirf,atlas7-uart";
reg = <0x11000000 0x1000>;
interrupts = <0 100 0>;
clocks = <&clks 138>, <&clks 140>, <&clks 141>;
clock-names = "uart", "general", "noc";
fifosize = <128>;
status = "disabled";
}
...@@ -1032,19 +1032,10 @@ static void sirfsoc_uart_pm(struct uart_port *port, unsigned int state, ...@@ -1032,19 +1032,10 @@ static void sirfsoc_uart_pm(struct uart_port *port, unsigned int state,
unsigned int oldstate) unsigned int oldstate)
{ {
struct sirfsoc_uart_port *sirfport = to_sirfport(port); struct sirfsoc_uart_port *sirfport = to_sirfport(port);
if (!state) { if (!state)
if (sirfport->is_bt_uart) {
clk_prepare_enable(sirfport->clk_noc);
clk_prepare_enable(sirfport->clk_general);
}
clk_prepare_enable(sirfport->clk); clk_prepare_enable(sirfport->clk);
} else { else
clk_disable_unprepare(sirfport->clk); clk_disable_unprepare(sirfport->clk);
if (sirfport->is_bt_uart) {
clk_disable_unprepare(sirfport->clk_general);
clk_disable_unprepare(sirfport->clk_noc);
}
}
} }
static int sirfsoc_uart_startup(struct uart_port *port) static int sirfsoc_uart_startup(struct uart_port *port)
...@@ -1387,26 +1378,12 @@ static int sirfsoc_uart_probe(struct platform_device *pdev) ...@@ -1387,26 +1378,12 @@ static int sirfsoc_uart_probe(struct platform_device *pdev)
} }
port->irq = res->start; port->irq = res->start;
sirfport->clk = devm_clk_get(&pdev->dev, NULL); sirfport->clk = clk_get(&pdev->dev, NULL);
if (IS_ERR(sirfport->clk)) { if (IS_ERR(sirfport->clk)) {
ret = PTR_ERR(sirfport->clk); ret = PTR_ERR(sirfport->clk);
goto err; goto err;
} }
port->uartclk = clk_get_rate(sirfport->clk); port->uartclk = clk_get_rate(sirfport->clk);
if (of_device_is_compatible(pdev->dev.of_node, "sirf,atlas7-bt-uart")) {
sirfport->clk_general = devm_clk_get(&pdev->dev, "general");
if (IS_ERR(sirfport->clk_general)) {
ret = PTR_ERR(sirfport->clk_general);
goto err;
}
sirfport->clk_noc = devm_clk_get(&pdev->dev, "noc");
if (IS_ERR(sirfport->clk_noc)) {
ret = PTR_ERR(sirfport->clk_noc);
goto err;
}
sirfport->is_bt_uart = true;
} else
sirfport->is_bt_uart = false;
port->ops = &sirfsoc_uart_ops; port->ops = &sirfsoc_uart_ops;
spin_lock_init(&port->lock); spin_lock_init(&port->lock);
...@@ -1415,7 +1392,7 @@ static int sirfsoc_uart_probe(struct platform_device *pdev) ...@@ -1415,7 +1392,7 @@ static int sirfsoc_uart_probe(struct platform_device *pdev)
ret = uart_add_one_port(&sirfsoc_uart_drv, port); ret = uart_add_one_port(&sirfsoc_uart_drv, port);
if (ret != 0) { if (ret != 0) {
dev_err(&pdev->dev, "Cannot add UART port(%d).\n", pdev->id); dev_err(&pdev->dev, "Cannot add UART port(%d).\n", pdev->id);
goto err; goto port_err;
} }
sirfport->rx_dma_chan = dma_request_slave_channel(port->dev, "rx"); sirfport->rx_dma_chan = dma_request_slave_channel(port->dev, "rx");
...@@ -1444,6 +1421,8 @@ static int sirfsoc_uart_probe(struct platform_device *pdev) ...@@ -1444,6 +1421,8 @@ static int sirfsoc_uart_probe(struct platform_device *pdev)
sirfport->rx_dma_items[j].xmit.buf, sirfport->rx_dma_items[j].xmit.buf,
sirfport->rx_dma_items[j].dma_addr); sirfport->rx_dma_items[j].dma_addr);
dma_release_channel(sirfport->rx_dma_chan); dma_release_channel(sirfport->rx_dma_chan);
port_err:
clk_put(sirfport->clk);
err: err:
return ret; return ret;
} }
...@@ -1452,6 +1431,7 @@ static int sirfsoc_uart_remove(struct platform_device *pdev) ...@@ -1452,6 +1431,7 @@ static int sirfsoc_uart_remove(struct platform_device *pdev)
{ {
struct sirfsoc_uart_port *sirfport = platform_get_drvdata(pdev); struct sirfsoc_uart_port *sirfport = platform_get_drvdata(pdev);
struct uart_port *port = &sirfport->port; struct uart_port *port = &sirfport->port;
clk_put(sirfport->clk);
uart_remove_one_port(&sirfsoc_uart_drv, port); uart_remove_one_port(&sirfsoc_uart_drv, port);
if (sirfport->rx_dma_chan) { if (sirfport->rx_dma_chan) {
int i; int i;
......
...@@ -417,10 +417,6 @@ struct sirfsoc_uart_port { ...@@ -417,10 +417,6 @@ struct sirfsoc_uart_port {
struct uart_port port; struct uart_port port;
struct clk *clk; struct clk *clk;
/* UART6 for BT usage in A7DA platform need multi-clock source */
bool is_bt_uart;
struct clk *clk_general;
struct clk *clk_noc;
/* for SiRFatlas7, there are SET/CLR for UART_INT_EN */ /* for SiRFatlas7, there are SET/CLR for UART_INT_EN */
bool is_atlas7; bool is_atlas7;
struct sirfsoc_uart_register *uart_reg; struct sirfsoc_uart_register *uart_reg;
......
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