diff options
author | Stefan Herbrechtsmeier <hbmeier@hni.uni-paderborn.de> | 2008-08-14 11:04:11 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-12 07:36:50 -0400 |
commit | 81034663159f39d005316b5c139038459cd16721 (patch) | |
tree | 8a86bc69b553bb2cb7656465b7449565427b197d /drivers/media/video/mt9m111.c | |
parent | 506c629a8eb95a3232a0aafa3b80903224ccc461 (diff) |
V4L/DVB (8687): soc-camera: Move .power and .reset from soc_camera host to sensor driver
Make .power and .reset callbacks per camera instead of per host, also move
their invocation to camera drivers.
.arch/arm/mach-pxa/include/mach/camera.h | 2 -
Signed-off-by: Stefan Herbrechtsmeier <hbmeier@hni.uni-paderborn.de>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/mt9m111.c')
-rw-r--r-- | drivers/media/video/mt9m111.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/media/video/mt9m111.c b/drivers/media/video/mt9m111.c index d99932631050..4844486d72fb 100644 --- a/drivers/media/video/mt9m111.c +++ b/drivers/media/video/mt9m111.c | |||
@@ -351,8 +351,18 @@ static int mt9m111_setfmt_yuv(struct soc_camera_device *icd) | |||
351 | static int mt9m111_enable(struct soc_camera_device *icd) | 351 | static int mt9m111_enable(struct soc_camera_device *icd) |
352 | { | 352 | { |
353 | struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd); | 353 | struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd); |
354 | struct soc_camera_link *icl = mt9m111->client->dev.platform_data; | ||
354 | int ret; | 355 | int ret; |
355 | 356 | ||
357 | if (icl->power) { | ||
358 | ret = icl->power(&mt9m111->client->dev, 1); | ||
359 | if (ret < 0) { | ||
360 | dev_err(icd->vdev->parent, | ||
361 | "Platform failed to power-on the camera.\n"); | ||
362 | return ret; | ||
363 | } | ||
364 | } | ||
365 | |||
356 | ret = reg_set(RESET, MT9M111_RESET_CHIP_ENABLE); | 366 | ret = reg_set(RESET, MT9M111_RESET_CHIP_ENABLE); |
357 | if (!ret) | 367 | if (!ret) |
358 | mt9m111->powered = 1; | 368 | mt9m111->powered = 1; |
@@ -362,11 +372,16 @@ static int mt9m111_enable(struct soc_camera_device *icd) | |||
362 | static int mt9m111_disable(struct soc_camera_device *icd) | 372 | static int mt9m111_disable(struct soc_camera_device *icd) |
363 | { | 373 | { |
364 | struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd); | 374 | struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd); |
375 | struct soc_camera_link *icl = mt9m111->client->dev.platform_data; | ||
365 | int ret; | 376 | int ret; |
366 | 377 | ||
367 | ret = reg_clear(RESET, MT9M111_RESET_CHIP_ENABLE); | 378 | ret = reg_clear(RESET, MT9M111_RESET_CHIP_ENABLE); |
368 | if (!ret) | 379 | if (!ret) |
369 | mt9m111->powered = 0; | 380 | mt9m111->powered = 0; |
381 | |||
382 | if (icl->power) | ||
383 | icl->power(&mt9m111->client->dev, 0); | ||
384 | |||
370 | return ret; | 385 | return ret; |
371 | } | 386 | } |
372 | 387 | ||