mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
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.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
iQIcBAABAgAGBQJRyK/7AAoJEOa6n1xeVN+Cu1UQALf7pzve7+JMbpHp9HtQPTCk
GxGBBZ5ay0yWYYSSDRNqMbxNAHxhTuz26AW1CSSAHNpxotMB9t1y4AGkbSqxl3H8
gZZ+9PwSBGN6kABSjfrae1kPxnU6Mg/9J56E5iXFLst0qIvgDejUGG8BXLHDuzjM
weQZJf6p6t9SZIHc/80RUsiVmRkqKM9Mp6NvyO4irQOKwfvQ76mjWNqiUrQS7wwA
+glbwR3PMg31bvUXOcWuoBp3zbZYvN65bUSwZMIagynqYqU8g+bwDA2NQKjFzoXM
ActLyurznSytcER+/+3JbRh32kMI1Bh/jnH2VbqS4TNQbtIuJd6VjYP4kE4HsRsZ
MkK2pEUS4GuMEdLqeJW3d5ch+u45CQVdtDLuSUH0e9j3RqQNHmZWIvp3IhXouKG+
HMeeo2RQfdn3Y7A+TJ18llVUW/2BTBKjnr1MvR+9JoZmMpkV0tnVnD19MQcKvEXK
dM7Qp7apAS5KpXPTsWvRXwT4uFHoGiRpyluI2UrqEjOVhYQW4DBzfJ/GQDJ80Wd8
HFH0ZPjvi2W3jLeFqOwGYzbcMgyGe4pvkkUm1yj/EV3j5GyFSCPxOhqn4t/fJegk
Vg2AMDeSf+cb504pr8AkfYF0Z0RqGBTgyKOwslgGwaRCppOHW7DZL0R6M3/5a48H
9C4z3RJ4UcTt1a93ZaV3
=0OVE
-----END PGP SIGNATURE-----
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 <[email protected]> # for msm_sdcc.c
Signed-off-by: Olof Johansson <[email protected]>
This commit is contained in:
commit
8c3d913888
24 changed files with 243 additions and 659 deletions
|
|
@ -408,9 +408,9 @@ static void msm_init_clock(struct uart_port *port)
|
|||
{
|
||||
struct msm_port *msm_port = UART_TO_MSM(port);
|
||||
|
||||
clk_enable(msm_port->clk);
|
||||
clk_prepare_enable(msm_port->clk);
|
||||
if (!IS_ERR(msm_port->pclk))
|
||||
clk_enable(msm_port->pclk);
|
||||
clk_prepare_enable(msm_port->pclk);
|
||||
msm_serial_set_mnd_regs(port);
|
||||
}
|
||||
|
||||
|
|
@ -486,7 +486,7 @@ static void msm_shutdown(struct uart_port *port)
|
|||
msm_port->imr = 0;
|
||||
msm_write(port, 0, UART_IMR); /* disable interrupts */
|
||||
|
||||
clk_disable(msm_port->clk);
|
||||
clk_disable_unprepare(msm_port->clk);
|
||||
|
||||
free_irq(port->irq, port);
|
||||
}
|
||||
|
|
@ -688,14 +688,14 @@ static void msm_power(struct uart_port *port, unsigned int state,
|
|||
|
||||
switch (state) {
|
||||
case 0:
|
||||
clk_enable(msm_port->clk);
|
||||
clk_prepare_enable(msm_port->clk);
|
||||
if (!IS_ERR(msm_port->pclk))
|
||||
clk_enable(msm_port->pclk);
|
||||
clk_prepare_enable(msm_port->pclk);
|
||||
break;
|
||||
case 3:
|
||||
clk_disable(msm_port->clk);
|
||||
clk_disable_unprepare(msm_port->clk);
|
||||
if (!IS_ERR(msm_port->pclk))
|
||||
clk_disable(msm_port->pclk);
|
||||
clk_disable_unprepare(msm_port->pclk);
|
||||
break;
|
||||
default:
|
||||
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)
|
|||
msm_port->is_uartdm = 0;
|
||||
|
||||
if (msm_port->is_uartdm) {
|
||||
msm_port->clk = clk_get(&pdev->dev, "gsbi_uart_clk");
|
||||
msm_port->pclk = clk_get(&pdev->dev, "gsbi_pclk");
|
||||
msm_port->clk = devm_clk_get(&pdev->dev, "gsbi_uart_clk");
|
||||
msm_port->pclk = devm_clk_get(&pdev->dev, "gsbi_pclk");
|
||||
} else {
|
||||
msm_port->clk = clk_get(&pdev->dev, "uart_clk");
|
||||
msm_port->clk = devm_clk_get(&pdev->dev, "uart_clk");
|
||||
msm_port->pclk = ERR_PTR(-ENOENT);
|
||||
}
|
||||
|
||||
if (unlikely(IS_ERR(msm_port->clk) || (IS_ERR(msm_port->pclk) &&
|
||||
msm_port->is_uartdm)))
|
||||
return PTR_ERR(msm_port->clk);
|
||||
if (IS_ERR(msm_port->clk))
|
||||
return PTR_ERR(msm_port->clk);
|
||||
|
||||
if (msm_port->is_uartdm) {
|
||||
if (IS_ERR(msm_port->pclk))
|
||||
return PTR_ERR(msm_port->pclk);
|
||||
|
||||
if (msm_port->is_uartdm)
|
||||
clk_set_rate(msm_port->clk, 1843200);
|
||||
}
|
||||
|
||||
port->uartclk = clk_get_rate(msm_port->clk);
|
||||
printk(KERN_INFO "uartclk = %d\n", port->uartclk);
|
||||
|
|
@ -919,9 +922,9 @@ static int __init msm_serial_probe(struct platform_device *pdev)
|
|||
|
||||
static int msm_serial_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct msm_port *msm_port = platform_get_drvdata(pdev);
|
||||
struct uart_port *port = platform_get_drvdata(pdev);
|
||||
|
||||
clk_put(msm_port->clk);
|
||||
uart_remove_one_port(&msm_uart_driver, port);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue