Skip to content

Commit ce4a3d5

Browse files
Hans VerkuilMauro Carvalho Chehab
authored andcommitted
[media] radio: set vfl_dir correctly to fix modulator regression
The vfl_dir field should be set to indicate whether a device can receive data, output data or can do both. This is used to let the v4l core know which ioctls should be accepted and which can be refused. Unfortunately, when this field was added the radio modulator drivers were not updated: radio modulators transmit and so vfl_dir should be set to VFL_DIR_TX (or VFL_DIR_M2M in the special case of wl128x). Because of this omission it is not possible to call g/s_modulator for these drivers, which effectively renders them useless. This patch sets the correct vfl_dir value for these drivers, correcting this bug. Thanks to Paul Grinberg for bringing this to my attention. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
1 parent 68d6f84 commit ce4a3d5

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

drivers/media/radio/radio-keene.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ static int usb_keene_probe(struct usb_interface *intf,
374374
radio->vdev.ioctl_ops = &usb_keene_ioctl_ops;
375375
radio->vdev.lock = &radio->lock;
376376
radio->vdev.release = video_device_release_empty;
377+
radio->vdev.vfl_dir = VFL_DIR_TX;
377378

378379
radio->usbdev = interface_to_usbdev(intf);
379380
radio->intf = intf;

drivers/media/radio/radio-si4713.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ static struct video_device radio_si4713_vdev_template = {
250250
.name = "radio-si4713",
251251
.release = video_device_release,
252252
.ioctl_ops = &radio_si4713_ioctl_ops,
253+
.vfl_dir = VFL_DIR_TX,
253254
};
254255

255256
/* Platform driver interface */

drivers/media/radio/radio-wl1273.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1971,6 +1971,7 @@ static struct video_device wl1273_viddev_template = {
19711971
.ioctl_ops = &wl1273_ioctl_ops,
19721972
.name = WL1273_FM_DRIVER_NAME,
19731973
.release = wl1273_vdev_release,
1974+
.vfl_dir = VFL_DIR_TX,
19741975
};
19751976

19761977
static int wl1273_fm_radio_remove(struct platform_device *pdev)

drivers/media/radio/wl128x/fmdrv_v4l2.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,16 @@ static struct video_device fm_viddev_template = {
518518
.ioctl_ops = &fm_drv_ioctl_ops,
519519
.name = FM_DRV_NAME,
520520
.release = video_device_release,
521+
/*
522+
* To ensure both the tuner and modulator ioctls are accessible we
523+
* set the vfl_dir to M2M to indicate this.
524+
*
525+
* It is not really a mem2mem device of course, but it can both receive
526+
* and transmit using the same radio device. It's the only radio driver
527+
* that does this and it should really be split in two radio devices,
528+
* but that would affect applications using this driver.
529+
*/
530+
.vfl_dir = VFL_DIR_M2M,
521531
};
522532

523533
int fm_v4l2_init_video_device(struct fmdev *fmdev, int radio_nr)

0 commit comments

Comments
 (0)