diff options
author | Frank Schaefer <fschaefer.oss@googlemail.com> | 2014-01-12 11:24:18 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-01-14 11:29:46 -0500 |
commit | 4e1702402e8a81dcd4f3bae14a88327e39fa018c (patch) | |
tree | defe7c11a88f04d6ddc832a0cb6b3810456c6a7d /drivers/media | |
parent | eab924d0e2bdfd53c902162b0b499b8464c1fb4a (diff) |
[media] em28xx-v4l: fix device initialization in em28xx_v4l2_open() for radio and VBI mode
- bail out on unsupported VFL_TYPE
- em28xx_set_mode() needs to be called for VBI and radio mode, too
- em28xx_wake_i2c() needs to be called for VBI and radio mode, too
- em28xx_resolution_set() also needs to be called for VBI
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-video.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c index a1dcceb7b2c0..efbc877c6181 100644 --- a/drivers/media/usb/em28xx/em28xx-video.c +++ b/drivers/media/usb/em28xx/em28xx-video.c | |||
@@ -1826,6 +1826,10 @@ static int em28xx_v4l2_open(struct file *filp) | |||
1826 | case VFL_TYPE_VBI: | 1826 | case VFL_TYPE_VBI: |
1827 | fh_type = V4L2_BUF_TYPE_VBI_CAPTURE; | 1827 | fh_type = V4L2_BUF_TYPE_VBI_CAPTURE; |
1828 | break; | 1828 | break; |
1829 | case VFL_TYPE_RADIO: | ||
1830 | break; | ||
1831 | default: | ||
1832 | return -EINVAL; | ||
1829 | } | 1833 | } |
1830 | 1834 | ||
1831 | em28xx_videodbg("open dev=%s type=%s users=%d\n", | 1835 | em28xx_videodbg("open dev=%s type=%s users=%d\n", |
@@ -1846,15 +1850,17 @@ static int em28xx_v4l2_open(struct file *filp) | |||
1846 | fh->type = fh_type; | 1850 | fh->type = fh_type; |
1847 | filp->private_data = fh; | 1851 | filp->private_data = fh; |
1848 | 1852 | ||
1849 | if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE && dev->users == 0) { | 1853 | if (dev->users == 0) { |
1850 | em28xx_set_mode(dev, EM28XX_ANALOG_MODE); | 1854 | em28xx_set_mode(dev, EM28XX_ANALOG_MODE); |
1851 | em28xx_resolution_set(dev); | ||
1852 | 1855 | ||
1853 | /* Needed, since GPIO might have disabled power of | 1856 | if (vdev->vfl_type != VFL_TYPE_RADIO) |
1854 | some i2c device | 1857 | em28xx_resolution_set(dev); |
1858 | |||
1859 | /* | ||
1860 | * Needed, since GPIO might have disabled power | ||
1861 | * of some i2c devices | ||
1855 | */ | 1862 | */ |
1856 | em28xx_wake_i2c(dev); | 1863 | em28xx_wake_i2c(dev); |
1857 | |||
1858 | } | 1864 | } |
1859 | 1865 | ||
1860 | if (vdev->vfl_type == VFL_TYPE_RADIO) { | 1866 | if (vdev->vfl_type == VFL_TYPE_RADIO) { |