aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/video/mt9v022.c74
1 files changed, 0 insertions, 74 deletions
diff --git a/drivers/media/video/mt9v022.c b/drivers/media/video/mt9v022.c
index ddc11d0a625..53149a73874 100644
--- a/drivers/media/video/mt9v022.c
+++ b/drivers/media/video/mt9v022.c
@@ -200,78 +200,6 @@ static int mt9v022_s_stream(struct v4l2_subdev *sd, int enable)
200 return 0; 200 return 0;
201} 201}
202 202
203static int mt9v022_set_bus_param(struct soc_camera_device *icd,
204 unsigned long flags)
205{
206 struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd));
207 struct mt9v022 *mt9v022 = to_mt9v022(client);
208 struct soc_camera_link *icl = to_soc_camera_link(icd);
209 unsigned int width_flag = flags & SOCAM_DATAWIDTH_MASK;
210 int ret;
211 u16 pixclk = 0;
212
213 /* Only one width bit may be set */
214 if (!is_power_of_2(width_flag))
215 return -EINVAL;
216
217 if (icl->set_bus_param) {
218 ret = icl->set_bus_param(icl, width_flag);
219 if (ret)
220 return ret;
221 } else {
222 /*
223 * Without board specific bus width settings we only support the
224 * sensors native bus width
225 */
226 if (width_flag != SOCAM_DATAWIDTH_10)
227 return -EINVAL;
228 }
229
230 flags = soc_camera_apply_sensor_flags(icl, flags);
231
232 if (flags & SOCAM_PCLK_SAMPLE_FALLING)
233 pixclk |= 0x10;
234
235 if (!(flags & SOCAM_HSYNC_ACTIVE_HIGH))
236 pixclk |= 0x1;
237
238 if (!(flags & SOCAM_VSYNC_ACTIVE_HIGH))
239 pixclk |= 0x2;
240
241 ret = reg_write(client, MT9V022_PIXCLK_FV_LV, pixclk);
242 if (ret < 0)
243 return ret;
244
245 if (!(flags & SOCAM_MASTER))
246 mt9v022->chip_control &= ~0x8;
247
248 ret = reg_write(client, MT9V022_CHIP_CONTROL, mt9v022->chip_control);
249 if (ret < 0)
250 return ret;
251
252 dev_dbg(&client->dev, "Calculated pixclk 0x%x, chip control 0x%x\n",
253 pixclk, mt9v022->chip_control);
254
255 return 0;
256}
257
258static unsigned long mt9v022_query_bus_param(struct soc_camera_device *icd)
259{
260 struct soc_camera_link *icl = to_soc_camera_link(icd);
261 unsigned int flags = SOCAM_MASTER | SOCAM_SLAVE |
262 SOCAM_PCLK_SAMPLE_RISING | SOCAM_PCLK_SAMPLE_FALLING |
263 SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_HSYNC_ACTIVE_LOW |
264 SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_LOW |
265 SOCAM_DATA_ACTIVE_HIGH;
266
267 if (icl->query_bus_param)
268 flags |= icl->query_bus_param(icl) & SOCAM_DATAWIDTH_MASK;
269 else
270 flags |= SOCAM_DATAWIDTH_10;
271
272 return soc_camera_apply_sensor_flags(icl, flags);
273}
274
275static int mt9v022_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a) 203static int mt9v022_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a)
276{ 204{
277 struct i2c_client *client = v4l2_get_subdevdata(sd); 205 struct i2c_client *client = v4l2_get_subdevdata(sd);
@@ -558,8 +486,6 @@ static const struct v4l2_queryctrl mt9v022_controls[] = {
558}; 486};
559 487
560static struct soc_camera_ops mt9v022_ops = { 488static struct soc_camera_ops mt9v022_ops = {
561 .set_bus_param = mt9v022_set_bus_param,
562 .query_bus_param = mt9v022_query_bus_param,
563 .controls = mt9v022_controls, 489 .controls = mt9v022_controls,
564 .num_controls = ARRAY_SIZE(mt9v022_controls), 490 .num_controls = ARRAY_SIZE(mt9v022_controls),
565}; 491};