* [PATCH 9/10] ARM: PNX4008: convert i2c-pnx to use clk API enable/disable calls
@ 2009-12-21 23:23 Kevin Wells
2009-12-22 6:53 ` Vitaly Wool
0 siblings, 1 reply; 2+ messages in thread
From: Kevin Wells @ 2009-12-21 23:23 UTC (permalink / raw)
To: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Cc: Russell King - ARM Linux, Vitaly Wool
Signed-off-by: Kevin Wells <kevin.wells-3arQi8VN3Tc@public.gmane.org>
---
arch/arm/mach-pnx4008/clock.c | 12 ++++++------
drivers/i2c/busses/i2c-pnx.c | 18 +++++++++---------
2 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/arch/arm/mach-pnx4008/clock.c b/arch/arm/mach-pnx4008/clock.c
index 1ad9a9e..3f6b681 100644
--- a/arch/arm/mach-pnx4008/clock.c
+++ b/arch/arm/mach-pnx4008/clock.c
@@ -640,30 +640,30 @@ static struct clk i2c0_ck = {
.name = "i2c0_ck",
.parent = &per_ck,
.flags = NEEDS_INITIALIZATION,
- .round_rate = &on_off_round_rate,
- .set_rate = &on_off_set_rate,
.enable_shift = 0,
.enable_reg = I2CCLKCTRL_REG,
+ .enable = clk_reg_enable,
+ .disable = clk_reg_disable,
};
static struct clk i2c1_ck = {
.name = "i2c1_ck",
.parent = &per_ck,
.flags = NEEDS_INITIALIZATION,
- .round_rate = &on_off_round_rate,
- .set_rate = &on_off_set_rate,
.enable_shift = 1,
.enable_reg = I2CCLKCTRL_REG,
+ .enable = clk_reg_enable,
+ .disable = clk_reg_disable,
};
static struct clk i2c2_ck = {
.name = "i2c2_ck",
.parent = &per_ck,
.flags = NEEDS_INITIALIZATION,
- .round_rate = &on_off_round_rate,
- .set_rate = &on_off_set_rate,
.enable_shift = 2,
.enable_reg = USB_OTG_CLKCTRL_REG,
+ .enable = clk_reg_enable,
+ .disable = clk_reg_disable,
};
static struct clk spi0_ck = {
diff --git a/drivers/i2c/busses/i2c-pnx.c b/drivers/i2c/busses/i2c-pnx.c
index c4df21c..7ed425a 100644
--- a/drivers/i2c/busses/i2c-pnx.c
+++ b/drivers/i2c/busses/i2c-pnx.c
@@ -555,8 +555,8 @@ static int i2c_pnx_controller_suspend(struct platform_device *pdev,
struct i2c_pnx_data *i2c_pnx = platform_get_drvdata(pdev);
struct i2c_pnx_algo_data *alg_data = i2c_pnx->adapter->algo_data;
- /* FIXME: disable clock? */
- clk_set_rate(alg_data->clk, 1);
+ /* FIXME: shouldn't this be clk_disable? */
+ clk_enable(alg_data->clk);
return 0;
}
@@ -566,9 +566,7 @@ static int i2c_pnx_controller_resume(struct platform_device *pdev)
struct i2c_pnx_data *i2c_pnx = platform_get_drvdata(pdev);
struct i2c_pnx_algo_data *alg_data = i2c_pnx->adapter->algo_data;
- clk_set_rate(alg_data->clk, 1);
-
- return 0;
+ return clk_enable(alg_data->clk);
}
#else
#define i2c_pnx_controller_suspend NULL
@@ -630,7 +628,9 @@ static int __devinit i2c_pnx_probe(struct platform_device *pdev)
goto out_release;
}
- clk_set_rate(alg_data->clk, 1);
+ ret = clk_enable(alg_data->clk);
+ if (ret)
+ goto out_unmap;
/*
* Clock Divisor High This value is the number of system clocks
@@ -650,7 +650,7 @@ static int __devinit i2c_pnx_probe(struct platform_device *pdev)
iowrite32(mcntrl_reset, I2C_REG_CTL(alg_data));
if (wait_reset(I2C_PNX_TIMEOUT, alg_data)) {
ret = -ENODEV;
- goto out_unmap;
+ goto out_clock;
}
init_completion(&alg_data->mif.complete);
@@ -676,7 +676,7 @@ static int __devinit i2c_pnx_probe(struct platform_device *pdev)
out_irq:
free_irq(alg_data->irq, i2c_pnx->adapter);
out_clock:
- clk_set_rate(alg_data->clk, 0);
+ clk_disable(alg_data->clk);
out_unmap:
iounmap((void *)alg_data->ioaddr);
out_release:
@@ -697,7 +697,7 @@ static int __devexit i2c_pnx_remove(struct platform_device *pdev)
free_irq(alg_data->irq, i2c_pnx->adapter);
i2c_del_adapter(adap);
- clk_set_rate(alg_data->clk, 0);
+ clk_disable(alg_data->clk);
iounmap((void *)alg_data->ioaddr);
release_mem_region(alg_data->base, I2C_PNX_REGION_SIZE);
clk_put(alg_data->clk);
--
1.6.0.6
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 9/10] ARM: PNX4008: convert i2c-pnx to use clk API enable/disable calls
2009-12-21 23:23 [PATCH 9/10] ARM: PNX4008: convert i2c-pnx to use clk API enable/disable calls Kevin Wells
@ 2009-12-22 6:53 ` Vitaly Wool
0 siblings, 0 replies; 2+ messages in thread
From: Vitaly Wool @ 2009-12-22 6:53 UTC (permalink / raw)
To: Kevin Wells
Cc: Russell King - ARM Linux, linux-i2c@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
[-- Attachment #1.1: Type: text/plain, Size: 353 bytes --]
On Tue, Dec 22, 2009 at 2:23 AM, Kevin Wells <kevin.wells@nxp.com> wrote:
>
> Signed-off-by: Kevin Wells <kevin.wells@nxp.com>
>
Acked-by: Vitaly Wool <vitalywool@gmail.com>
> ---
> arch/arm/mach-pnx4008/clock.c | 12 ++++++------
> drivers/i2c/busses/i2c-pnx.c | 18 +++++++++---------
> 2 files changed, 15 insertions(+), 15 deletions(-)
>
[-- Attachment #1.2: Type: text/html, Size: 889 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-12-22 6:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-21 23:23 [PATCH 9/10] ARM: PNX4008: convert i2c-pnx to use clk API enable/disable calls Kevin Wells
2009-12-22 6:53 ` Vitaly Wool
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).