aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2012-08-21 04:45:09 -0400
committerWolfram Sang <w.sang@pengutronix.de>2012-09-12 06:38:10 -0400
commite89cec7ff86febe51eff001c0bf2c81ce601cfe4 (patch)
tree00e327b4a292c67c3d09f04e6b64328c9e768793 /drivers/i2c
parent5c3d8a46ac9778d117ca26f4fec18d7b8c8831ed (diff)
i2c: nomadik: stop fetching the regulator
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 <broonie@opensource.wolfsonmicro.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-nomadik.c17
1 files changed, 0 insertions, 17 deletions
diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c
index 61b00edacb0..1b898b647ec 100644
--- a/drivers/i2c/busses/i2c-nomadik.c
+++ b/drivers/i2c/busses/i2c-nomadik.c
@@ -22,7 +22,6 @@
22#include <linux/err.h> 22#include <linux/err.h>
23#include <linux/clk.h> 23#include <linux/clk.h>
24#include <linux/io.h> 24#include <linux/io.h>
25#include <linux/regulator/consumer.h>
26#include <linux/pm_runtime.h> 25#include <linux/pm_runtime.h>
27#include <linux/platform_data/i2c-nomadik.h> 26#include <linux/platform_data/i2c-nomadik.h>
28 27
@@ -146,7 +145,6 @@ struct i2c_nmk_client {
146 * @stop: stop condition. 145 * @stop: stop condition.
147 * @xfer_complete: acknowledge completion for a I2C message. 146 * @xfer_complete: acknowledge completion for a I2C message.
148 * @result: controller propogated result. 147 * @result: controller propogated result.
149 * @regulator: pointer to i2c regulator.
150 * @busy: Busy doing transfer. 148 * @busy: Busy doing transfer.
151 */ 149 */
152struct nmk_i2c_dev { 150struct nmk_i2c_dev {
@@ -160,7 +158,6 @@ struct nmk_i2c_dev {
160 int stop; 158 int stop;
161 struct completion xfer_complete; 159 struct completion xfer_complete;
162 int result; 160 int result;
163 struct regulator *regulator;
164 bool busy; 161 bool busy;
165}; 162};
166 163
@@ -643,8 +640,6 @@ static int nmk_i2c_xfer(struct i2c_adapter *i2c_adap,
643 640
644 dev->busy = true; 641 dev->busy = true;
645 642
646 if (dev->regulator)
647 regulator_enable(dev->regulator);
648 pm_runtime_get_sync(&dev->adev->dev); 643 pm_runtime_get_sync(&dev->adev->dev);
649 644
650 clk_enable(dev->clk); 645 clk_enable(dev->clk);
@@ -676,8 +671,6 @@ static int nmk_i2c_xfer(struct i2c_adapter *i2c_adap,
676out: 671out:
677 clk_disable(dev->clk); 672 clk_disable(dev->clk);
678 pm_runtime_put_sync(&dev->adev->dev); 673 pm_runtime_put_sync(&dev->adev->dev);
679 if (dev->regulator)
680 regulator_disable(dev->regulator);
681 674
682 dev->busy = false; 675 dev->busy = false;
683 676
@@ -957,12 +950,6 @@ static int nmk_i2c_probe(struct amba_device *adev, const struct amba_id *id)
957 goto err_irq; 950 goto err_irq;
958 } 951 }
959 952
960 dev->regulator = regulator_get(&adev->dev, "v-i2c");
961 if (IS_ERR(dev->regulator)) {
962 dev_warn(&adev->dev, "could not get i2c regulator\n");
963 dev->regulator = NULL;
964 }
965
966 pm_suspend_ignore_children(&adev->dev, true); 953 pm_suspend_ignore_children(&adev->dev, true);
967 954
968 dev->clk = clk_get(&adev->dev, NULL); 955 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)
1009 err_add_adap: 996 err_add_adap:
1010 clk_put(dev->clk); 997 clk_put(dev->clk);
1011 err_no_clk: 998 err_no_clk:
1012 if (dev->regulator)
1013 regulator_put(dev->regulator);
1014 free_irq(dev->irq, dev); 999 free_irq(dev->irq, dev);
1015 err_irq: 1000 err_irq:
1016 iounmap(dev->virtbase); 1001 iounmap(dev->virtbase);
@@ -1038,8 +1023,6 @@ static int nmk_i2c_remove(struct amba_device *adev)
1038 if (res) 1023 if (res)
1039 release_mem_region(res->start, resource_size(res)); 1024 release_mem_region(res->start, resource_size(res));
1040 clk_put(dev->clk); 1025 clk_put(dev->clk);
1041 if (dev->regulator)
1042 regulator_put(dev->regulator);
1043 pm_runtime_disable(&adev->dev); 1026 pm_runtime_disable(&adev->dev);
1044 amba_set_drvdata(adev, NULL); 1027 amba_set_drvdata(adev, NULL);
1045 kfree(dev); 1028 kfree(dev);