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/mt9v022.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/mt9v022.c')
-rw-r--r-- | drivers/media/video/mt9v022.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/media/video/mt9v022.c b/drivers/media/video/mt9v022.c index 0f4b204667e0..2584201059d8 100644 --- a/drivers/media/video/mt9v022.c +++ b/drivers/media/video/mt9v022.c | |||
@@ -134,8 +134,25 @@ static int reg_clear(struct soc_camera_device *icd, const u8 reg, | |||
134 | static int mt9v022_init(struct soc_camera_device *icd) | 134 | static int mt9v022_init(struct soc_camera_device *icd) |
135 | { | 135 | { |
136 | struct mt9v022 *mt9v022 = container_of(icd, struct mt9v022, icd); | 136 | struct mt9v022 *mt9v022 = container_of(icd, struct mt9v022, icd); |
137 | struct soc_camera_link *icl = mt9v022->client->dev.platform_data; | ||
137 | int ret; | 138 | int ret; |
138 | 139 | ||
140 | if (icl->power) { | ||
141 | ret = icl->power(&mt9v022->client->dev, 1); | ||
142 | if (ret < 0) { | ||
143 | dev_err(icd->vdev->parent, | ||
144 | "Platform failed to power-on the camera.\n"); | ||
145 | return ret; | ||
146 | } | ||
147 | } | ||
148 | |||
149 | /* | ||
150 | * The camera could have been already on, we hard-reset it additionally, | ||
151 | * if available. Soft reset is done in video_probe(). | ||
152 | */ | ||
153 | if (icl->reset) | ||
154 | icl->reset(&mt9v022->client->dev); | ||
155 | |||
139 | /* Almost the default mode: master, parallel, simultaneous, and an | 156 | /* Almost the default mode: master, parallel, simultaneous, and an |
140 | * undocumented bit 0x200, which is present in table 7, but not in 8, | 157 | * undocumented bit 0x200, which is present in table 7, but not in 8, |
141 | * plus snapshot mode to disable scan for now */ | 158 | * plus snapshot mode to disable scan for now */ |
@@ -161,7 +178,12 @@ static int mt9v022_init(struct soc_camera_device *icd) | |||
161 | 178 | ||
162 | static int mt9v022_release(struct soc_camera_device *icd) | 179 | static int mt9v022_release(struct soc_camera_device *icd) |
163 | { | 180 | { |
164 | /* Nothing? */ | 181 | struct mt9v022 *mt9v022 = container_of(icd, struct mt9v022, icd); |
182 | struct soc_camera_link *icl = mt9v022->client->dev.platform_data; | ||
183 | |||
184 | if (icl->power) | ||
185 | icl->power(&mt9v022->client->dev, 0); | ||
186 | |||
165 | return 0; | 187 | return 0; |
166 | } | 188 | } |
167 | 189 | ||