diff options
author | Olof Johansson <olof@lixom.net> | 2013-06-27 20:04:27 -0400 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2013-06-27 20:04:27 -0400 |
commit | 8c3d913888cfb0066d62831969c3a992f7e4aba5 (patch) | |
tree | 0b52b0b71cb6b7c141ffa050b36245a13cff4f54 /drivers/tty | |
parent | fbd1a04b210d56ef84200df56fc0291746d4d4dc (diff) | |
parent | 8cc7f5338e729b79194e6c22e3c794faaef974b8 (diff) |
Merge tag 'msm-clock-for-3.11b' of git://git.kernel.org/pub/scm/linux/kernel/git/davidb/linux-msm into next/late
From David Brown:
MSM clock updates for 3.11.
Per Stephen Boyd's coverletter:
Resending to collect higher level maintainer acks per Olof's request.
The plan is to push this patchset through MSM to the arm-soc tree.
This patchset moves the existing MSM clock code and affected drivers
to the common clock framework. A prerequisite of moving to the common
clock framework is to use clk_prepare() and clk_enable() so the first
few patches migrate drivers to that call (clk_prepare() is a no-op on
MSM right now). It also removes some custom clock APIs that MSM
provides and finally moves the proc_comm clock code to the common
struct clk.
This patch series will be used as the foundation of the MSM 8660/8960
clock code that I plan to send out after this series.
* tag 'msm-clock-for-3.11b' of git://git.kernel.org/pub/scm/linux/kernel/git/davidb/linux-msm:
ARM: msm: Migrate to common clock framework
ARM: msm: Make proc_comm clock control into a platform driver
ARM: msm: Prepare clk_get() users in mach-msm for clock-pcom driver
ARM: msm: Remove clock-7x30.h include file
ARM: msm: Remove custom clk_set_{max,min}_rate() API
ARM: msm: Remove custom clk_set_flags() API
msm: iommu: Use clk_set_rate() instead of clk_set_min_rate()
msm: iommu: Convert to clk_prepare/unprepare
msm_sdcc: Convert to clk_prepare/unprepare
usb: otg: msm: Convert to clk_prepare/unprepare
msm_serial: Use devm_clk_get() and properly return errors
msm_serial: Convert to clk_prepare/unprepare
Acked-by: Chris Ball <cjb@laptop.org> # for msm_sdcc.c
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/msm_serial.c | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c index b11e99797fd8..2c6cfb3cf032 100644 --- a/drivers/tty/serial/msm_serial.c +++ b/drivers/tty/serial/msm_serial.c | |||
@@ -408,9 +408,9 @@ static void msm_init_clock(struct uart_port *port) | |||
408 | { | 408 | { |
409 | struct msm_port *msm_port = UART_TO_MSM(port); | 409 | struct msm_port *msm_port = UART_TO_MSM(port); |
410 | 410 | ||
411 | clk_enable(msm_port->clk); | 411 | clk_prepare_enable(msm_port->clk); |
412 | if (!IS_ERR(msm_port->pclk)) | 412 | if (!IS_ERR(msm_port->pclk)) |
413 | clk_enable(msm_port->pclk); | 413 | clk_prepare_enable(msm_port->pclk); |
414 | msm_serial_set_mnd_regs(port); | 414 | msm_serial_set_mnd_regs(port); |
415 | } | 415 | } |
416 | 416 | ||
@@ -486,7 +486,7 @@ static void msm_shutdown(struct uart_port *port) | |||
486 | msm_port->imr = 0; | 486 | msm_port->imr = 0; |
487 | msm_write(port, 0, UART_IMR); /* disable interrupts */ | 487 | msm_write(port, 0, UART_IMR); /* disable interrupts */ |
488 | 488 | ||
489 | clk_disable(msm_port->clk); | 489 | clk_disable_unprepare(msm_port->clk); |
490 | 490 | ||
491 | free_irq(port->irq, port); | 491 | free_irq(port->irq, port); |
492 | } | 492 | } |
@@ -688,14 +688,14 @@ static void msm_power(struct uart_port *port, unsigned int state, | |||
688 | 688 | ||
689 | switch (state) { | 689 | switch (state) { |
690 | case 0: | 690 | case 0: |
691 | clk_enable(msm_port->clk); | 691 | clk_prepare_enable(msm_port->clk); |
692 | if (!IS_ERR(msm_port->pclk)) | 692 | if (!IS_ERR(msm_port->pclk)) |
693 | clk_enable(msm_port->pclk); | 693 | clk_prepare_enable(msm_port->pclk); |
694 | break; | 694 | break; |
695 | case 3: | 695 | case 3: |
696 | clk_disable(msm_port->clk); | 696 | clk_disable_unprepare(msm_port->clk); |
697 | if (!IS_ERR(msm_port->pclk)) | 697 | if (!IS_ERR(msm_port->pclk)) |
698 | clk_disable(msm_port->pclk); | 698 | clk_disable_unprepare(msm_port->pclk); |
699 | break; | 699 | break; |
700 | default: | 700 | default: |
701 | printk(KERN_ERR "msm_serial: Unknown PM state %d\n", state); | 701 | printk(KERN_ERR "msm_serial: Unknown PM state %d\n", state); |
@@ -884,19 +884,22 @@ static int __init msm_serial_probe(struct platform_device *pdev) | |||
884 | msm_port->is_uartdm = 0; | 884 | msm_port->is_uartdm = 0; |
885 | 885 | ||
886 | if (msm_port->is_uartdm) { | 886 | if (msm_port->is_uartdm) { |
887 | msm_port->clk = clk_get(&pdev->dev, "gsbi_uart_clk"); | 887 | msm_port->clk = devm_clk_get(&pdev->dev, "gsbi_uart_clk"); |
888 | msm_port->pclk = clk_get(&pdev->dev, "gsbi_pclk"); | 888 | msm_port->pclk = devm_clk_get(&pdev->dev, "gsbi_pclk"); |
889 | } else { | 889 | } else { |
890 | msm_port->clk = clk_get(&pdev->dev, "uart_clk"); | 890 | msm_port->clk = devm_clk_get(&pdev->dev, "uart_clk"); |
891 | msm_port->pclk = ERR_PTR(-ENOENT); | 891 | msm_port->pclk = ERR_PTR(-ENOENT); |
892 | } | 892 | } |
893 | 893 | ||
894 | if (unlikely(IS_ERR(msm_port->clk) || (IS_ERR(msm_port->pclk) && | 894 | if (IS_ERR(msm_port->clk)) |
895 | msm_port->is_uartdm))) | 895 | return PTR_ERR(msm_port->clk); |
896 | return PTR_ERR(msm_port->clk); | 896 | |
897 | if (msm_port->is_uartdm) { | ||
898 | if (IS_ERR(msm_port->pclk)) | ||
899 | return PTR_ERR(msm_port->pclk); | ||
897 | 900 | ||
898 | if (msm_port->is_uartdm) | ||
899 | clk_set_rate(msm_port->clk, 1843200); | 901 | clk_set_rate(msm_port->clk, 1843200); |
902 | } | ||
900 | 903 | ||
901 | port->uartclk = clk_get_rate(msm_port->clk); | 904 | port->uartclk = clk_get_rate(msm_port->clk); |
902 | printk(KERN_INFO "uartclk = %d\n", port->uartclk); | 905 | printk(KERN_INFO "uartclk = %d\n", port->uartclk); |
@@ -919,9 +922,9 @@ static int __init msm_serial_probe(struct platform_device *pdev) | |||
919 | 922 | ||
920 | static int msm_serial_remove(struct platform_device *pdev) | 923 | static int msm_serial_remove(struct platform_device *pdev) |
921 | { | 924 | { |
922 | struct msm_port *msm_port = platform_get_drvdata(pdev); | 925 | struct uart_port *port = platform_get_drvdata(pdev); |
923 | 926 | ||
924 | clk_put(msm_port->clk); | 927 | uart_remove_one_port(&msm_uart_driver, port); |
925 | 928 | ||
926 | return 0; | 929 | return 0; |
927 | } | 930 | } |