diff options
author | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-04-21 05:12:35 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-04-21 05:12:35 -0400 |
commit | 676ee36be04985062522804c2de04f0764212be6 (patch) | |
tree | 781df135c5a91a04decad1b7d53b5a925dc11522 /drivers/media/usb/em28xx | |
parent | b18042a673e88c9457a6d1716219c2367ca447b0 (diff) | |
parent | e183201b9e917daf2530b637b2f34f1d5afb934d (diff) |
Merge branch 'patchwork' into v4l_for_linus
* patchwork: (404 commits)
[media] uvcvideo: add support for VIDIOC_QUERY_EXT_CTRL
[media] uvcvideo: fix cropcap v4l2-compliance failure
[media] media: omap3isp: remove unused clkdev
[media] coda: Add tracing support
[media] coda: drop dma_sync_single_for_device in coda_bitstream_queue
[media] coda: fix fill bitstream errors in nonstreaming case
[media] coda: call SEQ_END when the first queue is stopped
[media] coda: fail to start streaming if userspace set invalid formats
[media] coda: remove duplicate error messages for buffer allocations
[media] coda: move parameter buffer in together with context buffer allocation
[media] coda: allocate bitstream buffer from REQBUFS, size depends on the format
[media] coda: allocate per-context buffers from REQBUFS
[media] coda: use strlcpy instead of snprintf
[media] coda: bitstream payload is unsigned
[media] coda: fix double call to debugfs_remove
[media] coda: check kasprintf return value in coda_open
[media] coda: bitrate can only be set in kbps steps
[media] v4l2-mem2mem: no need to initialize b in v4l2_m2m_next_buf and v4l2_m2m_buf_remove
[media] s5p-mfc: set allow_zero_bytesused flag for vb2_queue_init
[media] coda: set allow_zero_bytesused flag for vb2_queue_init
...
Diffstat (limited to 'drivers/media/usb/em28xx')
-rw-r--r-- | drivers/media/usb/em28xx/Kconfig | 2 | ||||
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-camera.c | 2 | ||||
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-cards.c | 13 | ||||
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-dvb.c | 14 | ||||
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-video.c | 119 | ||||
-rw-r--r-- | drivers/media/usb/em28xx/em28xx.h | 7 |
6 files changed, 76 insertions, 81 deletions
diff --git a/drivers/media/usb/em28xx/Kconfig b/drivers/media/usb/em28xx/Kconfig index f5d7198753c7..e382210c4ada 100644 --- a/drivers/media/usb/em28xx/Kconfig +++ b/drivers/media/usb/em28xx/Kconfig | |||
@@ -55,7 +55,7 @@ config VIDEO_EM28XX_DVB | |||
55 | select MEDIA_TUNER_TDA18271 if MEDIA_SUBDRV_AUTOSELECT | 55 | select MEDIA_TUNER_TDA18271 if MEDIA_SUBDRV_AUTOSELECT |
56 | select MEDIA_TUNER_TDA18212 if MEDIA_SUBDRV_AUTOSELECT | 56 | select MEDIA_TUNER_TDA18212 if MEDIA_SUBDRV_AUTOSELECT |
57 | select DVB_M88DS3103 if MEDIA_SUBDRV_AUTOSELECT | 57 | select DVB_M88DS3103 if MEDIA_SUBDRV_AUTOSELECT |
58 | select MEDIA_TUNER_M88TS2022 if MEDIA_SUBDRV_AUTOSELECT | 58 | select DVB_TS2020 if MEDIA_SUBDRV_AUTOSELECT |
59 | select DVB_DRX39XYJ if MEDIA_SUBDRV_AUTOSELECT | 59 | select DVB_DRX39XYJ if MEDIA_SUBDRV_AUTOSELECT |
60 | select DVB_SI2168 if MEDIA_SUBDRV_AUTOSELECT | 60 | select DVB_SI2168 if MEDIA_SUBDRV_AUTOSELECT |
61 | select MEDIA_TUNER_SI2157 if MEDIA_SUBDRV_AUTOSELECT | 61 | select MEDIA_TUNER_SI2157 if MEDIA_SUBDRV_AUTOSELECT |
diff --git a/drivers/media/usb/em28xx/em28xx-camera.c b/drivers/media/usb/em28xx/em28xx-camera.c index 7be661f73930..a4b22c2c3ba7 100644 --- a/drivers/media/usb/em28xx/em28xx-camera.c +++ b/drivers/media/usb/em28xx/em28xx-camera.c | |||
@@ -330,7 +330,7 @@ int em28xx_init_camera(struct em28xx *dev) | |||
330 | 330 | ||
331 | v4l2_clk_name_i2c(clk_name, sizeof(clk_name), | 331 | v4l2_clk_name_i2c(clk_name, sizeof(clk_name), |
332 | i2c_adapter_id(adap), client->addr); | 332 | i2c_adapter_id(adap), client->addr); |
333 | v4l2->clk = v4l2_clk_register_fixed(clk_name, "mclk", -EINVAL); | 333 | v4l2->clk = v4l2_clk_register_fixed(clk_name, -EINVAL); |
334 | if (IS_ERR(v4l2->clk)) | 334 | if (IS_ERR(v4l2->clk)) |
335 | return PTR_ERR(v4l2->clk); | 335 | return PTR_ERR(v4l2->clk); |
336 | 336 | ||
diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c index d9704e66b8c9..394004607059 100644 --- a/drivers/media/usb/em28xx/em28xx-cards.c +++ b/drivers/media/usb/em28xx/em28xx-cards.c | |||
@@ -1157,6 +1157,15 @@ struct em28xx_board em28xx_boards[] = { | |||
1157 | .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | | 1157 | .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | |
1158 | EM28XX_I2C_FREQ_400_KHZ, | 1158 | EM28XX_I2C_FREQ_400_KHZ, |
1159 | }, | 1159 | }, |
1160 | [EM2884_BOARD_ELGATO_EYETV_HYBRID_2008] = { | ||
1161 | .name = "Elgato EyeTV Hybrid 2008 INT", | ||
1162 | .has_dvb = 1, | ||
1163 | .ir_codes = RC_MAP_NEC_TERRATEC_CINERGY_XS, | ||
1164 | .tuner_type = TUNER_ABSENT, | ||
1165 | .def_i2c_bus = 1, | ||
1166 | .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | | ||
1167 | EM28XX_I2C_FREQ_400_KHZ, | ||
1168 | }, | ||
1160 | [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900] = { | 1169 | [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900] = { |
1161 | .name = "Hauppauge WinTV HVR 900", | 1170 | .name = "Hauppauge WinTV HVR 900", |
1162 | .tda9887_conf = TDA9887_PRESENT, | 1171 | .tda9887_conf = TDA9887_PRESENT, |
@@ -2378,8 +2387,10 @@ struct usb_device_id em28xx_id_table[] = { | |||
2378 | .driver_info = EM2860_BOARD_TERRATEC_GRABBY }, | 2387 | .driver_info = EM2860_BOARD_TERRATEC_GRABBY }, |
2379 | { USB_DEVICE(0x0ccd, 0x00b2), | 2388 | { USB_DEVICE(0x0ccd, 0x00b2), |
2380 | .driver_info = EM2884_BOARD_CINERGY_HTC_STICK }, | 2389 | .driver_info = EM2884_BOARD_CINERGY_HTC_STICK }, |
2390 | { USB_DEVICE(0x0fd9, 0x0018), | ||
2391 | .driver_info = EM2884_BOARD_ELGATO_EYETV_HYBRID_2008 }, | ||
2381 | { USB_DEVICE(0x0fd9, 0x0033), | 2392 | { USB_DEVICE(0x0fd9, 0x0033), |
2382 | .driver_info = EM2860_BOARD_ELGATO_VIDEO_CAPTURE}, | 2393 | .driver_info = EM2860_BOARD_ELGATO_VIDEO_CAPTURE }, |
2383 | { USB_DEVICE(0x185b, 0x2870), | 2394 | { USB_DEVICE(0x185b, 0x2870), |
2384 | .driver_info = EM2870_BOARD_COMPRO_VIDEOMATE }, | 2395 | .driver_info = EM2870_BOARD_COMPRO_VIDEOMATE }, |
2385 | { USB_DEVICE(0x185b, 0x2041), | 2396 | { USB_DEVICE(0x185b, 0x2041), |
diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c index aee70d483264..a5b22c5a240c 100644 --- a/drivers/media/usb/em28xx/em28xx-dvb.c +++ b/drivers/media/usb/em28xx/em28xx-dvb.c | |||
@@ -54,7 +54,7 @@ | |||
54 | #include "qt1010.h" | 54 | #include "qt1010.h" |
55 | #include "mb86a20s.h" | 55 | #include "mb86a20s.h" |
56 | #include "m88ds3103.h" | 56 | #include "m88ds3103.h" |
57 | #include "m88ts2022.h" | 57 | #include "ts2020.h" |
58 | #include "si2168.h" | 58 | #include "si2168.h" |
59 | #include "si2157.h" | 59 | #include "si2157.h" |
60 | 60 | ||
@@ -1380,6 +1380,7 @@ static int em28xx_dvb_init(struct em28xx *dev) | |||
1380 | } | 1380 | } |
1381 | } | 1381 | } |
1382 | break; | 1382 | break; |
1383 | case EM2884_BOARD_ELGATO_EYETV_HYBRID_2008: | ||
1383 | case EM2884_BOARD_CINERGY_HTC_STICK: | 1384 | case EM2884_BOARD_CINERGY_HTC_STICK: |
1384 | terratec_htc_stick_init(dev); | 1385 | terratec_htc_stick_init(dev); |
1385 | 1386 | ||
@@ -1491,8 +1492,7 @@ static int em28xx_dvb_init(struct em28xx *dev) | |||
1491 | struct i2c_adapter *i2c_adapter; | 1492 | struct i2c_adapter *i2c_adapter; |
1492 | struct i2c_client *client; | 1493 | struct i2c_client *client; |
1493 | struct i2c_board_info info; | 1494 | struct i2c_board_info info; |
1494 | struct m88ts2022_config m88ts2022_config = { | 1495 | struct ts2020_config ts2020_config = { |
1495 | .clock = 27000000, | ||
1496 | }; | 1496 | }; |
1497 | memset(&info, 0, sizeof(struct i2c_board_info)); | 1497 | memset(&info, 0, sizeof(struct i2c_board_info)); |
1498 | 1498 | ||
@@ -1507,11 +1507,11 @@ static int em28xx_dvb_init(struct em28xx *dev) | |||
1507 | } | 1507 | } |
1508 | 1508 | ||
1509 | /* attach tuner */ | 1509 | /* attach tuner */ |
1510 | m88ts2022_config.fe = dvb->fe[0]; | 1510 | ts2020_config.fe = dvb->fe[0]; |
1511 | strlcpy(info.type, "m88ts2022", I2C_NAME_SIZE); | 1511 | strlcpy(info.type, "ts2022", I2C_NAME_SIZE); |
1512 | info.addr = 0x60; | 1512 | info.addr = 0x60; |
1513 | info.platform_data = &m88ts2022_config; | 1513 | info.platform_data = &ts2020_config; |
1514 | request_module("m88ts2022"); | 1514 | request_module("ts2020"); |
1515 | client = i2c_new_device(i2c_adapter, &info); | 1515 | client = i2c_new_device(i2c_adapter, &info); |
1516 | if (client == NULL || client->dev.driver == NULL) { | 1516 | if (client == NULL || client->dev.driver == NULL) { |
1517 | dvb_frontend_detach(dvb->fe[0]); | 1517 | dvb_frontend_detach(dvb->fe[0]); |
diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c index 9ecf65629b3d..14eba9c65de3 100644 --- a/drivers/media/usb/em28xx/em28xx-video.c +++ b/drivers/media/usb/em28xx/em28xx-video.c | |||
@@ -1472,7 +1472,7 @@ static int vidioc_enum_input(struct file *file, void *priv, | |||
1472 | (EM28XX_VMUX_CABLE == INPUT(n)->type)) | 1472 | (EM28XX_VMUX_CABLE == INPUT(n)->type)) |
1473 | i->type = V4L2_INPUT_TYPE_TUNER; | 1473 | i->type = V4L2_INPUT_TYPE_TUNER; |
1474 | 1474 | ||
1475 | i->std = dev->v4l2->vdev->tvnorms; | 1475 | i->std = dev->v4l2->vdev.tvnorms; |
1476 | /* webcams do not have the STD API */ | 1476 | /* webcams do not have the STD API */ |
1477 | if (dev->board.is_webcam) | 1477 | if (dev->board.is_webcam) |
1478 | i->capabilities = 0; | 1478 | i->capabilities = 0; |
@@ -1730,9 +1730,9 @@ static int vidioc_querycap(struct file *file, void *priv, | |||
1730 | 1730 | ||
1731 | cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS | | 1731 | cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS | |
1732 | V4L2_CAP_READWRITE | V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING; | 1732 | V4L2_CAP_READWRITE | V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING; |
1733 | if (v4l2->vbi_dev) | 1733 | if (video_is_registered(&v4l2->vbi_dev)) |
1734 | cap->capabilities |= V4L2_CAP_VBI_CAPTURE; | 1734 | cap->capabilities |= V4L2_CAP_VBI_CAPTURE; |
1735 | if (v4l2->radio_dev) | 1735 | if (video_is_registered(&v4l2->radio_dev)) |
1736 | cap->capabilities |= V4L2_CAP_RADIO; | 1736 | cap->capabilities |= V4L2_CAP_RADIO; |
1737 | return 0; | 1737 | return 0; |
1738 | } | 1738 | } |
@@ -1966,20 +1966,20 @@ static int em28xx_v4l2_fini(struct em28xx *dev) | |||
1966 | 1966 | ||
1967 | em28xx_uninit_usb_xfer(dev, EM28XX_ANALOG_MODE); | 1967 | em28xx_uninit_usb_xfer(dev, EM28XX_ANALOG_MODE); |
1968 | 1968 | ||
1969 | if (v4l2->radio_dev) { | 1969 | if (video_is_registered(&v4l2->radio_dev)) { |
1970 | em28xx_info("V4L2 device %s deregistered\n", | 1970 | em28xx_info("V4L2 device %s deregistered\n", |
1971 | video_device_node_name(v4l2->radio_dev)); | 1971 | video_device_node_name(&v4l2->radio_dev)); |
1972 | video_unregister_device(v4l2->radio_dev); | 1972 | video_unregister_device(&v4l2->radio_dev); |
1973 | } | 1973 | } |
1974 | if (v4l2->vbi_dev) { | 1974 | if (video_is_registered(&v4l2->vbi_dev)) { |
1975 | em28xx_info("V4L2 device %s deregistered\n", | 1975 | em28xx_info("V4L2 device %s deregistered\n", |
1976 | video_device_node_name(v4l2->vbi_dev)); | 1976 | video_device_node_name(&v4l2->vbi_dev)); |
1977 | video_unregister_device(v4l2->vbi_dev); | 1977 | video_unregister_device(&v4l2->vbi_dev); |
1978 | } | 1978 | } |
1979 | if (v4l2->vdev) { | 1979 | if (video_is_registered(&v4l2->vdev)) { |
1980 | em28xx_info("V4L2 device %s deregistered\n", | 1980 | em28xx_info("V4L2 device %s deregistered\n", |
1981 | video_device_node_name(v4l2->vdev)); | 1981 | video_device_node_name(&v4l2->vdev)); |
1982 | video_unregister_device(v4l2->vdev); | 1982 | video_unregister_device(&v4l2->vdev); |
1983 | } | 1983 | } |
1984 | 1984 | ||
1985 | v4l2_ctrl_handler_free(&v4l2->ctrl_handler); | 1985 | v4l2_ctrl_handler_free(&v4l2->ctrl_handler); |
@@ -2127,7 +2127,7 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = { | |||
2127 | static const struct video_device em28xx_video_template = { | 2127 | static const struct video_device em28xx_video_template = { |
2128 | .fops = &em28xx_v4l_fops, | 2128 | .fops = &em28xx_v4l_fops, |
2129 | .ioctl_ops = &video_ioctl_ops, | 2129 | .ioctl_ops = &video_ioctl_ops, |
2130 | .release = video_device_release, | 2130 | .release = video_device_release_empty, |
2131 | .tvnorms = V4L2_STD_ALL, | 2131 | .tvnorms = V4L2_STD_ALL, |
2132 | }; | 2132 | }; |
2133 | 2133 | ||
@@ -2156,7 +2156,7 @@ static const struct v4l2_ioctl_ops radio_ioctl_ops = { | |||
2156 | static struct video_device em28xx_radio_template = { | 2156 | static struct video_device em28xx_radio_template = { |
2157 | .fops = &radio_fops, | 2157 | .fops = &radio_fops, |
2158 | .ioctl_ops = &radio_ioctl_ops, | 2158 | .ioctl_ops = &radio_ioctl_ops, |
2159 | .release = video_device_release, | 2159 | .release = video_device_release_empty, |
2160 | }; | 2160 | }; |
2161 | 2161 | ||
2162 | /* I2C possible address to saa7115, tvp5150, msp3400, tvaudio */ | 2162 | /* I2C possible address to saa7115, tvp5150, msp3400, tvaudio */ |
@@ -2179,17 +2179,11 @@ static unsigned short msp3400_addrs[] = { | |||
2179 | 2179 | ||
2180 | /******************************** usb interface ******************************/ | 2180 | /******************************** usb interface ******************************/ |
2181 | 2181 | ||
2182 | static struct video_device | 2182 | static void em28xx_vdev_init(struct em28xx *dev, |
2183 | *em28xx_vdev_init(struct em28xx *dev, | 2183 | struct video_device *vfd, |
2184 | const struct video_device *template, | 2184 | const struct video_device *template, |
2185 | const char *type_name) | 2185 | const char *type_name) |
2186 | { | 2186 | { |
2187 | struct video_device *vfd; | ||
2188 | |||
2189 | vfd = video_device_alloc(); | ||
2190 | if (NULL == vfd) | ||
2191 | return NULL; | ||
2192 | |||
2193 | *vfd = *template; | 2187 | *vfd = *template; |
2194 | vfd->v4l2_dev = &dev->v4l2->v4l2_dev; | 2188 | vfd->v4l2_dev = &dev->v4l2->v4l2_dev; |
2195 | vfd->lock = &dev->lock; | 2189 | vfd->lock = &dev->lock; |
@@ -2200,7 +2194,6 @@ static struct video_device | |||
2200 | dev->name, type_name); | 2194 | dev->name, type_name); |
2201 | 2195 | ||
2202 | video_set_drvdata(vfd, dev); | 2196 | video_set_drvdata(vfd, dev); |
2203 | return vfd; | ||
2204 | } | 2197 | } |
2205 | 2198 | ||
2206 | static void em28xx_tuner_setup(struct em28xx *dev, unsigned short tuner_addr) | 2199 | static void em28xx_tuner_setup(struct em28xx *dev, unsigned short tuner_addr) |
@@ -2491,38 +2484,33 @@ static int em28xx_v4l2_init(struct em28xx *dev) | |||
2491 | goto unregister_dev; | 2484 | goto unregister_dev; |
2492 | 2485 | ||
2493 | /* allocate and fill video video_device struct */ | 2486 | /* allocate and fill video video_device struct */ |
2494 | v4l2->vdev = em28xx_vdev_init(dev, &em28xx_video_template, "video"); | 2487 | em28xx_vdev_init(dev, &v4l2->vdev, &em28xx_video_template, "video"); |
2495 | if (!v4l2->vdev) { | ||
2496 | em28xx_errdev("cannot allocate video_device.\n"); | ||
2497 | ret = -ENODEV; | ||
2498 | goto unregister_dev; | ||
2499 | } | ||
2500 | mutex_init(&v4l2->vb_queue_lock); | 2488 | mutex_init(&v4l2->vb_queue_lock); |
2501 | mutex_init(&v4l2->vb_vbi_queue_lock); | 2489 | mutex_init(&v4l2->vb_vbi_queue_lock); |
2502 | v4l2->vdev->queue = &v4l2->vb_vidq; | 2490 | v4l2->vdev.queue = &v4l2->vb_vidq; |
2503 | v4l2->vdev->queue->lock = &v4l2->vb_queue_lock; | 2491 | v4l2->vdev.queue->lock = &v4l2->vb_queue_lock; |
2504 | 2492 | ||
2505 | /* disable inapplicable ioctls */ | 2493 | /* disable inapplicable ioctls */ |
2506 | if (dev->board.is_webcam) { | 2494 | if (dev->board.is_webcam) { |
2507 | v4l2_disable_ioctl(v4l2->vdev, VIDIOC_QUERYSTD); | 2495 | v4l2_disable_ioctl(&v4l2->vdev, VIDIOC_QUERYSTD); |
2508 | v4l2_disable_ioctl(v4l2->vdev, VIDIOC_G_STD); | 2496 | v4l2_disable_ioctl(&v4l2->vdev, VIDIOC_G_STD); |
2509 | v4l2_disable_ioctl(v4l2->vdev, VIDIOC_S_STD); | 2497 | v4l2_disable_ioctl(&v4l2->vdev, VIDIOC_S_STD); |
2510 | } else { | 2498 | } else { |
2511 | v4l2_disable_ioctl(v4l2->vdev, VIDIOC_S_PARM); | 2499 | v4l2_disable_ioctl(&v4l2->vdev, VIDIOC_S_PARM); |
2512 | } | 2500 | } |
2513 | if (dev->tuner_type == TUNER_ABSENT) { | 2501 | if (dev->tuner_type == TUNER_ABSENT) { |
2514 | v4l2_disable_ioctl(v4l2->vdev, VIDIOC_G_TUNER); | 2502 | v4l2_disable_ioctl(&v4l2->vdev, VIDIOC_G_TUNER); |
2515 | v4l2_disable_ioctl(v4l2->vdev, VIDIOC_S_TUNER); | 2503 | v4l2_disable_ioctl(&v4l2->vdev, VIDIOC_S_TUNER); |
2516 | v4l2_disable_ioctl(v4l2->vdev, VIDIOC_G_FREQUENCY); | 2504 | v4l2_disable_ioctl(&v4l2->vdev, VIDIOC_G_FREQUENCY); |
2517 | v4l2_disable_ioctl(v4l2->vdev, VIDIOC_S_FREQUENCY); | 2505 | v4l2_disable_ioctl(&v4l2->vdev, VIDIOC_S_FREQUENCY); |
2518 | } | 2506 | } |
2519 | if (dev->int_audio_type == EM28XX_INT_AUDIO_NONE) { | 2507 | if (dev->int_audio_type == EM28XX_INT_AUDIO_NONE) { |
2520 | v4l2_disable_ioctl(v4l2->vdev, VIDIOC_G_AUDIO); | 2508 | v4l2_disable_ioctl(&v4l2->vdev, VIDIOC_G_AUDIO); |
2521 | v4l2_disable_ioctl(v4l2->vdev, VIDIOC_S_AUDIO); | 2509 | v4l2_disable_ioctl(&v4l2->vdev, VIDIOC_S_AUDIO); |
2522 | } | 2510 | } |
2523 | 2511 | ||
2524 | /* register v4l2 video video_device */ | 2512 | /* register v4l2 video video_device */ |
2525 | ret = video_register_device(v4l2->vdev, VFL_TYPE_GRABBER, | 2513 | ret = video_register_device(&v4l2->vdev, VFL_TYPE_GRABBER, |
2526 | video_nr[dev->devno]); | 2514 | video_nr[dev->devno]); |
2527 | if (ret) { | 2515 | if (ret) { |
2528 | em28xx_errdev("unable to register video device (error=%i).\n", | 2516 | em28xx_errdev("unable to register video device (error=%i).\n", |
@@ -2532,27 +2520,27 @@ static int em28xx_v4l2_init(struct em28xx *dev) | |||
2532 | 2520 | ||
2533 | /* Allocate and fill vbi video_device struct */ | 2521 | /* Allocate and fill vbi video_device struct */ |
2534 | if (em28xx_vbi_supported(dev) == 1) { | 2522 | if (em28xx_vbi_supported(dev) == 1) { |
2535 | v4l2->vbi_dev = em28xx_vdev_init(dev, &em28xx_video_template, | 2523 | em28xx_vdev_init(dev, &v4l2->vbi_dev, &em28xx_video_template, |
2536 | "vbi"); | 2524 | "vbi"); |
2537 | 2525 | ||
2538 | v4l2->vbi_dev->queue = &v4l2->vb_vbiq; | 2526 | v4l2->vbi_dev.queue = &v4l2->vb_vbiq; |
2539 | v4l2->vbi_dev->queue->lock = &v4l2->vb_vbi_queue_lock; | 2527 | v4l2->vbi_dev.queue->lock = &v4l2->vb_vbi_queue_lock; |
2540 | 2528 | ||
2541 | /* disable inapplicable ioctls */ | 2529 | /* disable inapplicable ioctls */ |
2542 | v4l2_disable_ioctl(v4l2->vbi_dev, VIDIOC_S_PARM); | 2530 | v4l2_disable_ioctl(&v4l2->vbi_dev, VIDIOC_S_PARM); |
2543 | if (dev->tuner_type == TUNER_ABSENT) { | 2531 | if (dev->tuner_type == TUNER_ABSENT) { |
2544 | v4l2_disable_ioctl(v4l2->vbi_dev, VIDIOC_G_TUNER); | 2532 | v4l2_disable_ioctl(&v4l2->vbi_dev, VIDIOC_G_TUNER); |
2545 | v4l2_disable_ioctl(v4l2->vbi_dev, VIDIOC_S_TUNER); | 2533 | v4l2_disable_ioctl(&v4l2->vbi_dev, VIDIOC_S_TUNER); |
2546 | v4l2_disable_ioctl(v4l2->vbi_dev, VIDIOC_G_FREQUENCY); | 2534 | v4l2_disable_ioctl(&v4l2->vbi_dev, VIDIOC_G_FREQUENCY); |
2547 | v4l2_disable_ioctl(v4l2->vbi_dev, VIDIOC_S_FREQUENCY); | 2535 | v4l2_disable_ioctl(&v4l2->vbi_dev, VIDIOC_S_FREQUENCY); |
2548 | } | 2536 | } |
2549 | if (dev->int_audio_type == EM28XX_INT_AUDIO_NONE) { | 2537 | if (dev->int_audio_type == EM28XX_INT_AUDIO_NONE) { |
2550 | v4l2_disable_ioctl(v4l2->vbi_dev, VIDIOC_G_AUDIO); | 2538 | v4l2_disable_ioctl(&v4l2->vbi_dev, VIDIOC_G_AUDIO); |
2551 | v4l2_disable_ioctl(v4l2->vbi_dev, VIDIOC_S_AUDIO); | 2539 | v4l2_disable_ioctl(&v4l2->vbi_dev, VIDIOC_S_AUDIO); |
2552 | } | 2540 | } |
2553 | 2541 | ||
2554 | /* register v4l2 vbi video_device */ | 2542 | /* register v4l2 vbi video_device */ |
2555 | ret = video_register_device(v4l2->vbi_dev, VFL_TYPE_VBI, | 2543 | ret = video_register_device(&v4l2->vbi_dev, VFL_TYPE_VBI, |
2556 | vbi_nr[dev->devno]); | 2544 | vbi_nr[dev->devno]); |
2557 | if (ret < 0) { | 2545 | if (ret < 0) { |
2558 | em28xx_errdev("unable to register vbi device\n"); | 2546 | em28xx_errdev("unable to register vbi device\n"); |
@@ -2561,29 +2549,24 @@ static int em28xx_v4l2_init(struct em28xx *dev) | |||
2561 | } | 2549 | } |
2562 | 2550 | ||
2563 | if (em28xx_boards[dev->model].radio.type == EM28XX_RADIO) { | 2551 | if (em28xx_boards[dev->model].radio.type == EM28XX_RADIO) { |
2564 | v4l2->radio_dev = em28xx_vdev_init(dev, &em28xx_radio_template, | 2552 | em28xx_vdev_init(dev, &v4l2->radio_dev, &em28xx_radio_template, |
2565 | "radio"); | 2553 | "radio"); |
2566 | if (!v4l2->radio_dev) { | 2554 | ret = video_register_device(&v4l2->radio_dev, VFL_TYPE_RADIO, |
2567 | em28xx_errdev("cannot allocate video_device.\n"); | ||
2568 | ret = -ENODEV; | ||
2569 | goto unregister_dev; | ||
2570 | } | ||
2571 | ret = video_register_device(v4l2->radio_dev, VFL_TYPE_RADIO, | ||
2572 | radio_nr[dev->devno]); | 2555 | radio_nr[dev->devno]); |
2573 | if (ret < 0) { | 2556 | if (ret < 0) { |
2574 | em28xx_errdev("can't register radio device\n"); | 2557 | em28xx_errdev("can't register radio device\n"); |
2575 | goto unregister_dev; | 2558 | goto unregister_dev; |
2576 | } | 2559 | } |
2577 | em28xx_info("Registered radio device as %s\n", | 2560 | em28xx_info("Registered radio device as %s\n", |
2578 | video_device_node_name(v4l2->radio_dev)); | 2561 | video_device_node_name(&v4l2->radio_dev)); |
2579 | } | 2562 | } |
2580 | 2563 | ||
2581 | em28xx_info("V4L2 video device registered as %s\n", | 2564 | em28xx_info("V4L2 video device registered as %s\n", |
2582 | video_device_node_name(v4l2->vdev)); | 2565 | video_device_node_name(&v4l2->vdev)); |
2583 | 2566 | ||
2584 | if (v4l2->vbi_dev) | 2567 | if (video_is_registered(&v4l2->vbi_dev)) |
2585 | em28xx_info("V4L2 VBI device registered as %s\n", | 2568 | em28xx_info("V4L2 VBI device registered as %s\n", |
2586 | video_device_node_name(v4l2->vbi_dev)); | 2569 | video_device_node_name(&v4l2->vbi_dev)); |
2587 | 2570 | ||
2588 | /* Save some power by putting tuner to sleep */ | 2571 | /* Save some power by putting tuner to sleep */ |
2589 | v4l2_device_call_all(&v4l2->v4l2_dev, 0, core, s_power, 0); | 2572 | v4l2_device_call_all(&v4l2->v4l2_dev, 0, core, s_power, 0); |
diff --git a/drivers/media/usb/em28xx/em28xx.h b/drivers/media/usb/em28xx/em28xx.h index 9c7075344109..e6559c6f143c 100644 --- a/drivers/media/usb/em28xx/em28xx.h +++ b/drivers/media/usb/em28xx/em28xx.h | |||
@@ -143,6 +143,7 @@ | |||
143 | #define EM28178_BOARD_PCTV_292E 94 | 143 | #define EM28178_BOARD_PCTV_292E 94 |
144 | #define EM2861_BOARD_LEADTEK_VC100 95 | 144 | #define EM2861_BOARD_LEADTEK_VC100 95 |
145 | #define EM28178_BOARD_TERRATEC_T2_STICK_HD 96 | 145 | #define EM28178_BOARD_TERRATEC_T2_STICK_HD 96 |
146 | #define EM2884_BOARD_ELGATO_EYETV_HYBRID_2008 97 | ||
146 | 147 | ||
147 | /* Limits minimum and default number of buffers */ | 148 | /* Limits minimum and default number of buffers */ |
148 | #define EM28XX_MIN_BUF 4 | 149 | #define EM28XX_MIN_BUF 4 |
@@ -512,9 +513,9 @@ struct em28xx_v4l2 { | |||
512 | struct v4l2_ctrl_handler ctrl_handler; | 513 | struct v4l2_ctrl_handler ctrl_handler; |
513 | struct v4l2_clk *clk; | 514 | struct v4l2_clk *clk; |
514 | 515 | ||
515 | struct video_device *vdev; | 516 | struct video_device vdev; |
516 | struct video_device *vbi_dev; | 517 | struct video_device vbi_dev; |
517 | struct video_device *radio_dev; | 518 | struct video_device radio_dev; |
518 | 519 | ||
519 | /* Videobuf2 */ | 520 | /* Videobuf2 */ |
520 | struct vb2_queue vb_vidq; | 521 | struct vb2_queue vb_vidq; |