Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1320815 > unrolled thread
| Started by | Mauro Carvalho Chehab <mchehab@osg.samsung.com> |
|---|---|
| First post | 2016-01-28 17:00 +0100 |
| Last post | 2016-01-28 20:40 +0100 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH 17/31] media: au0828 video change to use v4l_enable_media_tuner() Mauro Carvalho Chehab <mchehab@osg.samsung.com> - 2016-01-28 17:00 +0100
Re: [PATCH 17/31] media: au0828 video change to use v4l_enable_media_tuner() Shuah Khan <shuahkh@osg.samsung.com> - 2016-01-28 20:30 +0100
Re: [PATCH 17/31] media: au0828 video change to use v4l_enable_media_tuner() Devin Heitmueller <dheitmueller@kernellabs.com> - 2016-01-28 20:40 +0100
| From | Mauro Carvalho Chehab <mchehab@osg.samsung.com> |
|---|---|
| Date | 2016-01-28 17:00 +0100 |
| Subject | Re: [PATCH 17/31] media: au0828 video change to use v4l_enable_media_tuner() |
| Message-ID | <qVX9f-5Ao-11@gated-at.bofh.it> |
Em Wed, 6 Jan 2016 13:27:06 -0700
Shuah Khan <shuahkh@osg.samsung.com> escreveu:
> au0828 is changed to use v4l_enable_media_tuner() to check for
> tuner availability from vidioc_g_tuner(), and au0828_v4l2_close(),
> before changing tuner settings. If tuner isn't free, return busy
> condition from vidioc_g_tuner() and in au0828_v4l2_close() tuner
> is left untouched without powering down to save energy.
Did you test the code when the input is not a tuner, but, instead,
Composite or S-Video connector, as shown at:
https://mchehab.fedorapeople.org/mc-next-gen/au0828.png
I guess calling it v4l-enable_media_tuner() is not right, specially
since there are hybrid devices that have DTV (via DVB API) and
S-Video and/or Composite/RCA capture via V4L2 API.
>
> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
> ---
> drivers/media/usb/au0828/au0828-video.c | 14 ++++++++++++--
> 1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c
> index 32bcc56..ed3ba05 100644
> --- a/drivers/media/usb/au0828/au0828-video.c
> +++ b/drivers/media/usb/au0828/au0828-video.c
> @@ -1010,8 +1010,12 @@ static int au0828_v4l2_close(struct file *filp)
> goto end;
>
> if (dev->users == 1) {
> - /* Save some power by putting tuner to sleep */
> - v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_power, 0);
> + /* Save some power by putting tuner to sleep, if it is free */
> + /* What happens when radio is using tuner?? */
> + ret = v4l_enable_media_tuner(vdev);
> + if (ret == 0)
> + v4l2_device_call_all(&dev->v4l2_dev, 0, core,
> + s_power, 0);
> dev->std_set_in_tuner_core = 0;
>
> /* When close the device, set the usb intf0 into alt0 to free
> @@ -1412,10 +1416,16 @@ static int vidioc_s_audio(struct file *file, void *priv, const struct v4l2_audio
> static int vidioc_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t)
> {
> struct au0828_dev *dev = video_drvdata(file);
> + struct video_device *vfd = video_devdata(file);
> + int ret;
>
> if (t->index != 0)
> return -EINVAL;
>
> + ret = v4l_enable_media_tuner(vfd);
> + if (ret)
> + return ret;
> +
> dprintk(1, "%s called std_set %d dev_state %d\n", __func__,
> dev->std_set_in_tuner_core, dev->dev_state);
>
[toc] | [next] | [standalone]
| From | Shuah Khan <shuahkh@osg.samsung.com> |
|---|---|
| Date | 2016-01-28 20:30 +0100 |
| Message-ID | <qW0qu-841-11@gated-at.bofh.it> |
| In reply to | #1320815 |
On 01/28/2016 08:57 AM, Mauro Carvalho Chehab wrote:
> Em Wed, 6 Jan 2016 13:27:06 -0700
> Shuah Khan <shuahkh@osg.samsung.com> escreveu:
>
>> au0828 is changed to use v4l_enable_media_tuner() to check for
>> tuner availability from vidioc_g_tuner(), and au0828_v4l2_close(),
>> before changing tuner settings. If tuner isn't free, return busy
>> condition from vidioc_g_tuner() and in au0828_v4l2_close() tuner
>> is left untouched without powering down to save energy.
>
> Did you test the code when the input is not a tuner, but, instead,
> Composite or S-Video connector, as shown at:
> https://mchehab.fedorapeople.org/mc-next-gen/au0828.png
I am not sure if I did or not. I can double check this case.
Do you have concerns that this won't work?
>
> I guess calling it v4l-enable_media_tuner() is not right, specially
> since there are hybrid devices that have DTV (via DVB API) and
> S-Video and/or Composite/RCA capture via V4L2 API.
How does v4l-enable_media_source() sound?
thanks,
-- Shuah
>
>>
>> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
>> ---
>> drivers/media/usb/au0828/au0828-video.c | 14 ++++++++++++--
>> 1 file changed, 12 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c
>> index 32bcc56..ed3ba05 100644
>> --- a/drivers/media/usb/au0828/au0828-video.c
>> +++ b/drivers/media/usb/au0828/au0828-video.c
>> @@ -1010,8 +1010,12 @@ static int au0828_v4l2_close(struct file *filp)
>> goto end;
>>
>> if (dev->users == 1) {
>> - /* Save some power by putting tuner to sleep */
>> - v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_power, 0);
>> + /* Save some power by putting tuner to sleep, if it is free */
>> + /* What happens when radio is using tuner?? */
>> + ret = v4l_enable_media_tuner(vdev);
>> + if (ret == 0)
>> + v4l2_device_call_all(&dev->v4l2_dev, 0, core,
>> + s_power, 0);
>> dev->std_set_in_tuner_core = 0;
>>
>> /* When close the device, set the usb intf0 into alt0 to free
>> @@ -1412,10 +1416,16 @@ static int vidioc_s_audio(struct file *file, void *priv, const struct v4l2_audio
>> static int vidioc_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t)
>> {
>> struct au0828_dev *dev = video_drvdata(file);
>> + struct video_device *vfd = video_devdata(file);
>> + int ret;
>>
>> if (t->index != 0)
>> return -EINVAL;
>>
>> + ret = v4l_enable_media_tuner(vfd);
>> + if (ret)
>> + return ret;
>> +
>> dprintk(1, "%s called std_set %d dev_state %d\n", __func__,
>> dev->std_set_in_tuner_core, dev->dev_state);
>>
--
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978
[toc] | [prev] | [next] | [standalone]
| From | Devin Heitmueller <dheitmueller@kernellabs.com> |
|---|---|
| Date | 2016-01-28 20:40 +0100 |
| Subject | Re: [PATCH 17/31] media: au0828 video change to use v4l_enable_media_tuner() |
| Message-ID | <qW0A9-87S-5@gated-at.bofh.it> |
| In reply to | #1320961 |
Hi Shuah, Mauro, >> Did you test the code when the input is not a tuner, but, instead, >> Composite or S-Video connector, as shown at: >> https://mchehab.fedorapeople.org/mc-next-gen/au0828.png > > I am not sure if I did or not. I can double check this case. > Do you have concerns that this won't work? I'm not sure how you expect the MC framework to be handling this case, but I can tell you that the hardware will *not* support simultaneous streaming of the DVB feed at the same time as the analog feed, even if you're using the composite/s-video input and not actually using the xc5000 tuner in analog mode. Devin -- Devin J. Heitmueller - Kernel Labs http://www.kernellabs.com
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web