ARM: mxc: time: convert to clk_prepare/clk_unprepare
Subsystems (3)
PATCH 1/9 ARM: mxc: time: convert to clk_prepare/clk_unprepare
--- arch/arm/plat-mxc/time.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/plat-mxc/time.c +1 -0
@@ -292,6 +292,7 @@ void __init mxc_timer_init(struct clk *timer_clk, void __iomem *base, int irq) {uint32_t tctl_val; +clk_prepare (timer_clk);clk_enable (timer_clk); timer_base = base;
Signature · 1 line
1.7.5.4
PATCH 2/9 ARM: mxc: ahci: convert to clk_prepare/clk_unprepare
--- arch/arm/plat-mxc/devices/platform-ahci-imx.c | 20 ++++++++++++++++++-- 1 files changed, 18 insertions(+), 2 deletions(-)
arch/arm/plat-mxc/devices/platform-ahci-imx.c +18 -2
@@ -60,10 +60,15 @@ static int imx_sata_init(struct device *dev, void __iomem *addr)dev_err (dev,"no sata clock.\n" );return PTR_ERR (sata_clk); } + ret =clk_prepare (sata_clk); +if (ret) { +dev_err (dev,"can't prepare sata clock.\n" ); + goto put_sata_clk; + } ret =clk_enable (sata_clk);if (ret) {dev_err (dev,"can't enable sata clock.\n" ); - goto put_sata_clk; + goto unprepare_sata_clk; }/* Get the AHCI SATA PHY CLK */
@@ -73,10 +78,15 @@ static int imx_sata_init(struct device *dev, void __iomem *addr) ret =PTR_ERR (sata_ref_clk); goto release_sata_clk; } + ret =clk_prepare (sata_ref_clk); +if (ret) { +dev_err (dev,"can't prepare sata ref clock.\n" ); + goto put_sata_ref_clk; + } ret =clk_enable (sata_ref_clk);if (ret) {dev_err (dev,"can't enable sata ref clock.\n" ); - goto put_sata_ref_clk; + goto unprepare_sata_ref_clk; }/* Get the AHB clock rate, and configure the TIMER1MS reg later */
@@ -105,10 +115,14 @@ static int imx_sata_init(struct device *dev, void __iomem *addr) release_sata_ref_clk:clk_disable (sata_ref_clk); +unprepare_sata_ref_clk: +clk_unprepare (sata_ref_clk); put_sata_ref_clk:clk_put (sata_ref_clk); release_sata_clk:clk_disable (sata_clk); +unprepare_sata_clk: +clk_unprepare (sata_clk); put_sata_clk:clk_put (sata_clk);
@@ -118,9 +132,11 @@ put_sata_clk:static void imx_sata_exit (struct device *dev) {clk_disable (sata_ref_clk); +clk_unprepare (sata_ref_clk);clk_put (sata_ref_clk);clk_disable (sata_clk); +clk_unprepare (sata_clk);clk_put (sata_clk); }
Signature · 1 line
1.7.5.4
PATCH 3/9 ARM: mxc: pwm: convert to clk_prepare/clk_unprepare
In reply to Richard Zhao--- arch/arm/plat-mxc/pwm.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
arch/arm/plat-mxc/pwm.c +6 -1
@@ -118,9 +118,13 @@ int pwm_enable(struct pwm_device *pwm)int rc =0 ;if (!pwm->clk_enabled) { - rc =clk_enable (pwm->clk); + rc =clk_prepare (pwm->clk);if (!rc) + rc =clk_enable (pwm->clk); +if (!rc) { pwm->clk_enabled =1 ; + }else +clk_unprepare (pwm->clk); }return rc; }
@@ -132,6 +136,7 @@ void pwm_disable(struct pwm_device *pwm)if (pwm->clk_enabled) {clk_disable (pwm->clk); +clk_unprepare (pwm->clk); pwm->clk_enabled =0 ; } }
Signature · 1 line
1.7.5.4
PATCH 4/9 ARM: mxc: epit: convert to clk_prepare/clk_unprepare
In reply to Richard Zhao--- arch/arm/plat-mxc/epit.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/plat-mxc/epit.c +1 -0
@@ -203,6 +203,7 @@ static int __init epit_clockevent_init(struct clk *timer_clk)void __init epit_timer_init (struct clk *timer_clk,void __iomem *base,int irq) { +clk_prepare (timer_clk);clk_enable (timer_clk); timer_base = base;
Signature · 1 line
1.7.5.4
PATCH 5/9 ARM: mxc: arch_reset: convert to clk_prepare/clk_unprepare
In reply to Richard Zhao--- arch/arm/plat-mxc/system.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
arch/arm/plat-mxc/system.c +3 -1
@@ -53,8 +53,10 @@ void arch_reset(char mode, const char *cmd)struct clk *clk; clk =clk_get_sys ("imx2-wdt.0" ,NULL ); -if (!IS_ERR (clk)) +if (!IS_ERR (clk)) { +clk_prepare (clk);clk_enable (clk); + } wcr_enable = (1 <<2 ); }
Signature · 1 line
1.7.5.4
PATCH 6/9 ARM: mxc: audmux-v2: convert to clk_prepare/clk_unprepare
In reply to Richard Zhao--- arch/arm/plat-mxc/audmux-v2.c | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-)
arch/arm/plat-mxc/audmux-v2.c +12 -4
@@ -72,14 +72,18 @@ static ssize_t audmux_read_file(struct file *file, char __user *user_buf,if (!buf)return -ENOMEM ; -if (audmux_clk) +if (audmux_clk) { +clk_prepare (audmux_clk);clk_enable (audmux_clk); + } ptcr =readl (audmux_base +MXC_AUDMUX_V2_PTCR (port)); pdcr =readl (audmux_base +MXC_AUDMUX_V2_PDCR (port)); -if (audmux_clk) +if (audmux_clk) {clk_disable (audmux_clk); +clk_unprepare (audmux_clk); + } ret =snprintf (buf,PAGE_SIZE ,"PDCR: %08x\nPTCR: %08x\n" , pdcr, ptcr);
@@ -171,14 +175,18 @@ int mxc_audmux_v2_configure_port(unsigned int port, unsigned int ptcr,if (!audmux_base)return -ENOSYS ; -if (audmux_clk) +if (audmux_clk) { +clk_prepare (audmux_clk);clk_enable (audmux_clk); + }writel (ptcr, audmux_base +MXC_AUDMUX_V2_PTCR (port));writel (pdcr, audmux_base +MXC_AUDMUX_V2_PDCR (port)); -if (audmux_clk) +if (audmux_clk) {clk_disable (audmux_clk); +clk_unprepare (audmux_clk); + }return 0 ; }
Signature · 1 line
1.7.5.4
PATCH 7/9 ARM: pm-imx5: convert to clk_prepare/clk_unprepare
In reply to Richard Zhao--- arch/arm/mach-mx5/pm-imx5.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-)
arch/arm/mach-mx5/pm-imx5.c +8 -1
@@ -22,7 +22,13 @@ static struct clk *gpc_dvfs_clk;static int mx5_suspend_prepare (void ) { -return clk_enable (gpc_dvfs_clk); +int ret; + ret =clk_prepare (gpc_dvfs_clk); +if (!ret) + ret =clk_enable (gpc_dvfs_clk); +if (ret) +clk_unprepare (gpc_dvfs_clk); +return ret; }static int mx5_suspend_enter (suspend_state_t state)
@@ -53,6 +59,7 @@ static int mx5_suspend_enter(suspend_state_t state)static void mx5_suspend_finish (void ) {clk_disable (gpc_dvfs_clk); +clk_unprepare (gpc_dvfs_clk); }static int mx5_pm_valid (suspend_state_t state)
Signature · 1 line
1.7.5.4
PATCH 8/9 ARM: mx31moboard: convert to clk_prepare/clk_unprepare
In reply to Richard Zhao--- arch/arm/mach-imx/mach-mx31moboard.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
arch/arm/mach-imx/mach-mx31moboard.c +3 -1
@@ -504,8 +504,10 @@ static void mx31moboard_poweroff(void) {struct clk *clk =clk_get_sys ("imx2-wdt.0" ,NULL ); -if (!IS_ERR (clk)) +if (!IS_ERR (clk)) { +clk_prepare (clk);clk_enable (clk); + }mxc_iomux_mode (MX31_PIN_WATCHDOG_RST__WATCHDOG_RST );
Signature · 1 line
1.7.5.4
PATCH 9/9 ARM: mxs: convert to clk_prepare/clk_unprepare
In reply to Richard Zhao--- arch/arm/mach-mxs/system.c | 4 +++- arch/arm/mach-mxs/timer.c | 1 + 2 files changed, 4 insertions(+), 1 deletions(-)
arch/arm/mach-mxs/system.c +3 -1
@@ -65,8 +65,10 @@ static int __init mxs_arch_reset_init(void) MX28_CLKCTRL_RESET_OFFSET); clk =clk_get_sys ("rtc" ,NULL ); -if (!IS_ERR (clk)) +if (!IS_ERR (clk)) { +clk_prepare (clk);clk_enable (clk); + }return 0 ; }
arch/arm/mach-mxs/timer.c +1 -0
@@ -245,6 +245,7 @@ static int __init mxs_clocksource_init(struct clk *timer_clk)void __init mxs_timer_init (struct clk *timer_clk,int irq) { +clk_prepare (timer_clk);clk_enable (timer_clk);/*
Signature · 1 line
1.7.5.4
Sascha Hauer
maintainerPATCH 1/9 ARM: mxc: time: convert to clk_prepare/clk_unprepare
In reply to Richard ZhaoHi Richard,
I think we should introduce two new helpers:
clk_prepare_enable()clk_disable_unprepare()
This series could look much nicer with it.
Minor nitpick: I don't like the subject. 'convert' suggests that you are replacing something, instead you are adding something.
Sascha
Signature · 4 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
PATCH 1/9 ARM: mxc: time: convert to clk_prepare/clk_unprepare
Quoted 6 lines · Sascha Hauer
Hi Richard,
I think we should introduce two new helpers:
clk_prepare_enable()clk_disable_unprepare()
right. I will add two inline functions in include/linux/clk.h.
Quoted 5 lines
This series could look much nicer with it.
Minor nitpick: I don't like the subject. 'convert' suggests that you are replacing something, instead you are adding something.
It's copied from other commits doing the same thing. If you don't like it, I can change it to "Add clk_prepare/clk_unprepare support".
For other driver patch doing the same thing, do you think you can handle it too, or let other different driver maintainer handle it? If you can, I'll merge it into the same series.
Richard
Quoted 14 lines
Sascha
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel at lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel