All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Antti Palosaari <crope@iki.fi>, linux-media@vger.kernel.org
Subject: Re: [PATCHv3 06/13] v4l: add type field to v4l2_modulator struct
Date: Mon, 10 Aug 2015 11:01:56 +0200	[thread overview]
Message-ID: <55C86884.30505@xs4all.nl> (raw)
In-Reply-To: <1438308650-2702-7-git-send-email-crope@iki.fi>

On 07/31/2015 04:10 AM, Antti Palosaari wrote:
> Add type field to that struct like it counterpart v4l2_tuner
> already has. We need type field to distinguish different tuner
> types from each others for transmitter too.
> 
> Cc: Hans Verkuil <hverkuil@xs4all.nl>
> Signed-off-by: Antti Palosaari <crope@iki.fi>

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>

> ---
>  drivers/media/v4l2-core/v4l2-ioctl.c | 18 +++++++++++++++++-
>  include/uapi/linux/videodev2.h       |  3 ++-
>  2 files changed, 19 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
> index 21e9598..85f80cb 100644
> --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> @@ -1646,15 +1646,31 @@ static int v4l_s_tuner(const struct v4l2_ioctl_ops *ops,
>  static int v4l_g_modulator(const struct v4l2_ioctl_ops *ops,
>  				struct file *file, void *fh, void *arg)
>  {
> +	struct video_device *vfd = video_devdata(file);
>  	struct v4l2_modulator *p = arg;
>  	int err;
>  
> +	if (vfd->vfl_type == VFL_TYPE_RADIO)
> +		p->type = V4L2_TUNER_RADIO;
> +
>  	err = ops->vidioc_g_modulator(file, fh, p);
>  	if (!err)
>  		p->capability |= V4L2_TUNER_CAP_FREQ_BANDS;
>  	return err;
>  }
>  
> +static int v4l_s_modulator(const struct v4l2_ioctl_ops *ops,
> +				struct file *file, void *fh, void *arg)
> +{
> +	struct video_device *vfd = video_devdata(file);
> +	struct v4l2_modulator *p = arg;
> +
> +	if (vfd->vfl_type == VFL_TYPE_RADIO)
> +		p->type = V4L2_TUNER_RADIO;
> +
> +	return ops->vidioc_s_modulator(file, fh, p);
> +}
> +
>  static int v4l_g_frequency(const struct v4l2_ioctl_ops *ops,
>  				struct file *file, void *fh, void *arg)
>  {
> @@ -2441,7 +2457,7 @@ static struct v4l2_ioctl_info v4l2_ioctls[] = {
>  	IOCTL_INFO_STD(VIDIOC_G_AUDOUT, vidioc_g_audout, v4l_print_audioout, 0),
>  	IOCTL_INFO_STD(VIDIOC_S_AUDOUT, vidioc_s_audout, v4l_print_audioout, INFO_FL_PRIO),
>  	IOCTL_INFO_FNC(VIDIOC_G_MODULATOR, v4l_g_modulator, v4l_print_modulator, INFO_FL_CLEAR(v4l2_modulator, index)),
> -	IOCTL_INFO_STD(VIDIOC_S_MODULATOR, vidioc_s_modulator, v4l_print_modulator, INFO_FL_PRIO),
> +	IOCTL_INFO_FNC(VIDIOC_S_MODULATOR, v4l_s_modulator, v4l_print_modulator, INFO_FL_PRIO),
>  	IOCTL_INFO_FNC(VIDIOC_G_FREQUENCY, v4l_g_frequency, v4l_print_frequency, INFO_FL_CLEAR(v4l2_frequency, tuner)),
>  	IOCTL_INFO_FNC(VIDIOC_S_FREQUENCY, v4l_s_frequency, v4l_print_frequency, INFO_FL_PRIO),
>  	IOCTL_INFO_FNC(VIDIOC_CROPCAP, v4l_cropcap, v4l_print_cropcap, INFO_FL_CLEAR(v4l2_cropcap, type)),
> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
> index 70f06c9..3a8eb8e 100644
> --- a/include/uapi/linux/videodev2.h
> +++ b/include/uapi/linux/videodev2.h
> @@ -1584,7 +1584,8 @@ struct v4l2_modulator {
>  	__u32			rangelow;
>  	__u32			rangehigh;
>  	__u32			txsubchans;
> -	__u32			reserved[4];
> +	__u32			type;	/* enum v4l2_tuner_type */
> +	__u32			reserved[3];
>  };
>  
>  /*  Flags for the 'capability' field */
> 


  reply	other threads:[~2015-08-10  9:02 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-31  2:10 [PATCHv3 00/13] SDR transmitter API Antti Palosaari
2015-07-31  2:10 ` [PATCHv3 01/13] v4l2: rename V4L2_TUNER_ADC to V4L2_TUNER_SDR Antti Palosaari
2015-07-31  2:10 ` [PATCHv3 02/13] v4l2: add RF gain control Antti Palosaari
2015-08-10  8:56   ` Hans Verkuil
2015-07-31  2:10 ` [PATCHv3 03/13] DocBook: document tuner " Antti Palosaari
2015-08-10  8:57   ` Hans Verkuil
2015-07-31  2:10 ` [PATCHv3 04/13] v4l2: add support for SDR transmitter Antti Palosaari
2015-07-31  2:10 ` [PATCHv3 05/13] DocBook: document " Antti Palosaari
2015-07-31  2:10 ` [PATCHv3 06/13] v4l: add type field to v4l2_modulator struct Antti Palosaari
2015-08-10  9:01   ` Hans Verkuil [this message]
2015-07-31  2:10 ` [PATCHv3 07/13] DocBook: add modulator type field Antti Palosaari
2015-08-10  9:02   ` Hans Verkuil
2015-07-31  2:10 ` [PATCHv3 08/13] hackrf: add control for RF amplifier Antti Palosaari
2015-08-10  9:03   ` Hans Verkuil
2015-07-31  2:10 ` [PATCHv3 09/13] hackrf: switch to single function which configures everything Antti Palosaari
2015-08-10  9:04   ` Hans Verkuil
2015-07-31  2:10 ` [PATCHv3 10/13] hackrf: add support for transmitter Antti Palosaari
2015-08-10  9:34   ` Hans Verkuil
2015-07-31  2:10 ` [PATCHv3 11/13] hackrf: do not set human readable name for formats Antti Palosaari
2015-07-31  2:10 ` [PATCHv3 12/13] DocBook: fix S_FREQUENCY => G_FREQUENCY Antti Palosaari
2015-08-10  9:41   ` Hans Verkuil
2015-08-11  2:55     ` Antti Palosaari
2015-07-31  2:10 ` [PATCHv3 13/13] DocBook: add tuner types SDR and RF for G_TUNER / S_TUNER Antti Palosaari
2015-08-10  9:43   ` Hans Verkuil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55C86884.30505@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=crope@iki.fi \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.