提交 4e170240 编写于 作者: F Frank Schaefer 提交者: Mauro Carvalho Chehab

[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: NFrank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
上级 eab924d0
...@@ -1826,6 +1826,10 @@ static int em28xx_v4l2_open(struct file *filp) ...@@ -1826,6 +1826,10 @@ static int em28xx_v4l2_open(struct file *filp)
case VFL_TYPE_VBI: case VFL_TYPE_VBI:
fh_type = V4L2_BUF_TYPE_VBI_CAPTURE; fh_type = V4L2_BUF_TYPE_VBI_CAPTURE;
break; break;
case VFL_TYPE_RADIO:
break;
default:
return -EINVAL;
} }
em28xx_videodbg("open dev=%s type=%s users=%d\n", em28xx_videodbg("open dev=%s type=%s users=%d\n",
...@@ -1846,15 +1850,17 @@ static int em28xx_v4l2_open(struct file *filp) ...@@ -1846,15 +1850,17 @@ static int em28xx_v4l2_open(struct file *filp)
fh->type = fh_type; fh->type = fh_type;
filp->private_data = fh; filp->private_data = fh;
if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE && dev->users == 0) { if (dev->users == 0) {
em28xx_set_mode(dev, EM28XX_ANALOG_MODE); em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
em28xx_resolution_set(dev);
/* Needed, since GPIO might have disabled power of if (vdev->vfl_type != VFL_TYPE_RADIO)
some i2c device em28xx_resolution_set(dev);
/*
* Needed, since GPIO might have disabled power
* of some i2c devices
*/ */
em28xx_wake_i2c(dev); em28xx_wake_i2c(dev);
} }
if (vdev->vfl_type == VFL_TYPE_RADIO) { if (vdev->vfl_type == VFL_TYPE_RADIO) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册