aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c/soc_camera/mt9v022.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2012-07-18 09:54:04 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-08-15 16:04:42 -0400
commit4bbc6d52e61a8a9c19fcc859c4acab89cb8cd4e5 (patch)
tree64ce43072ed8fa87bd8f5bc4d8fe5794a0373aef /drivers/media/i2c/soc_camera/mt9v022.c
parent4ec10bacd6bf08de39ebdba9e75060452cc313e0 (diff)
[media] soc-camera: Push probe-time power management to drivers
Several client drivers access the hardware at probe time, for instance to read the probe chip ID. Such chips need to be powered up when being probed. soc-camera handles this by powering chips up in the soc-camera probe implementation. However, this will break with non soc-camera hosts that don't perform the same operations. Fix the problem by pushing the power up/down from the soc-camera core down to individual drivers on a needs basis. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/i2c/soc_camera/mt9v022.c')
-rw-r--r--drivers/media/i2c/soc_camera/mt9v022.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/media/i2c/soc_camera/mt9v022.c b/drivers/media/i2c/soc_camera/mt9v022.c
index 5f09cb702bf7..2edea8489092 100644
--- a/drivers/media/i2c/soc_camera/mt9v022.c
+++ b/drivers/media/i2c/soc_camera/mt9v022.c
@@ -578,6 +578,10 @@ static int mt9v022_video_probe(struct i2c_client *client)
578 int ret; 578 int ret;
579 unsigned long flags; 579 unsigned long flags;
580 580
581 ret = mt9v022_s_power(&mt9v022->subdev, 1);
582 if (ret < 0)
583 return ret;
584
581 /* Read out the chip version register */ 585 /* Read out the chip version register */
582 data = reg_read(client, MT9V022_CHIP_VERSION); 586 data = reg_read(client, MT9V022_CHIP_VERSION);
583 587
@@ -648,6 +652,7 @@ static int mt9v022_video_probe(struct i2c_client *client)
648 dev_err(&client->dev, "Failed to initialise the camera\n"); 652 dev_err(&client->dev, "Failed to initialise the camera\n");
649 653
650ei2c: 654ei2c:
655 mt9v022_s_power(&mt9v022->subdev, 0);
651 return ret; 656 return ret;
652} 657}
653 658