aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-05-26 15:42:29 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-26 15:42:29 -0400
commit27953437059c64d14086196eb96f43c78caa9db3 (patch)
tree0cfd5fb21262a6db3de0c64462847b4c0c43e9df /drivers/tty
parent2c757fd5d1a92086f225a75a8fac7cab242d11b0 (diff)
parent3c0dec5f58b3c7b3627715126d1bf9b030a076f0 (diff)
Merge tag 'clock' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull arm-soc clock driver changes from Olof Johansson: "The new clock subsystem was merged in linux-3.4 without any users, this now moves the first three platforms over to it: imx, mxs and spear. The series also contains the changes for the clock subsystem itself, since Mike preferred to have it together with the platforms that require these changes, in order to avoid interdependencies and conflicts." Fix up trivial conflicts in arch/arm/mach-kirkwood/common.c (code removed in one branch, added OF support in another) and drivers/dma/imx-sdma.c (independent changes next to each other). * tag 'clock' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (97 commits) clk: Fix CLK_SET_RATE_GATE flag validation in clk_set_rate(). clk: Provide dummy clk_unregister() SPEAr: Update defconfigs SPEAr: Add SMI NOR partition info in dts files SPEAr: Switch to common clock framework SPEAr: Call clk_prepare() before calling clk_enable SPEAr: clk: Add General Purpose Timer Synthesizer clock SPEAr: clk: Add Fractional Synthesizer clock SPEAr: clk: Add Auxiliary Synthesizer clock SPEAr: clk: Add VCO-PLL Synthesizer clock SPEAr: Add DT bindings for SPEAr's timer ARM i.MX: remove now unused clock files ARM: i.MX6: implement clocks using common clock framework ARM i.MX35: implement clocks using common clock framework ARM i.MX5: implement clocks using common clock framework ARM: Kirkwood: Replace clock gating ARM: Orion: Audio: Add clk/clkdev support ARM: Orion: PCIE: Add support for clk ARM: Orion: XOR: Add support for clk ARM: Orion: CESA: Add support for clk ...
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/imx.c38
1 files changed, 23 insertions, 15 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index ec206732f68c..4ef747307ecb 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -205,7 +205,8 @@ struct imx_port {
205 unsigned int irda_inv_rx:1; 205 unsigned int irda_inv_rx:1;
206 unsigned int irda_inv_tx:1; 206 unsigned int irda_inv_tx:1;
207 unsigned short trcv_delay; /* transceiver delay */ 207 unsigned short trcv_delay; /* transceiver delay */
208 struct clk *clk; 208 struct clk *clk_ipg;
209 struct clk *clk_per;
209 struct imx_uart_data *devdata; 210 struct imx_uart_data *devdata;
210}; 211};
211 212
@@ -673,7 +674,7 @@ static int imx_setup_ufcr(struct imx_port *sport, unsigned int mode)
673 * RFDIV is set such way to satisfy requested uartclk value 674 * RFDIV is set such way to satisfy requested uartclk value
674 */ 675 */
675 val = TXTL << 10 | RXTL; 676 val = TXTL << 10 | RXTL;
676 ufcr_rfdiv = (clk_get_rate(sport->clk) + sport->port.uartclk / 2) 677 ufcr_rfdiv = (clk_get_rate(sport->clk_per) + sport->port.uartclk / 2)
677 / sport->port.uartclk; 678 / sport->port.uartclk;
678 679
679 if(!ufcr_rfdiv) 680 if(!ufcr_rfdiv)
@@ -1286,7 +1287,7 @@ imx_console_get_options(struct imx_port *sport, int *baud,
1286 else 1287 else
1287 ucfr_rfdiv = 6 - ucfr_rfdiv; 1288 ucfr_rfdiv = 6 - ucfr_rfdiv;
1288 1289
1289 uartclk = clk_get_rate(sport->clk); 1290 uartclk = clk_get_rate(sport->clk_per);
1290 uartclk /= ucfr_rfdiv; 1291 uartclk /= ucfr_rfdiv;
1291 1292
1292 { /* 1293 { /*
@@ -1511,14 +1512,22 @@ static int serial_imx_probe(struct platform_device *pdev)
1511 goto unmap; 1512 goto unmap;
1512 } 1513 }
1513 1514
1514 sport->clk = clk_get(&pdev->dev, "uart"); 1515 sport->clk_ipg = devm_clk_get(&pdev->dev, "ipg");
1515 if (IS_ERR(sport->clk)) { 1516 if (IS_ERR(sport->clk_ipg)) {
1516 ret = PTR_ERR(sport->clk); 1517 ret = PTR_ERR(sport->clk_ipg);
1517 goto unmap; 1518 goto unmap;
1518 } 1519 }
1519 clk_prepare_enable(sport->clk);
1520 1520
1521 sport->port.uartclk = clk_get_rate(sport->clk); 1521 sport->clk_per = devm_clk_get(&pdev->dev, "per");
1522 if (IS_ERR(sport->clk_per)) {
1523 ret = PTR_ERR(sport->clk_per);
1524 goto unmap;
1525 }
1526
1527 clk_prepare_enable(sport->clk_per);
1528 clk_prepare_enable(sport->clk_ipg);
1529
1530 sport->port.uartclk = clk_get_rate(sport->clk_per);
1522 1531
1523 imx_ports[sport->port.line] = sport; 1532 imx_ports[sport->port.line] = sport;
1524 1533
@@ -1539,8 +1548,8 @@ deinit:
1539 if (pdata && pdata->exit) 1548 if (pdata && pdata->exit)
1540 pdata->exit(pdev); 1549 pdata->exit(pdev);
1541clkput: 1550clkput:
1542 clk_disable_unprepare(sport->clk); 1551 clk_disable_unprepare(sport->clk_per);
1543 clk_put(sport->clk); 1552 clk_disable_unprepare(sport->clk_ipg);
1544unmap: 1553unmap:
1545 iounmap(sport->port.membase); 1554 iounmap(sport->port.membase);
1546free: 1555free:
@@ -1558,11 +1567,10 @@ static int serial_imx_remove(struct platform_device *pdev)
1558 1567
1559 platform_set_drvdata(pdev, NULL); 1568 platform_set_drvdata(pdev, NULL);
1560 1569
1561 if (sport) { 1570 uart_remove_one_port(&imx_reg, &sport->port);
1562 uart_remove_one_port(&imx_reg, &sport->port); 1571
1563 clk_disable_unprepare(sport->clk); 1572 clk_disable_unprepare(sport->clk_per);
1564 clk_put(sport->clk); 1573 clk_disable_unprepare(sport->clk_ipg);
1565 }
1566 1574
1567 if (pdata && pdata->exit) 1575 if (pdata && pdata->exit)
1568 pdata->exit(pdev); 1576 pdata->exit(pdev);