public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Antti Palosaari <crope@iki.fi>
Cc: linux-media@vger.kernel.org,
	Mauro Carvalho Chehab <m.chehab@samsung.com>
Subject: Re: [PATCH RFC v4 6/7] v4l: enable some IOCTLs for SDR receiver
Date: Thu, 19 Dec 2013 10:02:31 +0100	[thread overview]
Message-ID: <52B2B627.2090302@xs4all.nl> (raw)
In-Reply-To: <1387425606-7458-7-git-send-email-crope@iki.fi>

On 12/19/2013 05:00 AM, Antti Palosaari wrote:
> Enable stream format (FMT) IOCTLs for SDR use. These are used for negotiate
> used data stream format.
> 
> Reorganise some some IOCTL selection logic.
> 
> Cc: Hans Verkuil <hverkuil@xs4all.nl>
> Signed-off-by: Antti Palosaari <crope@iki.fi>
> ---
>  drivers/media/v4l2-core/v4l2-dev.c   | 21 ++++++++++++++++++---
>  drivers/media/v4l2-core/v4l2-ioctl.c | 35 +++++++++++++++++++++++++++++++++++
>  2 files changed, 53 insertions(+), 3 deletions(-)
> 

Can you add this patch to your patch series? Or fold it into your patch 6/7, that's
fine too.

It fixes a small bug I found (not yours, it was there already) where the modulator
ioctls could be enabled for non-radio devices. Currently the modulator ioctls are
only valid for radio.

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

Regards,

	Hans

diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c
index 2f0982f..bcfd33b 100644
--- a/drivers/media/v4l2-core/v4l2-dev.c
+++ b/drivers/media/v4l2-core/v4l2-dev.c
@@ -562,6 +562,7 @@ static void determine_valid_ioctls(struct video_device *vdev)
 	const struct v4l2_ioctl_ops *ops = vdev->ioctl_ops;
 	bool is_vid = vdev->vfl_type == VFL_TYPE_GRABBER;
 	bool is_vbi = vdev->vfl_type == VFL_TYPE_VBI;
+	bool is_radio = vdev->vfl_type == VFL_TYPE_RADIO;
 	bool is_sdr = vdev->vfl_type == VFL_TYPE_SDR;
 	bool is_rx = vdev->vfl_dir != VFL_DIR_TX;
 	bool is_tx = vdev->vfl_dir != VFL_DIR_RX;
@@ -735,8 +736,8 @@ static void determine_valid_ioctls(struct video_device *vdev)
 		SET_VALID_IOCTL(ops, VIDIOC_ENUM_DV_TIMINGS, vidioc_enum_dv_timings);
 		SET_VALID_IOCTL(ops, VIDIOC_DV_TIMINGS_CAP, vidioc_dv_timings_cap);
 	}
-	if (is_tx) {
-		/* transmitter only ioctls */
+	if (is_tx && (is_radio || is_sdr)) {
+		/* radio transmitter only ioctls */
 		SET_VALID_IOCTL(ops, VIDIOC_G_MODULATOR, vidioc_g_modulator);
 		SET_VALID_IOCTL(ops, VIDIOC_S_MODULATOR, vidioc_s_modulator);
 	}


  parent reply	other threads:[~2013-12-19  9:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-19  3:59 [PATCH RFC v4 0/7] SDR API Antti Palosaari
2013-12-19  4:00 ` [PATCH RFC v4 1/7] v4l: add device type for Software Defined Radio Antti Palosaari
2013-12-19  8:48   ` Hans Verkuil
2013-12-19  4:00 ` [PATCH RFC v4 2/7] v4l: add new tuner types for SDR Antti Palosaari
2013-12-19  4:00 ` [PATCH RFC v4 3/7] v4l: 1 Hz resolution flag for tuners Antti Palosaari
2013-12-19  4:00 ` [PATCH RFC v4 4/7] v4l: add stream format for SDR receiver Antti Palosaari
2013-12-19  4:00 ` [PATCH RFC v4 5/7] v4l: define own IOCTL ops for SDR FMT Antti Palosaari
2013-12-19  4:00 ` [PATCH RFC v4 6/7] v4l: enable some IOCTLs for SDR receiver Antti Palosaari
2013-12-19  8:55   ` Hans Verkuil
2013-12-19  9:02   ` Hans Verkuil [this message]
2013-12-19  4:00 ` [PATCH RFC v4 7/7] v4l: add device capability flag " Antti Palosaari
2013-12-19  8:56   ` Hans Verkuil
2013-12-19  8:45 ` [PATCH RFC v4 0/7] SDR API 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=52B2B627.2090302@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=crope@iki.fi \
    --cc=linux-media@vger.kernel.org \
    --cc=m.chehab@samsung.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox