diff options
author | Frank Schaefer <fschaefer.oss@googlemail.com> | 2017-04-15 06:05:00 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-04-17 16:30:54 -0400 |
commit | 2437aeb497ef43bff7f887aba4c45dd0ced61a4c (patch) | |
tree | a73c2b03ea2a57783eb84a8c2e990943b9d279ae | |
parent | 4d58443696a8e2a4bcae3fc6d32b0bee71ad9fa1 (diff) |
[media] em28xx: get rid of the dummy clock source
The v4l2 dummy clock has been added with commit fc5d0f8a8878
("V4L2: em28xx: register a V4L2 clock source") to be able to use the ov2640
soc_camera driver.
Since commit 46796cfcd346 ("ov2640: use standard clk and enable it") it is
no longer required.
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-camera.c | 30 | ||||
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-video.c | 6 | ||||
-rw-r--r-- | drivers/media/usb/em28xx/em28xx.h | 1 |
3 files changed, 6 insertions, 31 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-camera.c b/drivers/media/usb/em28xx/em28xx-camera.c index f401e5aa1373..ee0fe1f13070 100644 --- a/drivers/media/usb/em28xx/em28xx-camera.c +++ b/drivers/media/usb/em28xx/em28xx-camera.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #include <linux/i2c.h> | 24 | #include <linux/i2c.h> |
25 | #include <linux/usb.h> | 25 | #include <linux/usb.h> |
26 | #include <media/i2c/mt9v011.h> | 26 | #include <media/i2c/mt9v011.h> |
27 | #include <media/v4l2-clk.h> | ||
28 | #include <media/v4l2-common.h> | 27 | #include <media/v4l2-common.h> |
29 | 28 | ||
30 | /* Possible i2c addresses of Micron sensors */ | 29 | /* Possible i2c addresses of Micron sensors */ |
@@ -311,17 +310,9 @@ int em28xx_detect_sensor(struct em28xx *dev) | |||
311 | 310 | ||
312 | int em28xx_init_camera(struct em28xx *dev) | 311 | int em28xx_init_camera(struct em28xx *dev) |
313 | { | 312 | { |
314 | char clk_name[V4L2_CLK_NAME_SIZE]; | ||
315 | struct i2c_client *client = &dev->i2c_client[dev->def_i2c_bus]; | 313 | struct i2c_client *client = &dev->i2c_client[dev->def_i2c_bus]; |
316 | struct i2c_adapter *adap = &dev->i2c_adap[dev->def_i2c_bus]; | 314 | struct i2c_adapter *adap = &dev->i2c_adap[dev->def_i2c_bus]; |
317 | struct em28xx_v4l2 *v4l2 = dev->v4l2; | 315 | struct em28xx_v4l2 *v4l2 = dev->v4l2; |
318 | int ret = 0; | ||
319 | |||
320 | v4l2_clk_name_i2c(clk_name, sizeof(clk_name), | ||
321 | i2c_adapter_id(adap), client->addr); | ||
322 | v4l2->clk = v4l2_clk_register_fixed(clk_name, -EINVAL); | ||
323 | if (IS_ERR(v4l2->clk)) | ||
324 | return PTR_ERR(v4l2->clk); | ||
325 | 316 | ||
326 | switch (dev->em28xx_sensor) { | 317 | switch (dev->em28xx_sensor) { |
327 | case EM28XX_MT9V011: | 318 | case EM28XX_MT9V011: |
@@ -351,10 +342,8 @@ int em28xx_init_camera(struct em28xx *dev) | |||
351 | pdata.xtal = v4l2->sensor_xtal; | 342 | pdata.xtal = v4l2->sensor_xtal; |
352 | if (NULL == | 343 | if (NULL == |
353 | v4l2_i2c_new_subdev_board(&v4l2->v4l2_dev, adap, | 344 | v4l2_i2c_new_subdev_board(&v4l2->v4l2_dev, adap, |
354 | &mt9v011_info, NULL)) { | 345 | &mt9v011_info, NULL)) |
355 | ret = -ENODEV; | 346 | return -ENODEV; |
356 | break; | ||
357 | } | ||
358 | /* probably means GRGB 16 bit bayer */ | 347 | /* probably means GRGB 16 bit bayer */ |
359 | v4l2->vinmode = 0x0d; | 348 | v4l2->vinmode = 0x0d; |
360 | v4l2->vinctl = 0x00; | 349 | v4l2->vinctl = 0x00; |
@@ -410,10 +399,8 @@ int em28xx_init_camera(struct em28xx *dev) | |||
410 | subdev = | 399 | subdev = |
411 | v4l2_i2c_new_subdev_board(&v4l2->v4l2_dev, adap, | 400 | v4l2_i2c_new_subdev_board(&v4l2->v4l2_dev, adap, |
412 | &ov2640_info, NULL); | 401 | &ov2640_info, NULL); |
413 | if (NULL == subdev) { | 402 | if (subdev == NULL) |
414 | ret = -ENODEV; | 403 | return -ENODEV; |
415 | break; | ||
416 | } | ||
417 | 404 | ||
418 | format.format.code = MEDIA_BUS_FMT_YUYV8_2X8; | 405 | format.format.code = MEDIA_BUS_FMT_YUYV8_2X8; |
419 | format.format.width = 640; | 406 | format.format.width = 640; |
@@ -430,14 +417,9 @@ int em28xx_init_camera(struct em28xx *dev) | |||
430 | } | 417 | } |
431 | case EM28XX_NOSENSOR: | 418 | case EM28XX_NOSENSOR: |
432 | default: | 419 | default: |
433 | ret = -EINVAL; | 420 | return -EINVAL; |
434 | } | ||
435 | |||
436 | if (ret < 0) { | ||
437 | v4l2_clk_unregister_fixed(v4l2->clk); | ||
438 | v4l2->clk = NULL; | ||
439 | } | 421 | } |
440 | 422 | ||
441 | return ret; | 423 | return 0; |
442 | } | 424 | } |
443 | EXPORT_SYMBOL_GPL(em28xx_init_camera); | 425 | EXPORT_SYMBOL_GPL(em28xx_init_camera); |
diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c index 8d93100334ea..3cbc3d4270a3 100644 --- a/drivers/media/usb/em28xx/em28xx-video.c +++ b/drivers/media/usb/em28xx/em28xx-video.c | |||
@@ -43,7 +43,6 @@ | |||
43 | #include <media/v4l2-common.h> | 43 | #include <media/v4l2-common.h> |
44 | #include <media/v4l2-ioctl.h> | 44 | #include <media/v4l2-ioctl.h> |
45 | #include <media/v4l2-event.h> | 45 | #include <media/v4l2-event.h> |
46 | #include <media/v4l2-clk.h> | ||
47 | #include <media/drv-intf/msp3400.h> | 46 | #include <media/drv-intf/msp3400.h> |
48 | #include <media/tuner.h> | 47 | #include <media/tuner.h> |
49 | 48 | ||
@@ -2140,11 +2139,6 @@ static int em28xx_v4l2_fini(struct em28xx *dev) | |||
2140 | v4l2_ctrl_handler_free(&v4l2->ctrl_handler); | 2139 | v4l2_ctrl_handler_free(&v4l2->ctrl_handler); |
2141 | v4l2_device_unregister(&v4l2->v4l2_dev); | 2140 | v4l2_device_unregister(&v4l2->v4l2_dev); |
2142 | 2141 | ||
2143 | if (v4l2->clk) { | ||
2144 | v4l2_clk_unregister_fixed(v4l2->clk); | ||
2145 | v4l2->clk = NULL; | ||
2146 | } | ||
2147 | |||
2148 | kref_put(&v4l2->ref, em28xx_free_v4l2); | 2142 | kref_put(&v4l2->ref, em28xx_free_v4l2); |
2149 | 2143 | ||
2150 | mutex_unlock(&dev->lock); | 2144 | mutex_unlock(&dev->lock); |
diff --git a/drivers/media/usb/em28xx/em28xx.h b/drivers/media/usb/em28xx/em28xx.h index e9f379959fa5..e8d97d5ec161 100644 --- a/drivers/media/usb/em28xx/em28xx.h +++ b/drivers/media/usb/em28xx/em28xx.h | |||
@@ -510,7 +510,6 @@ struct em28xx_v4l2 { | |||
510 | 510 | ||
511 | struct v4l2_device v4l2_dev; | 511 | struct v4l2_device v4l2_dev; |
512 | struct v4l2_ctrl_handler ctrl_handler; | 512 | struct v4l2_ctrl_handler ctrl_handler; |
513 | struct v4l2_clk *clk; | ||
514 | 513 | ||
515 | struct video_device vdev; | 514 | struct video_device vdev; |
516 | struct video_device vbi_dev; | 515 | struct video_device vbi_dev; |