aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/i2c/mt9p031.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c
index 1abc86ed2255..4734836fe5a4 100644
--- a/drivers/media/i2c/mt9p031.c
+++ b/drivers/media/i2c/mt9p031.c
@@ -125,9 +125,7 @@ struct mt9p031 {
125 int power_count; 125 int power_count;
126 126
127 struct clk *clk; 127 struct clk *clk;
128 struct regulator *vaa; 128 struct regulator_bulk_data regulators[3];
129 struct regulator *vdd;
130 struct regulator *vdd_io;
131 129
132 enum mt9p031_model model; 130 enum mt9p031_model model;
133 struct aptina_pll pll; 131 struct aptina_pll pll;
@@ -272,6 +270,8 @@ static inline int mt9p031_pll_disable(struct mt9p031 *mt9p031)
272 270
273static int mt9p031_power_on(struct mt9p031 *mt9p031) 271static int mt9p031_power_on(struct mt9p031 *mt9p031)
274{ 272{
273 int ret;
274
275 /* Ensure RESET_BAR is low */ 275 /* Ensure RESET_BAR is low */
276 if (gpio_is_valid(mt9p031->reset)) { 276 if (gpio_is_valid(mt9p031->reset)) {
277 gpio_set_value(mt9p031->reset, 0); 277 gpio_set_value(mt9p031->reset, 0);
@@ -279,9 +279,10 @@ static int mt9p031_power_on(struct mt9p031 *mt9p031)
279 } 279 }
280 280
281 /* Bring up the supplies */ 281 /* Bring up the supplies */
282 regulator_enable(mt9p031->vdd); 282 ret = regulator_bulk_enable(ARRAY_SIZE(mt9p031->regulators),
283 regulator_enable(mt9p031->vdd_io); 283 mt9p031->regulators);
284 regulator_enable(mt9p031->vaa); 284 if (ret < 0)
285 return ret;
285 286
286 /* Emable clock */ 287 /* Emable clock */
287 if (mt9p031->clk) 288 if (mt9p031->clk)
@@ -303,9 +304,8 @@ static void mt9p031_power_off(struct mt9p031 *mt9p031)
303 usleep_range(1000, 2000); 304 usleep_range(1000, 2000);
304 } 305 }
305 306
306 regulator_disable(mt9p031->vaa); 307 regulator_bulk_disable(ARRAY_SIZE(mt9p031->regulators),
307 regulator_disable(mt9p031->vdd_io); 308 mt9p031->regulators);
308 regulator_disable(mt9p031->vdd);
309 309
310 if (mt9p031->clk) 310 if (mt9p031->clk)
311 clk_disable_unprepare(mt9p031->clk); 311 clk_disable_unprepare(mt9p031->clk);
@@ -985,14 +985,14 @@ static int mt9p031_probe(struct i2c_client *client,
985 mt9p031->model = did->driver_data; 985 mt9p031->model = did->driver_data;
986 mt9p031->reset = -1; 986 mt9p031->reset = -1;
987 987
988 mt9p031->vaa = devm_regulator_get(&client->dev, "vaa"); 988 mt9p031->regulators[0].supply = "vdd";
989 mt9p031->vdd = devm_regulator_get(&client->dev, "vdd"); 989 mt9p031->regulators[1].supply = "vdd_io";
990 mt9p031->vdd_io = devm_regulator_get(&client->dev, "vdd_io"); 990 mt9p031->regulators[2].supply = "vaa";
991 991
992 if (IS_ERR(mt9p031->vaa) || IS_ERR(mt9p031->vdd) || 992 ret = devm_regulator_bulk_get(&client->dev, 3, mt9p031->regulators);
993 IS_ERR(mt9p031->vdd_io)) { 993 if (ret < 0) {
994 dev_err(&client->dev, "Unable to get regulators\n"); 994 dev_err(&client->dev, "Unable to get regulators\n");
995 return -ENODEV; 995 return ret;
996 } 996 }
997 997
998 v4l2_ctrl_handler_init(&mt9p031->ctrls, ARRAY_SIZE(mt9p031_ctrls) + 6); 998 v4l2_ctrl_handler_init(&mt9p031->ctrls, ARRAY_SIZE(mt9p031_ctrls) + 6);