Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 142407
b: refs/heads/master
c: f982651
h: refs/heads/master
i:
  142405: 2b9f1fa
  142403: c2bc290
  142399: 39b1fa6
v: v3
  • Loading branch information
Guennadi Liakhovetski authored and Mauro Carvalho Chehab committed Apr 7, 2009
1 parent 09b20e0 commit 4528e48
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6252d25776f7e74f22acad7acb0165338927fe1e
refs/heads/master: f982651410f00378e42d9daab274adee5c762523
21 changes: 21 additions & 0 deletions trunk/drivers/media/video/mt9t031.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,22 +141,43 @@ static int get_shutter(struct soc_camera_device *icd, u32 *data)

static int mt9t031_init(struct soc_camera_device *icd)
{
struct mt9t031 *mt9t031 = container_of(icd, struct mt9t031, icd);
struct soc_camera_link *icl = mt9t031->client->dev.platform_data;
int ret;

if (icl->power) {
ret = icl->power(&mt9t031->client->dev, 1);
if (ret < 0) {
dev_err(icd->vdev->parent,
"Platform failed to power-on the camera.\n");
return ret;
}
}

/* Disable chip output, synchronous option update */
ret = reg_write(icd, MT9T031_RESET, 1);
if (ret >= 0)
ret = reg_write(icd, MT9T031_RESET, 0);
if (ret >= 0)
ret = reg_clear(icd, MT9T031_OUTPUT_CONTROL, 2);

if (ret < 0 && icl->power)
icl->power(&mt9t031->client->dev, 0);

return ret >= 0 ? 0 : -EIO;
}

static int mt9t031_release(struct soc_camera_device *icd)
{
struct mt9t031 *mt9t031 = container_of(icd, struct mt9t031, icd);
struct soc_camera_link *icl = mt9t031->client->dev.platform_data;

/* Disable the chip */
reg_clear(icd, MT9T031_OUTPUT_CONTROL, 2);

if (icl->power)
icl->power(&mt9t031->client->dev, 0);

return 0;
}

Expand Down

0 comments on commit 4528e48

Please sign in to comment.