* [PATCH 1/2 RESEND] i2c-nomadik: Fixup clock handling
@ 2012-10-10 11:02 Linus Walleij
[not found] ` <1349866946-10650-1-git-send-email-linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Linus Walleij @ 2012-10-10 11:02 UTC (permalink / raw)
To: Ben Dooks, Wolfram Sang, linux-i2c-u79uwXL29TY76Z2rM5mHXA
Cc: Anmar Oueja, Philippe Begnic, Ulf Hansson, Linus Walleij
From: Philippe Begnic <philippe.begnic-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>
Make sure to clk_prepare as well as clk_enable.
Signed-off-by: Philippe Begnic <philippe.begnic-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>
Signed-off-by: Ulf Hansson <ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Signed-off-by: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
drivers/i2c/busses/i2c-nomadik.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c
index 1b898b6..3eeae52 100644
--- a/drivers/i2c/busses/i2c-nomadik.c
+++ b/drivers/i2c/busses/i2c-nomadik.c
@@ -642,7 +642,11 @@ static int nmk_i2c_xfer(struct i2c_adapter *i2c_adap,
pm_runtime_get_sync(&dev->adev->dev);
- clk_enable(dev->clk);
+ status = clk_prepare_enable(dev->clk);
+ if (status) {
+ dev_err(&dev->adev->dev, "can't prepare_enable clock\n");
+ goto out_clk;
+ }
status = init_hw(dev);
if (status)
@@ -669,7 +673,8 @@ static int nmk_i2c_xfer(struct i2c_adapter *i2c_adap,
}
out:
- clk_disable(dev->clk);
+ clk_disable_unprepare(dev->clk);
+out_clk:
pm_runtime_put_sync(&dev->adev->dev);
dev->busy = false;
--
1.7.11.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2 RESEND] i2c-nomadik: Fixup clock handling
[not found] ` <1349866946-10650-1-git-send-email-linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>
@ 2012-10-22 13:12 ` Ulf Hansson
2012-11-01 21:43 ` Wolfram Sang
1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2012-10-22 13:12 UTC (permalink / raw)
To: Linus Walleij
Cc: Ben Dooks, Wolfram Sang, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
Anmar Oueja, Philippe Begnic, Linus Walleij
Hi Linus,
Thanks for resending this patch. This patch is needed for me to be
able to add clock lookups for the i2c devices for ux500, unless the
boot will be broken.
Kind regards
Ulf Hansson
On 10 October 2012 13:02, Linus Walleij <linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org> wrote:
> From: Philippe Begnic <philippe.begnic-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>
>
> Make sure to clk_prepare as well as clk_enable.
>
> Signed-off-by: Philippe Begnic <philippe.begnic-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>
> Signed-off-by: Ulf Hansson <ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> Signed-off-by: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> ---
> drivers/i2c/busses/i2c-nomadik.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c
> index 1b898b6..3eeae52 100644
> --- a/drivers/i2c/busses/i2c-nomadik.c
> +++ b/drivers/i2c/busses/i2c-nomadik.c
> @@ -642,7 +642,11 @@ static int nmk_i2c_xfer(struct i2c_adapter *i2c_adap,
>
> pm_runtime_get_sync(&dev->adev->dev);
>
> - clk_enable(dev->clk);
> + status = clk_prepare_enable(dev->clk);
> + if (status) {
> + dev_err(&dev->adev->dev, "can't prepare_enable clock\n");
> + goto out_clk;
> + }
>
> status = init_hw(dev);
> if (status)
> @@ -669,7 +673,8 @@ static int nmk_i2c_xfer(struct i2c_adapter *i2c_adap,
> }
>
> out:
> - clk_disable(dev->clk);
> + clk_disable_unprepare(dev->clk);
> +out_clk:
> pm_runtime_put_sync(&dev->adev->dev);
>
> dev->busy = false;
> --
> 1.7.11.3
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2 RESEND] i2c-nomadik: Fixup clock handling
[not found] ` <1349866946-10650-1-git-send-email-linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>
2012-10-22 13:12 ` Ulf Hansson
@ 2012-11-01 21:43 ` Wolfram Sang
1 sibling, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2012-11-01 21:43 UTC (permalink / raw)
To: Linus Walleij
Cc: Ben Dooks, linux-i2c-u79uwXL29TY76Z2rM5mHXA, Anmar Oueja,
Philippe Begnic, Ulf Hansson, Linus Walleij
[-- Attachment #1: Type: text/plain, Size: 664 bytes --]
On Wed, Oct 10, 2012 at 01:02:26PM +0200, Linus Walleij wrote:
> From: Philippe Begnic <philippe.begnic-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>
>
> Make sure to clk_prepare as well as clk_enable.
>
> Signed-off-by: Philippe Begnic <philippe.begnic-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>
> Signed-off-by: Ulf Hansson <ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> Signed-off-by: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Applied to for-current, thanks.
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-11-01 21:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-10 11:02 [PATCH 1/2 RESEND] i2c-nomadik: Fixup clock handling Linus Walleij
[not found] ` <1349866946-10650-1-git-send-email-linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>
2012-10-22 13:12 ` Ulf Hansson
2012-11-01 21:43 ` Wolfram Sang
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).