diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/i2c/ths7303.c | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/drivers/media/i2c/ths7303.c b/drivers/media/i2c/ths7303.c index 8cddcd0cfa09..af06187c74f8 100644 --- a/drivers/media/i2c/ths7303.c +++ b/drivers/media/i2c/ths7303.c | |||
@@ -349,30 +349,6 @@ static const struct v4l2_subdev_ops ths7303_ops = { | |||
349 | .video = &ths7303_video_ops, | 349 | .video = &ths7303_video_ops, |
350 | }; | 350 | }; |
351 | 351 | ||
352 | static int ths7303_setup(struct v4l2_subdev *sd) | ||
353 | { | ||
354 | struct ths7303_state *state = to_state(sd); | ||
355 | struct ths7303_platform_data *pdata = &state->pdata; | ||
356 | int ret; | ||
357 | u8 mask; | ||
358 | |||
359 | mask = 0xf8; | ||
360 | |||
361 | ret = ths7303_write(sd, THS7303_CHANNEL_1, pdata->ch_1 & mask); | ||
362 | if (ret) | ||
363 | return ret; | ||
364 | |||
365 | ret = ths7303_write(sd, THS7303_CHANNEL_2, pdata->ch_2 & mask); | ||
366 | if (ret) | ||
367 | return ret; | ||
368 | |||
369 | ret = ths7303_write(sd, THS7303_CHANNEL_3, pdata->ch_3 & mask); | ||
370 | if (ret) | ||
371 | return ret; | ||
372 | |||
373 | return 0; | ||
374 | } | ||
375 | |||
376 | static int ths7303_probe(struct i2c_client *client, | 352 | static int ths7303_probe(struct i2c_client *client, |
377 | const struct i2c_device_id *id) | 353 | const struct i2c_device_id *id) |
378 | { | 354 | { |
@@ -402,9 +378,10 @@ static int ths7303_probe(struct i2c_client *client, | |||
402 | /* store the driver data to differntiate the chip */ | 378 | /* store the driver data to differntiate the chip */ |
403 | state->driver_data = (int)id->driver_data; | 379 | state->driver_data = (int)id->driver_data; |
404 | 380 | ||
405 | if (ths7303_setup(sd) < 0) { | 381 | /* set to default 480I_576I filter mode */ |
406 | v4l_err(client, "init failed\n"); | 382 | if (ths7303_setval(sd, THS7303_FILTER_MODE_480I_576I) < 0) { |
407 | return -EIO; | 383 | v4l_err(client, "Setting to 480I_576I filter mode failed!\n"); |
384 | return -EINVAL; | ||
408 | } | 385 | } |
409 | 386 | ||
410 | return 0; | 387 | return 0; |