From patchwork Wed Oct 10 11:02:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 12091 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 2421F23F5F for ; Wed, 10 Oct 2012 11:02:57 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id B8888A19047 for ; Wed, 10 Oct 2012 11:02:56 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so582844iej.11 for ; Wed, 10 Oct 2012 04:02:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:mime-version:content-type :x-gm-message-state; bh=U9JMZhFRJFgpKocUBSWos2CdpgdGvOs4QwAvYbnF9Qk=; b=RhHI7xvEfeE7OqCVwVwbeBGPiQCELPPhN3r0NKJiEknhi4FHtHl62ZGL3JMFTwmIgD x+pq5MvHw7OjX5WcYG8nuRsQrJak52LmP52fg5DmXU9PUTL9nehswBwx6TCWtfHp8BPn Wo//FWviwyeVL8Tu9SFiljUr6GD+jqgqF9qLy+JTaBceR6CorEjrasrhuoUUCSPKUEyP Mr7FPC2pGZLHQfmozB/iB36rliLMdcA22bB2KsbGc8LNvp3a5E8F6Vl8IKz/NQChlGes 99mTIxEdlrQN7go1xs0mR2hKe9ehFWspbygq5rPUev/1vITg1ixeoXUb3wyt97Wb+hDO ztzw== Received: by 10.50.159.194 with SMTP id xe2mr4716553igb.62.1349866975880; Wed, 10 Oct 2012 04:02:55 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp205031igt; Wed, 10 Oct 2012 04:02:54 -0700 (PDT) Received: by 10.14.213.201 with SMTP id a49mr32344797eep.4.1349866973773; Wed, 10 Oct 2012 04:02:53 -0700 (PDT) Received: from eu1sys200aog104.obsmtp.com (eu1sys200aog104.obsmtp.com [207.126.144.117]) by mx.google.com with SMTP id v4si559940eel.80.2012.10.10.04.02.51 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 10 Oct 2012 04:02:53 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.117 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.117; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.117 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob104.postini.com ([207.126.147.11]) with SMTP ID DSNKUHVV2qjjANhsT7N5uvvW3GGvCmnSAsZ+@postini.com; Wed, 10 Oct 2012 11:02:53 UTC Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 9BF90182; Wed, 10 Oct 2012 11:02:34 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 0835A2908; Wed, 10 Oct 2012 11:02:34 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id EEF60A8093; Wed, 10 Oct 2012 13:02:28 +0200 (CEST) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.3.83.0; Wed, 10 Oct 2012 13:02:33 +0200 From: Linus Walleij To: Ben Dooks , Wolfram Sang , Cc: Anmar Oueja , Philippe Begnic , Ulf Hansson , Linus Walleij Subject: [PATCH 1/2 RESEND] i2c-nomadik: Fixup clock handling Date: Wed, 10 Oct 2012 13:02:26 +0200 Message-ID: <1349866946-10650-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.11.3 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQkwnwn2+s4jpH7cv8zzdDudl+aqe/IBACgSt/A+L+iRm3W4Ga5zflIfJlYiS07DvwqZboNx From: Philippe Begnic Make sure to clk_prepare as well as clk_enable. Signed-off-by: Philippe Begnic Signed-off-by: Ulf Hansson Signed-off-by: Linus Walleij --- 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;