From patchwork Tue Aug 21 08:45:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 10824 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 E101C23E37 for ; Tue, 21 Aug 2012 08:45:52 +0000 (UTC) Received: from mail-ob0-f180.google.com (mail-ob0-f180.google.com [209.85.214.180]) by fiordland.canonical.com (Postfix) with ESMTP id 56A4FA185A6 for ; Tue, 21 Aug 2012 08:45:44 +0000 (UTC) Received: by obceq6 with SMTP id eq6so10838154obc.11 for ; Tue, 21 Aug 2012 01:45:51 -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=Oc++ye5R825IchoQKLNIEe+mQP/5lukF8v0iXv0KO+w=; b=PI8SuKFSgdNEW00b7nQJMKXVrPO4FsO2iazoHmkiDelJBooQuWy3hbiQrmyylmX7nY CpX8mk/7ywBkg7EifidDPLlBMelnxpEz0InqAZxq2v+KQM8mBmC+TvgTaYPorXuVsM6I +2wOlsf+5a4IqCfqZnY79SZyjMxuTNElg8CZzn8fbH073zgNC8EsTTZ5fjbZwRgP2AB0 A4x8x3h2nq8RF8KwWs09O8FYvNjv6dDHHQL0EqkqX6aS6Van/U3BuPfUfl6nxpgBNZqh dCgRm4NSBsTz9KYuw1AqtJVAjhlDxwWEsYwEHW7C3nUNzC2sDvUsgfCVxpuErk/bD4eS fEnw== Received: by 10.50.180.129 with SMTP id do1mr12683692igc.28.1345538751096; Tue, 21 Aug 2012 01:45:51 -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.184.232 with SMTP id ex8csp131338igc; Tue, 21 Aug 2012 01:45:49 -0700 (PDT) Received: by 10.14.211.3 with SMTP id v3mr12297400eeo.43.1345538749391; Tue, 21 Aug 2012 01:45:49 -0700 (PDT) Received: from eu1sys200aog119.obsmtp.com (eu1sys200aog119.obsmtp.com. [207.126.144.147]) by mx.google.com with SMTP id e9si446698eep.70.2012.08.21.01.45.43 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 21 Aug 2012 01:45:49 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.147 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.147; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.147 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-us.st.com ([167.4.1.35]) (using TLSv1) by eu1sys200aob119.postini.com ([207.126.147.11]) with SMTP ID DSNKUDNKtotfFziIruUGnBpf+Ql/Kg2BqTNM@postini.com; Tue, 21 Aug 2012 08:45:49 UTC Received: from zeta.dmz-us.st.com (ns4.st.com [167.4.16.71]) by beta.dmz-us.st.com (STMicroelectronics) with ESMTP id EA73D47; Tue, 21 Aug 2012 08:44:51 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-us.st.com (STMicroelectronics) with ESMTP id CC6E74E; Tue, 21 Aug 2012 05:02:58 +0000 (GMT) Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id BDDCF24C2F0; Tue, 21 Aug 2012 10:45:11 +0200 (CEST) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.3.83.0; Tue, 21 Aug 2012 10:45:15 +0200 From: Linus Walleij To: Ben Dooks , Wolfram Sang , Cc: Linus Walleij , Mark Brown Subject: [PATCH] i2c/nomadik: stop fetching the regulator Date: Tue, 21 Aug 2012 10:45:09 +0200 Message-ID: <1345538709-25201-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: ALoCoQlDiI5E5pZelglZB2knE1nIO2GXzAJTzjmBGmjg33k71HpzYyoQKvgcx7tLYgMA/voKVwm7 From: Linus Walleij The regulator fetched by the Nomadik I2C driver is actually a voltage domain regulator. Stop doing this in the driver and let the power domain code handle any regulators, as discussed on the list. Cc: Mark Brown Signed-off-by: Linus Walleij --- drivers/i2c/busses/i2c-nomadik.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c index 61b00ed..1b898b6 100644 --- a/drivers/i2c/busses/i2c-nomadik.c +++ b/drivers/i2c/busses/i2c-nomadik.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #include @@ -146,7 +145,6 @@ struct i2c_nmk_client { * @stop: stop condition. * @xfer_complete: acknowledge completion for a I2C message. * @result: controller propogated result. - * @regulator: pointer to i2c regulator. * @busy: Busy doing transfer. */ struct nmk_i2c_dev { @@ -160,7 +158,6 @@ struct nmk_i2c_dev { int stop; struct completion xfer_complete; int result; - struct regulator *regulator; bool busy; }; @@ -643,8 +640,6 @@ static int nmk_i2c_xfer(struct i2c_adapter *i2c_adap, dev->busy = true; - if (dev->regulator) - regulator_enable(dev->regulator); pm_runtime_get_sync(&dev->adev->dev); clk_enable(dev->clk); @@ -676,8 +671,6 @@ static int nmk_i2c_xfer(struct i2c_adapter *i2c_adap, out: clk_disable(dev->clk); pm_runtime_put_sync(&dev->adev->dev); - if (dev->regulator) - regulator_disable(dev->regulator); dev->busy = false; @@ -957,12 +950,6 @@ static int nmk_i2c_probe(struct amba_device *adev, const struct amba_id *id) goto err_irq; } - dev->regulator = regulator_get(&adev->dev, "v-i2c"); - if (IS_ERR(dev->regulator)) { - dev_warn(&adev->dev, "could not get i2c regulator\n"); - dev->regulator = NULL; - } - pm_suspend_ignore_children(&adev->dev, true); dev->clk = clk_get(&adev->dev, NULL); @@ -1009,8 +996,6 @@ static int nmk_i2c_probe(struct amba_device *adev, const struct amba_id *id) err_add_adap: clk_put(dev->clk); err_no_clk: - if (dev->regulator) - regulator_put(dev->regulator); free_irq(dev->irq, dev); err_irq: iounmap(dev->virtbase); @@ -1038,8 +1023,6 @@ static int nmk_i2c_remove(struct amba_device *adev) if (res) release_mem_region(res->start, resource_size(res)); clk_put(dev->clk); - if (dev->regulator) - regulator_put(dev->regulator); pm_runtime_disable(&adev->dev); amba_set_drvdata(adev, NULL); kfree(dev);