Skip to content

Commit e89cec7

Browse files
Linus WalleijWolfram Sang
authored andcommitted
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>
1 parent 5c3d8a4 commit e89cec7

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

drivers/i2c/busses/i2c-nomadik.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include <linux/err.h>
2323
#include <linux/clk.h>
2424
#include <linux/io.h>
25-
#include <linux/regulator/consumer.h>
2625
#include <linux/pm_runtime.h>
2726
#include <linux/platform_data/i2c-nomadik.h>
2827

@@ -146,7 +145,6 @@ struct i2c_nmk_client {
146145
* @stop: stop condition.
147146
* @xfer_complete: acknowledge completion for a I2C message.
148147
* @result: controller propogated result.
149-
* @regulator: pointer to i2c regulator.
150148
* @busy: Busy doing transfer.
151149
*/
152150
struct nmk_i2c_dev {
@@ -160,7 +158,6 @@ struct nmk_i2c_dev {
160158
int stop;
161159
struct completion xfer_complete;
162160
int result;
163-
struct regulator *regulator;
164161
bool busy;
165162
};
166163

@@ -643,8 +640,6 @@ static int nmk_i2c_xfer(struct i2c_adapter *i2c_adap,
643640

644641
dev->busy = true;
645642

646-
if (dev->regulator)
647-
regulator_enable(dev->regulator);
648643
pm_runtime_get_sync(&dev->adev->dev);
649644

650645
clk_enable(dev->clk);
@@ -676,8 +671,6 @@ static int nmk_i2c_xfer(struct i2c_adapter *i2c_adap,
676671
out:
677672
clk_disable(dev->clk);
678673
pm_runtime_put_sync(&dev->adev->dev);
679-
if (dev->regulator)
680-
regulator_disable(dev->regulator);
681674

682675
dev->busy = false;
683676

@@ -957,12 +950,6 @@ static int nmk_i2c_probe(struct amba_device *adev, const struct amba_id *id)
957950
goto err_irq;
958951
}
959952

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-
966953
pm_suspend_ignore_children(&adev->dev, true);
967954

968955
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)
1009996
err_add_adap:
1010997
clk_put(dev->clk);
1011998
err_no_clk:
1012-
if (dev->regulator)
1013-
regulator_put(dev->regulator);
1014999
free_irq(dev->irq, dev);
10151000
err_irq:
10161001
iounmap(dev->virtbase);
@@ -1038,8 +1023,6 @@ static int nmk_i2c_remove(struct amba_device *adev)
10381023
if (res)
10391024
release_mem_region(res->start, resource_size(res));
10401025
clk_put(dev->clk);
1041-
if (dev->regulator)
1042-
regulator_put(dev->regulator);
10431026
pm_runtime_disable(&adev->dev);
10441027
amba_set_drvdata(adev, NULL);
10451028
kfree(dev);

0 commit comments

Comments
 (0)