diff options
Diffstat (limited to 'drivers/media/radio')
| -rw-r--r-- | drivers/media/radio/dsbr100.c | 1 | ||||
| -rw-r--r-- | drivers/media/radio/radio-cadet.c | 1 | ||||
| -rw-r--r-- | drivers/media/radio/radio-isa.c | 1 | ||||
| -rw-r--r-- | drivers/media/radio/radio-keene.c | 3 | ||||
| -rw-r--r-- | drivers/media/radio/radio-ma901.c | 1 | ||||
| -rw-r--r-- | drivers/media/radio/radio-miropcm20.c | 304 | ||||
| -rw-r--r-- | drivers/media/radio/radio-mr800.c | 3 | ||||
| -rw-r--r-- | drivers/media/radio/radio-raremono.c | 1 | ||||
| -rw-r--r-- | drivers/media/radio/radio-sf16fmi.c | 1 | ||||
| -rw-r--r-- | drivers/media/radio/radio-si476x.c | 1 | ||||
| -rw-r--r-- | drivers/media/radio/radio-tea5764.c | 1 | ||||
| -rw-r--r-- | drivers/media/radio/radio-tea5777.c | 1 | ||||
| -rw-r--r-- | drivers/media/radio/radio-timb.c | 1 | ||||
| -rw-r--r-- | drivers/media/radio/si470x/radio-si470x-usb.c | 1 | ||||
| -rw-r--r-- | drivers/media/radio/si4713/radio-platform-si4713.c | 1 | ||||
| -rw-r--r-- | drivers/media/radio/si4713/radio-usb-si4713.c | 1 | ||||
| -rw-r--r-- | drivers/media/radio/si4713/si4713.c | 80 | ||||
| -rw-r--r-- | drivers/media/radio/si4713/si4713.h | 9 | ||||
| -rw-r--r-- | drivers/media/radio/tea575x.c | 1 |
19 files changed, 374 insertions, 39 deletions
diff --git a/drivers/media/radio/dsbr100.c b/drivers/media/radio/dsbr100.c index 142c2ee64d31..2262b8139ca1 100644 --- a/drivers/media/radio/dsbr100.c +++ b/drivers/media/radio/dsbr100.c | |||
| @@ -390,7 +390,6 @@ static int usb_dsbr100_probe(struct usb_interface *intf, | |||
| 390 | radio->videodev.release = video_device_release_empty; | 390 | radio->videodev.release = video_device_release_empty; |
| 391 | radio->videodev.lock = &radio->v4l2_lock; | 391 | radio->videodev.lock = &radio->v4l2_lock; |
| 392 | radio->videodev.ctrl_handler = &radio->hdl; | 392 | radio->videodev.ctrl_handler = &radio->hdl; |
| 393 | set_bit(V4L2_FL_USE_FH_PRIO, &radio->videodev.flags); | ||
| 394 | 393 | ||
| 395 | radio->usbdev = interface_to_usbdev(intf); | 394 | radio->usbdev = interface_to_usbdev(intf); |
| 396 | radio->curfreq = FREQ_MIN * FREQ_MUL; | 395 | radio->curfreq = FREQ_MIN * FREQ_MUL; |
diff --git a/drivers/media/radio/radio-cadet.c b/drivers/media/radio/radio-cadet.c index d719e59e2179..82affaedf067 100644 --- a/drivers/media/radio/radio-cadet.c +++ b/drivers/media/radio/radio-cadet.c | |||
| @@ -650,7 +650,6 @@ static int __init cadet_init(void) | |||
| 650 | dev->vdev.ioctl_ops = &cadet_ioctl_ops; | 650 | dev->vdev.ioctl_ops = &cadet_ioctl_ops; |
| 651 | dev->vdev.release = video_device_release_empty; | 651 | dev->vdev.release = video_device_release_empty; |
| 652 | dev->vdev.lock = &dev->lock; | 652 | dev->vdev.lock = &dev->lock; |
| 653 | set_bit(V4L2_FL_USE_FH_PRIO, &dev->vdev.flags); | ||
| 654 | video_set_drvdata(&dev->vdev, dev); | 653 | video_set_drvdata(&dev->vdev, dev); |
| 655 | 654 | ||
| 656 | res = video_register_device(&dev->vdev, VFL_TYPE_RADIO, radio_nr); | 655 | res = video_register_device(&dev->vdev, VFL_TYPE_RADIO, radio_nr); |
diff --git a/drivers/media/radio/radio-isa.c b/drivers/media/radio/radio-isa.c index 6ff350831d56..c309ee45a08e 100644 --- a/drivers/media/radio/radio-isa.c +++ b/drivers/media/radio/radio-isa.c | |||
| @@ -253,7 +253,6 @@ static int radio_isa_common_probe(struct radio_isa_card *isa, | |||
| 253 | isa->vdev.fops = &radio_isa_fops; | 253 | isa->vdev.fops = &radio_isa_fops; |
| 254 | isa->vdev.ioctl_ops = &radio_isa_ioctl_ops; | 254 | isa->vdev.ioctl_ops = &radio_isa_ioctl_ops; |
| 255 | isa->vdev.release = video_device_release_empty; | 255 | isa->vdev.release = video_device_release_empty; |
| 256 | set_bit(V4L2_FL_USE_FH_PRIO, &isa->vdev.flags); | ||
| 257 | video_set_drvdata(&isa->vdev, isa); | 256 | video_set_drvdata(&isa->vdev, isa); |
| 258 | isa->freq = FREQ_LOW; | 257 | isa->freq = FREQ_LOW; |
| 259 | isa->stereo = drv->has_stereo; | 258 | isa->stereo = drv->has_stereo; |
diff --git a/drivers/media/radio/radio-keene.c b/drivers/media/radio/radio-keene.c index 3d127825eceb..0c5d2db3b828 100644 --- a/drivers/media/radio/radio-keene.c +++ b/drivers/media/radio/radio-keene.c | |||
| @@ -265,7 +265,7 @@ static int keene_s_ctrl(struct v4l2_ctrl *ctrl) | |||
| 265 | return keene_cmd_set(radio); | 265 | return keene_cmd_set(radio); |
| 266 | 266 | ||
| 267 | case V4L2_CID_AUDIO_COMPRESSION_GAIN: | 267 | case V4L2_CID_AUDIO_COMPRESSION_GAIN: |
| 268 | radio->tx = db2tx[(ctrl->val - ctrl->minimum) / ctrl->step]; | 268 | radio->tx = db2tx[(ctrl->val - (s32)ctrl->minimum) / (s32)ctrl->step]; |
| 269 | return keene_cmd_set(radio); | 269 | return keene_cmd_set(radio); |
| 270 | } | 270 | } |
| 271 | return -EINVAL; | 271 | return -EINVAL; |
| @@ -380,7 +380,6 @@ static int usb_keene_probe(struct usb_interface *intf, | |||
| 380 | usb_set_intfdata(intf, &radio->v4l2_dev); | 380 | usb_set_intfdata(intf, &radio->v4l2_dev); |
| 381 | 381 | ||
| 382 | video_set_drvdata(&radio->vdev, radio); | 382 | video_set_drvdata(&radio->vdev, radio); |
| 383 | set_bit(V4L2_FL_USE_FH_PRIO, &radio->vdev.flags); | ||
| 384 | 383 | ||
| 385 | /* at least 11ms is needed in order to settle hardware */ | 384 | /* at least 11ms is needed in order to settle hardware */ |
| 386 | msleep(20); | 385 | msleep(20); |
diff --git a/drivers/media/radio/radio-ma901.c b/drivers/media/radio/radio-ma901.c index a85b064cb7be..b3000ef85ee7 100644 --- a/drivers/media/radio/radio-ma901.c +++ b/drivers/media/radio/radio-ma901.c | |||
| @@ -411,7 +411,6 @@ static int usb_ma901radio_probe(struct usb_interface *intf, | |||
| 411 | radio->vdev.ioctl_ops = &usb_ma901radio_ioctl_ops; | 411 | radio->vdev.ioctl_ops = &usb_ma901radio_ioctl_ops; |
| 412 | radio->vdev.release = video_device_release_empty; | 412 | radio->vdev.release = video_device_release_empty; |
| 413 | radio->vdev.lock = &radio->lock; | 413 | radio->vdev.lock = &radio->lock; |
| 414 | set_bit(V4L2_FL_USE_FH_PRIO, &radio->vdev.flags); | ||
| 415 | 414 | ||
| 416 | radio->usbdev = interface_to_usbdev(intf); | 415 | radio->usbdev = interface_to_usbdev(intf); |
| 417 | radio->intf = intf; | 416 | radio->intf = intf; |
diff --git a/drivers/media/radio/radio-miropcm20.c b/drivers/media/radio/radio-miropcm20.c index a7e93d7477dd..998919e97dfe 100644 --- a/drivers/media/radio/radio-miropcm20.c +++ b/drivers/media/radio/radio-miropcm20.c | |||
| @@ -1,20 +1,35 @@ | |||
| 1 | /* Miro PCM20 radio driver for Linux radio support | 1 | /* |
| 2 | * Miro PCM20 radio driver for Linux radio support | ||
| 2 | * (c) 1998 Ruurd Reitsma <R.A.Reitsma@wbmt.tudelft.nl> | 3 | * (c) 1998 Ruurd Reitsma <R.A.Reitsma@wbmt.tudelft.nl> |
| 3 | * Thanks to Norberto Pellici for the ACI device interface specification | 4 | * Thanks to Norberto Pellici for the ACI device interface specification |
| 4 | * The API part is based on the radiotrack driver by M. Kirkwood | 5 | * The API part is based on the radiotrack driver by M. Kirkwood |
| 5 | * This driver relies on the aci mixer provided by the snd-miro | 6 | * This driver relies on the aci mixer provided by the snd-miro |
| 6 | * ALSA driver. | 7 | * ALSA driver. |
| 7 | * Look there for further info... | 8 | * Look there for further info... |
| 8 | */ | 9 | * |
| 9 | 10 | * From the original miro RDS sources: | |
| 10 | /* What ever you think about the ACI, version 0x07 is not very well! | 11 | * |
| 11 | * I can't get frequency, 'tuner status', 'tuner flags' or mute/mono | 12 | * (c) 2001 Robert Siemer <Robert.Siemer@gmx.de> |
| 12 | * conditions... Robert | 13 | * |
| 14 | * Many thanks to Fred Seidel <seidel@metabox.de>, the | ||
| 15 | * designer of the RDS decoder hardware. With his help | ||
| 16 | * I was able to code this driver. | ||
| 17 | * Thanks also to Norberto Pellicci, Dominic Mounteney | ||
| 18 | * <DMounteney@pinnaclesys.com> and www.teleauskunft.de | ||
| 19 | * for good hints on finding Fred. It was somewhat hard | ||
| 20 | * to locate him here in Germany... [: | ||
| 21 | * | ||
| 22 | * This code has been reintroduced and converted to use | ||
| 23 | * the new V4L2 RDS API by: | ||
| 24 | * | ||
| 25 | * Hans Verkuil <hans.verkuil@cisco.com> | ||
| 13 | */ | 26 | */ |
| 14 | 27 | ||
| 15 | #include <linux/module.h> | 28 | #include <linux/module.h> |
| 16 | #include <linux/init.h> | 29 | #include <linux/init.h> |
| 30 | #include <linux/delay.h> | ||
| 17 | #include <linux/videodev2.h> | 31 | #include <linux/videodev2.h> |
| 32 | #include <linux/kthread.h> | ||
| 18 | #include <media/v4l2-device.h> | 33 | #include <media/v4l2-device.h> |
| 19 | #include <media/v4l2-ioctl.h> | 34 | #include <media/v4l2-ioctl.h> |
| 20 | #include <media/v4l2-ctrls.h> | 35 | #include <media/v4l2-ctrls.h> |
| @@ -22,6 +37,22 @@ | |||
| 22 | #include <media/v4l2-event.h> | 37 | #include <media/v4l2-event.h> |
| 23 | #include <sound/aci.h> | 38 | #include <sound/aci.h> |
| 24 | 39 | ||
| 40 | #define RDS_DATASHIFT 2 /* Bit 2 */ | ||
| 41 | #define RDS_DATAMASK (1 << RDS_DATASHIFT) | ||
| 42 | #define RDS_BUSYMASK 0x10 /* Bit 4 */ | ||
| 43 | #define RDS_CLOCKMASK 0x08 /* Bit 3 */ | ||
| 44 | #define RDS_DATA(x) (((x) >> RDS_DATASHIFT) & 1) | ||
| 45 | |||
| 46 | #define RDS_STATUS 0x01 | ||
| 47 | #define RDS_STATIONNAME 0x02 | ||
| 48 | #define RDS_TEXT 0x03 | ||
| 49 | #define RDS_ALTFREQ 0x04 | ||
| 50 | #define RDS_TIMEDATE 0x05 | ||
| 51 | #define RDS_PI_CODE 0x06 | ||
| 52 | #define RDS_PTYTATP 0x07 | ||
| 53 | #define RDS_RESET 0x08 | ||
| 54 | #define RDS_RXVALUE 0x09 | ||
| 55 | |||
| 25 | static int radio_nr = -1; | 56 | static int radio_nr = -1; |
| 26 | module_param(radio_nr, int, 0); | 57 | module_param(radio_nr, int, 0); |
| 27 | MODULE_PARM_DESC(radio_nr, "Set radio device number (/dev/radioX). Default: -1 (autodetect)"); | 58 | MODULE_PARM_DESC(radio_nr, "Set radio device number (/dev/radioX). Default: -1 (autodetect)"); |
| @@ -30,6 +61,14 @@ struct pcm20 { | |||
| 30 | struct v4l2_device v4l2_dev; | 61 | struct v4l2_device v4l2_dev; |
| 31 | struct video_device vdev; | 62 | struct video_device vdev; |
| 32 | struct v4l2_ctrl_handler ctrl_handler; | 63 | struct v4l2_ctrl_handler ctrl_handler; |
| 64 | struct v4l2_ctrl *rds_pty; | ||
| 65 | struct v4l2_ctrl *rds_ps_name; | ||
| 66 | struct v4l2_ctrl *rds_radio_test; | ||
| 67 | struct v4l2_ctrl *rds_ta; | ||
| 68 | struct v4l2_ctrl *rds_tp; | ||
| 69 | struct v4l2_ctrl *rds_ms; | ||
| 70 | /* thread for periodic RDS status checking */ | ||
| 71 | struct task_struct *kthread; | ||
| 33 | unsigned long freq; | 72 | unsigned long freq; |
| 34 | u32 audmode; | 73 | u32 audmode; |
| 35 | struct snd_miro_aci *aci; | 74 | struct snd_miro_aci *aci; |
| @@ -41,6 +80,103 @@ static struct pcm20 pcm20_card = { | |||
| 41 | .audmode = V4L2_TUNER_MODE_STEREO, | 80 | .audmode = V4L2_TUNER_MODE_STEREO, |
| 42 | }; | 81 | }; |
| 43 | 82 | ||
| 83 | |||
| 84 | static int rds_waitread(struct snd_miro_aci *aci) | ||
| 85 | { | ||
| 86 | u8 byte; | ||
| 87 | int i = 2000; | ||
| 88 | |||
| 89 | do { | ||
| 90 | byte = inb(aci->aci_port + ACI_REG_RDS); | ||
| 91 | i--; | ||
| 92 | } while ((byte & RDS_BUSYMASK) && i); | ||
| 93 | |||
| 94 | /* | ||
| 95 | * It's magic, but without this the data that you read later on | ||
| 96 | * is unreliable and full of bit errors. With this 1 usec delay | ||
| 97 | * everything is fine. | ||
| 98 | */ | ||
| 99 | udelay(1); | ||
| 100 | return i ? byte : -1; | ||
| 101 | } | ||
| 102 | |||
| 103 | static int rds_rawwrite(struct snd_miro_aci *aci, u8 byte) | ||
| 104 | { | ||
| 105 | if (rds_waitread(aci) >= 0) { | ||
| 106 | outb(byte, aci->aci_port + ACI_REG_RDS); | ||
| 107 | return 0; | ||
| 108 | } | ||
| 109 | return -1; | ||
| 110 | } | ||
| 111 | |||
| 112 | static int rds_write(struct snd_miro_aci *aci, u8 byte) | ||
| 113 | { | ||
| 114 | u8 sendbuffer[8]; | ||
| 115 | int i; | ||
| 116 | |||
| 117 | for (i = 7; i >= 0; i--) | ||
| 118 | sendbuffer[7 - i] = (byte & (1 << i)) ? RDS_DATAMASK : 0; | ||
| 119 | sendbuffer[0] |= RDS_CLOCKMASK; | ||
| 120 | |||
| 121 | for (i = 0; i < 8; i++) | ||
| 122 | rds_rawwrite(aci, sendbuffer[i]); | ||
| 123 | return 0; | ||
| 124 | } | ||
| 125 | |||
| 126 | static int rds_readcycle_nowait(struct snd_miro_aci *aci) | ||
| 127 | { | ||
| 128 | outb(0, aci->aci_port + ACI_REG_RDS); | ||
| 129 | return rds_waitread(aci); | ||
| 130 | } | ||
| 131 | |||
| 132 | static int rds_readcycle(struct snd_miro_aci *aci) | ||
| 133 | { | ||
| 134 | if (rds_rawwrite(aci, 0) < 0) | ||
| 135 | return -1; | ||
| 136 | return rds_waitread(aci); | ||
| 137 | } | ||
| 138 | |||
| 139 | static int rds_ack(struct snd_miro_aci *aci) | ||
| 140 | { | ||
| 141 | int i = rds_readcycle(aci); | ||
| 142 | |||
| 143 | if (i < 0) | ||
| 144 | return -1; | ||
| 145 | if (i & RDS_DATAMASK) | ||
| 146 | return 0; /* ACK */ | ||
| 147 | return 1; /* NACK */ | ||
| 148 | } | ||
| 149 | |||
| 150 | static int rds_cmd(struct snd_miro_aci *aci, u8 cmd, u8 databuffer[], u8 datasize) | ||
| 151 | { | ||
| 152 | int i, j; | ||
| 153 | |||
| 154 | rds_write(aci, cmd); | ||
| 155 | |||
| 156 | /* RDS_RESET doesn't need further processing */ | ||
| 157 | if (cmd == RDS_RESET) | ||
| 158 | return 0; | ||
| 159 | if (rds_ack(aci)) | ||
| 160 | return -EIO; | ||
| 161 | if (datasize == 0) | ||
| 162 | return 0; | ||
| 163 | |||
| 164 | /* to be able to use rds_readcycle_nowait() | ||
| 165 | I have to waitread() here */ | ||
| 166 | if (rds_waitread(aci) < 0) | ||
| 167 | return -1; | ||
| 168 | |||
| 169 | memset(databuffer, 0, datasize); | ||
| 170 | |||
| 171 | for (i = 0; i < 8 * datasize; i++) { | ||
| 172 | j = rds_readcycle_nowait(aci); | ||
| 173 | if (j < 0) | ||
| 174 | return -EIO; | ||
| 175 | databuffer[i / 8] |= RDS_DATA(j) << (7 - (i % 8)); | ||
| 176 | } | ||
| 177 | return 0; | ||
| 178 | } | ||
| 179 | |||
| 44 | static int pcm20_setfreq(struct pcm20 *dev, unsigned long freq) | 180 | static int pcm20_setfreq(struct pcm20 *dev, unsigned long freq) |
| 45 | { | 181 | { |
| 46 | unsigned char freql; | 182 | unsigned char freql; |
| @@ -54,17 +190,10 @@ static int pcm20_setfreq(struct pcm20 *dev, unsigned long freq) | |||
| 54 | freql = freq & 0xff; | 190 | freql = freq & 0xff; |
| 55 | freqh = freq >> 8; | 191 | freqh = freq >> 8; |
| 56 | 192 | ||
| 193 | rds_cmd(aci, RDS_RESET, NULL, 0); | ||
| 57 | return snd_aci_cmd(aci, ACI_WRITE_TUNE, freql, freqh); | 194 | return snd_aci_cmd(aci, ACI_WRITE_TUNE, freql, freqh); |
| 58 | } | 195 | } |
| 59 | 196 | ||
| 60 | static const struct v4l2_file_operations pcm20_fops = { | ||
| 61 | .owner = THIS_MODULE, | ||
| 62 | .open = v4l2_fh_open, | ||
| 63 | .poll = v4l2_ctrl_poll, | ||
| 64 | .release = v4l2_fh_release, | ||
| 65 | .unlocked_ioctl = video_ioctl2, | ||
| 66 | }; | ||
| 67 | |||
| 68 | static int vidioc_querycap(struct file *file, void *priv, | 197 | static int vidioc_querycap(struct file *file, void *priv, |
| 69 | struct v4l2_capability *v) | 198 | struct v4l2_capability *v) |
| 70 | { | 199 | { |
| @@ -73,16 +202,31 @@ static int vidioc_querycap(struct file *file, void *priv, | |||
| 73 | strlcpy(v->driver, "Miro PCM20", sizeof(v->driver)); | 202 | strlcpy(v->driver, "Miro PCM20", sizeof(v->driver)); |
| 74 | strlcpy(v->card, "Miro PCM20", sizeof(v->card)); | 203 | strlcpy(v->card, "Miro PCM20", sizeof(v->card)); |
| 75 | snprintf(v->bus_info, sizeof(v->bus_info), "ISA:%s", dev->v4l2_dev.name); | 204 | snprintf(v->bus_info, sizeof(v->bus_info), "ISA:%s", dev->v4l2_dev.name); |
| 76 | v->device_caps = V4L2_CAP_TUNER | V4L2_CAP_RADIO; | 205 | v->device_caps = V4L2_CAP_TUNER | V4L2_CAP_RADIO | V4L2_CAP_RDS_CAPTURE; |
| 77 | v->capabilities = v->device_caps | V4L2_CAP_DEVICE_CAPS; | 206 | v->capabilities = v->device_caps | V4L2_CAP_DEVICE_CAPS; |
| 78 | return 0; | 207 | return 0; |
| 79 | } | 208 | } |
| 80 | 209 | ||
| 210 | static bool sanitize(char *p, int size) | ||
| 211 | { | ||
| 212 | int i; | ||
| 213 | bool ret = true; | ||
| 214 | |||
| 215 | for (i = 0; i < size; i++) { | ||
| 216 | if (p[i] < 32) { | ||
| 217 | p[i] = ' '; | ||
| 218 | ret = false; | ||
| 219 | } | ||
| 220 | } | ||
| 221 | return ret; | ||
| 222 | } | ||
| 223 | |||
| 81 | static int vidioc_g_tuner(struct file *file, void *priv, | 224 | static int vidioc_g_tuner(struct file *file, void *priv, |
| 82 | struct v4l2_tuner *v) | 225 | struct v4l2_tuner *v) |
| 83 | { | 226 | { |
| 84 | struct pcm20 *dev = video_drvdata(file); | 227 | struct pcm20 *dev = video_drvdata(file); |
| 85 | int res; | 228 | int res; |
| 229 | u8 buf; | ||
| 86 | 230 | ||
| 87 | if (v->index) | 231 | if (v->index) |
| 88 | return -EINVAL; | 232 | return -EINVAL; |
| @@ -97,8 +241,12 @@ static int vidioc_g_tuner(struct file *file, void *priv, | |||
| 97 | res = snd_aci_cmd(dev->aci, ACI_READ_TUNERSTEREO, -1, -1); | 241 | res = snd_aci_cmd(dev->aci, ACI_READ_TUNERSTEREO, -1, -1); |
| 98 | v->rxsubchans = (res & 0x40) ? V4L2_TUNER_SUB_MONO : | 242 | v->rxsubchans = (res & 0x40) ? V4L2_TUNER_SUB_MONO : |
| 99 | V4L2_TUNER_SUB_STEREO; | 243 | V4L2_TUNER_SUB_STEREO; |
| 100 | v->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO; | 244 | v->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO | |
| 245 | V4L2_TUNER_CAP_RDS | V4L2_TUNER_CAP_RDS_CONTROLS; | ||
| 101 | v->audmode = dev->audmode; | 246 | v->audmode = dev->audmode; |
| 247 | res = rds_cmd(dev->aci, RDS_RXVALUE, &buf, 1); | ||
| 248 | if (res >= 0 && buf) | ||
| 249 | v->rxsubchans |= V4L2_TUNER_SUB_RDS; | ||
| 102 | return 0; | 250 | return 0; |
| 103 | } | 251 | } |
| 104 | 252 | ||
| @@ -157,6 +305,115 @@ static int pcm20_s_ctrl(struct v4l2_ctrl *ctrl) | |||
| 157 | return -EINVAL; | 305 | return -EINVAL; |
| 158 | } | 306 | } |
| 159 | 307 | ||
| 308 | static int pcm20_thread(void *data) | ||
| 309 | { | ||
| 310 | struct pcm20 *dev = data; | ||
| 311 | const unsigned no_rds_start_counter = 5; | ||
| 312 | const unsigned sleep_msecs = 2000; | ||
| 313 | unsigned no_rds_counter = no_rds_start_counter; | ||
| 314 | |||
| 315 | for (;;) { | ||
| 316 | char text_buffer[66]; | ||
| 317 | u8 buf; | ||
| 318 | int res; | ||
| 319 | |||
| 320 | msleep_interruptible(sleep_msecs); | ||
| 321 | |||
| 322 | if (kthread_should_stop()) | ||
| 323 | break; | ||
| 324 | |||
| 325 | res = rds_cmd(dev->aci, RDS_RXVALUE, &buf, 1); | ||
| 326 | if (res) | ||
| 327 | continue; | ||
| 328 | if (buf == 0) { | ||
| 329 | if (no_rds_counter == 0) | ||
| 330 | continue; | ||
| 331 | no_rds_counter--; | ||
| 332 | if (no_rds_counter) | ||
| 333 | continue; | ||
| 334 | |||
| 335 | /* | ||
| 336 | * No RDS seen for no_rds_start_counter * sleep_msecs | ||
| 337 | * milliseconds, clear all RDS controls to their | ||
| 338 | * default values. | ||
| 339 | */ | ||
| 340 | v4l2_ctrl_s_ctrl_string(dev->rds_ps_name, ""); | ||
| 341 | v4l2_ctrl_s_ctrl(dev->rds_ms, 1); | ||
| 342 | v4l2_ctrl_s_ctrl(dev->rds_ta, 0); | ||
| 343 | v4l2_ctrl_s_ctrl(dev->rds_tp, 0); | ||
| 344 | v4l2_ctrl_s_ctrl(dev->rds_pty, 0); | ||
| 345 | v4l2_ctrl_s_ctrl_string(dev->rds_radio_test, ""); | ||
| 346 | continue; | ||
| 347 | } | ||
| 348 | no_rds_counter = no_rds_start_counter; | ||
| 349 | |||
| 350 | res = rds_cmd(dev->aci, RDS_STATUS, &buf, 1); | ||
| 351 | if (res) | ||
| 352 | continue; | ||
| 353 | if ((buf >> 3) & 1) { | ||
| 354 | res = rds_cmd(dev->aci, RDS_STATIONNAME, text_buffer, 8); | ||
| 355 | text_buffer[8] = 0; | ||
| 356 | if (!res && sanitize(text_buffer, 8)) | ||
| 357 | v4l2_ctrl_s_ctrl_string(dev->rds_ps_name, text_buffer); | ||
| 358 | } | ||
| 359 | if ((buf >> 6) & 1) { | ||
| 360 | u8 pty; | ||
| 361 | |||
| 362 | res = rds_cmd(dev->aci, RDS_PTYTATP, &pty, 1); | ||
| 363 | if (!res) { | ||
| 364 | v4l2_ctrl_s_ctrl(dev->rds_ms, !!(pty & 0x01)); | ||
| 365 | v4l2_ctrl_s_ctrl(dev->rds_ta, !!(pty & 0x02)); | ||
| 366 | v4l2_ctrl_s_ctrl(dev->rds_tp, !!(pty & 0x80)); | ||
| 367 | v4l2_ctrl_s_ctrl(dev->rds_pty, (pty >> 2) & 0x1f); | ||
| 368 | } | ||
| 369 | } | ||
| 370 | if ((buf >> 4) & 1) { | ||
| 371 | res = rds_cmd(dev->aci, RDS_TEXT, text_buffer, 65); | ||
| 372 | text_buffer[65] = 0; | ||
| 373 | if (!res && sanitize(text_buffer + 1, 64)) | ||
| 374 | v4l2_ctrl_s_ctrl_string(dev->rds_radio_test, text_buffer + 1); | ||
| 375 | } | ||
| 376 | } | ||
| 377 | return 0; | ||
| 378 | } | ||
| 379 | |||
| 380 | static int pcm20_open(struct file *file) | ||
| 381 | { | ||
| 382 | struct pcm20 *dev = video_drvdata(file); | ||
| 383 | int res = v4l2_fh_open(file); | ||
| 384 | |||
| 385 | if (!res && v4l2_fh_is_singular_file(file) && | ||
| 386 | IS_ERR_OR_NULL(dev->kthread)) { | ||
| 387 | dev->kthread = kthread_run(pcm20_thread, dev, "%s", | ||
| 388 | dev->v4l2_dev.name); | ||
| 389 | if (IS_ERR(dev->kthread)) { | ||
| 390 | v4l2_err(&dev->v4l2_dev, "kernel_thread() failed\n"); | ||
| 391 | v4l2_fh_release(file); | ||
| 392 | return PTR_ERR(dev->kthread); | ||
| 393 | } | ||
| 394 | } | ||
| 395 | return res; | ||
| 396 | } | ||
| 397 | |||
| 398 | static int pcm20_release(struct file *file) | ||
| 399 | { | ||
| 400 | struct pcm20 *dev = video_drvdata(file); | ||
| 401 | |||
| 402 | if (v4l2_fh_is_singular_file(file) && !IS_ERR_OR_NULL(dev->kthread)) { | ||
| 403 | kthread_stop(dev->kthread); | ||
| 404 | dev->kthread = NULL; | ||
| 405 | } | ||
| 406 | return v4l2_fh_release(file); | ||
| 407 | } | ||
| 408 | |||
| 409 | static const struct v4l2_file_operations pcm20_fops = { | ||
| 410 | .owner = THIS_MODULE, | ||
| 411 | .open = pcm20_open, | ||
| 412 | .poll = v4l2_ctrl_poll, | ||
| 413 | .release = pcm20_release, | ||
| 414 | .unlocked_ioctl = video_ioctl2, | ||
| 415 | }; | ||
| 416 | |||
| 160 | static const struct v4l2_ioctl_ops pcm20_ioctl_ops = { | 417 | static const struct v4l2_ioctl_ops pcm20_ioctl_ops = { |
| 161 | .vidioc_querycap = vidioc_querycap, | 418 | .vidioc_querycap = vidioc_querycap, |
| 162 | .vidioc_g_tuner = vidioc_g_tuner, | 419 | .vidioc_g_tuner = vidioc_g_tuner, |
| @@ -195,9 +452,21 @@ static int __init pcm20_init(void) | |||
| 195 | } | 452 | } |
| 196 | 453 | ||
| 197 | hdl = &dev->ctrl_handler; | 454 | hdl = &dev->ctrl_handler; |
| 198 | v4l2_ctrl_handler_init(hdl, 1); | 455 | v4l2_ctrl_handler_init(hdl, 7); |
| 199 | v4l2_ctrl_new_std(hdl, &pcm20_ctrl_ops, | 456 | v4l2_ctrl_new_std(hdl, &pcm20_ctrl_ops, |
| 200 | V4L2_CID_AUDIO_MUTE, 0, 1, 1, 1); | 457 | V4L2_CID_AUDIO_MUTE, 0, 1, 1, 1); |
| 458 | dev->rds_pty = v4l2_ctrl_new_std(hdl, NULL, | ||
| 459 | V4L2_CID_RDS_RX_PTY, 0, 0x1f, 1, 0); | ||
| 460 | dev->rds_ps_name = v4l2_ctrl_new_std(hdl, NULL, | ||
| 461 | V4L2_CID_RDS_RX_PS_NAME, 0, 8, 8, 0); | ||
| 462 | dev->rds_radio_test = v4l2_ctrl_new_std(hdl, NULL, | ||
| 463 | V4L2_CID_RDS_RX_RADIO_TEXT, 0, 64, 64, 0); | ||
| 464 | dev->rds_ta = v4l2_ctrl_new_std(hdl, NULL, | ||
| 465 | V4L2_CID_RDS_RX_TRAFFIC_ANNOUNCEMENT, 0, 1, 1, 0); | ||
| 466 | dev->rds_tp = v4l2_ctrl_new_std(hdl, NULL, | ||
| 467 | V4L2_CID_RDS_RX_TRAFFIC_PROGRAM, 0, 1, 1, 0); | ||
| 468 | dev->rds_ms = v4l2_ctrl_new_std(hdl, NULL, | ||
| 469 | V4L2_CID_RDS_RX_MUSIC_SPEECH, 0, 1, 1, 1); | ||
| 201 | v4l2_dev->ctrl_handler = hdl; | 470 | v4l2_dev->ctrl_handler = hdl; |
| 202 | if (hdl->error) { | 471 | if (hdl->error) { |
| 203 | res = hdl->error; | 472 | res = hdl->error; |
| @@ -210,7 +479,6 @@ static int __init pcm20_init(void) | |||
| 210 | dev->vdev.ioctl_ops = &pcm20_ioctl_ops; | 479 | dev->vdev.ioctl_ops = &pcm20_ioctl_ops; |
| 211 | dev->vdev.release = video_device_release_empty; | 480 | dev->vdev.release = video_device_release_empty; |
| 212 | dev->vdev.lock = &dev->lock; | 481 | dev->vdev.lock = &dev->lock; |
| 213 | set_bit(V4L2_FL_USE_FH_PRIO, &dev->vdev.flags); | ||
| 214 | video_set_drvdata(&dev->vdev, dev); | 482 | video_set_drvdata(&dev->vdev, dev); |
| 215 | snd_aci_cmd(dev->aci, ACI_SET_TUNERMONO, | 483 | snd_aci_cmd(dev->aci, ACI_SET_TUNERMONO, |
| 216 | dev->audmode == V4L2_TUNER_MODE_MONO, -1); | 484 | dev->audmode == V4L2_TUNER_MODE_MONO, -1); |
diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c index a360227ca3ab..c2927fd12615 100644 --- a/drivers/media/radio/radio-mr800.c +++ b/drivers/media/radio/radio-mr800.c | |||
| @@ -32,7 +32,7 @@ | |||
| 32 | * achievements (specifications given). | 32 | * achievements (specifications given). |
| 33 | * Also, Faidon Liambotis <paravoid@debian.org> wrote nice driver for this radio | 33 | * Also, Faidon Liambotis <paravoid@debian.org> wrote nice driver for this radio |
| 34 | * in 2007. He allowed to use his driver to improve current mr800 radio driver. | 34 | * in 2007. He allowed to use his driver to improve current mr800 radio driver. |
| 35 | * http://kerneltrap.org/mailarchive/linux-usb-devel/2007/10/11/342492 | 35 | * http://www.spinics.net/lists/linux-usb-devel/msg10109.html |
| 36 | * | 36 | * |
| 37 | * Version 0.01: First working version. | 37 | * Version 0.01: First working version. |
| 38 | * It's required to blacklist AverMedia USB Radio | 38 | * It's required to blacklist AverMedia USB Radio |
| @@ -558,7 +558,6 @@ static int usb_amradio_probe(struct usb_interface *intf, | |||
| 558 | radio->vdev.ioctl_ops = &usb_amradio_ioctl_ops; | 558 | radio->vdev.ioctl_ops = &usb_amradio_ioctl_ops; |
| 559 | radio->vdev.release = video_device_release_empty; | 559 | radio->vdev.release = video_device_release_empty; |
| 560 | radio->vdev.lock = &radio->lock; | 560 | radio->vdev.lock = &radio->lock; |
| 561 | set_bit(V4L2_FL_USE_FH_PRIO, &radio->vdev.flags); | ||
| 562 | 561 | ||
| 563 | radio->usbdev = interface_to_usbdev(intf); | 562 | radio->usbdev = interface_to_usbdev(intf); |
| 564 | radio->intf = intf; | 563 | radio->intf = intf; |
diff --git a/drivers/media/radio/radio-raremono.c b/drivers/media/radio/radio-raremono.c index 7b3bdbb1be73..bfb3a6d051ba 100644 --- a/drivers/media/radio/radio-raremono.c +++ b/drivers/media/radio/radio-raremono.c | |||
| @@ -361,7 +361,6 @@ static int usb_raremono_probe(struct usb_interface *intf, | |||
| 361 | usb_set_intfdata(intf, &radio->v4l2_dev); | 361 | usb_set_intfdata(intf, &radio->v4l2_dev); |
| 362 | 362 | ||
| 363 | video_set_drvdata(&radio->vdev, radio); | 363 | video_set_drvdata(&radio->vdev, radio); |
| 364 | set_bit(V4L2_FL_USE_FH_PRIO, &radio->vdev.flags); | ||
| 365 | 364 | ||
| 366 | raremono_cmd_main(radio, BAND_FM, 95160); | 365 | raremono_cmd_main(radio, BAND_FM, 95160); |
| 367 | 366 | ||
diff --git a/drivers/media/radio/radio-sf16fmi.c b/drivers/media/radio/radio-sf16fmi.c index 6f4318ff0db3..d7ce8fe6b5ae 100644 --- a/drivers/media/radio/radio-sf16fmi.c +++ b/drivers/media/radio/radio-sf16fmi.c | |||
| @@ -344,7 +344,6 @@ static int __init fmi_init(void) | |||
| 344 | fmi->vdev.fops = &fmi_fops; | 344 | fmi->vdev.fops = &fmi_fops; |
| 345 | fmi->vdev.ioctl_ops = &fmi_ioctl_ops; | 345 | fmi->vdev.ioctl_ops = &fmi_ioctl_ops; |
| 346 | fmi->vdev.release = video_device_release_empty; | 346 | fmi->vdev.release = video_device_release_empty; |
| 347 | set_bit(V4L2_FL_USE_FH_PRIO, &fmi->vdev.flags); | ||
| 348 | video_set_drvdata(&fmi->vdev, fmi); | 347 | video_set_drvdata(&fmi->vdev, fmi); |
| 349 | 348 | ||
| 350 | mutex_init(&fmi->lock); | 349 | mutex_init(&fmi->lock); |
diff --git a/drivers/media/radio/radio-si476x.c b/drivers/media/radio/radio-si476x.c index 2fd9009f8663..633022b45f33 100644 --- a/drivers/media/radio/radio-si476x.c +++ b/drivers/media/radio/radio-si476x.c | |||
| @@ -1470,7 +1470,6 @@ static int si476x_radio_probe(struct platform_device *pdev) | |||
| 1470 | video_set_drvdata(&radio->videodev, radio); | 1470 | video_set_drvdata(&radio->videodev, radio); |
| 1471 | platform_set_drvdata(pdev, radio); | 1471 | platform_set_drvdata(pdev, radio); |
| 1472 | 1472 | ||
| 1473 | set_bit(V4L2_FL_USE_FH_PRIO, &radio->videodev.flags); | ||
| 1474 | 1473 | ||
| 1475 | radio->v4l2dev.ctrl_handler = &radio->ctrl_handler; | 1474 | radio->v4l2dev.ctrl_handler = &radio->ctrl_handler; |
| 1476 | v4l2_ctrl_handler_init(&radio->ctrl_handler, | 1475 | v4l2_ctrl_handler_init(&radio->ctrl_handler, |
diff --git a/drivers/media/radio/radio-tea5764.c b/drivers/media/radio/radio-tea5764.c index 3ed1f5669f79..925049654c5b 100644 --- a/drivers/media/radio/radio-tea5764.c +++ b/drivers/media/radio/radio-tea5764.c | |||
| @@ -478,7 +478,6 @@ static int tea5764_i2c_probe(struct i2c_client *client, | |||
| 478 | video_set_drvdata(&radio->vdev, radio); | 478 | video_set_drvdata(&radio->vdev, radio); |
| 479 | radio->vdev.lock = &radio->mutex; | 479 | radio->vdev.lock = &radio->mutex; |
| 480 | radio->vdev.v4l2_dev = v4l2_dev; | 480 | radio->vdev.v4l2_dev = v4l2_dev; |
| 481 | set_bit(V4L2_FL_USE_FH_PRIO, &radio->vdev.flags); | ||
| 482 | 481 | ||
| 483 | /* initialize and power off the chip */ | 482 | /* initialize and power off the chip */ |
| 484 | tea5764_i2c_read(radio); | 483 | tea5764_i2c_read(radio); |
diff --git a/drivers/media/radio/radio-tea5777.c b/drivers/media/radio/radio-tea5777.c index e2455970725a..83fe7ab358df 100644 --- a/drivers/media/radio/radio-tea5777.c +++ b/drivers/media/radio/radio-tea5777.c | |||
| @@ -570,7 +570,6 @@ int radio_tea5777_init(struct radio_tea5777 *tea, struct module *owner) | |||
| 570 | tea->fops = tea575x_fops; | 570 | tea->fops = tea575x_fops; |
| 571 | tea->fops.owner = owner; | 571 | tea->fops.owner = owner; |
| 572 | tea->vd.fops = &tea->fops; | 572 | tea->vd.fops = &tea->fops; |
| 573 | set_bit(V4L2_FL_USE_FH_PRIO, &tea->vd.flags); | ||
| 574 | 573 | ||
| 575 | tea->vd.ctrl_handler = &tea->ctrl_handler; | 574 | tea->vd.ctrl_handler = &tea->ctrl_handler; |
| 576 | v4l2_ctrl_handler_init(&tea->ctrl_handler, 1); | 575 | v4l2_ctrl_handler_init(&tea->ctrl_handler, 1); |
diff --git a/drivers/media/radio/radio-timb.c b/drivers/media/radio/radio-timb.c index 0817964d9172..b9285e6584af 100644 --- a/drivers/media/radio/radio-timb.c +++ b/drivers/media/radio/radio-timb.c | |||
| @@ -126,7 +126,6 @@ static int timbradio_probe(struct platform_device *pdev) | |||
| 126 | tr->video_dev.release = video_device_release_empty; | 126 | tr->video_dev.release = video_device_release_empty; |
| 127 | tr->video_dev.minor = -1; | 127 | tr->video_dev.minor = -1; |
| 128 | tr->video_dev.lock = &tr->lock; | 128 | tr->video_dev.lock = &tr->lock; |
| 129 | set_bit(V4L2_FL_USE_FH_PRIO, &tr->video_dev.flags); | ||
| 130 | 129 | ||
| 131 | strlcpy(tr->v4l2_dev.name, DRIVER_NAME, sizeof(tr->v4l2_dev.name)); | 130 | strlcpy(tr->v4l2_dev.name, DRIVER_NAME, sizeof(tr->v4l2_dev.name)); |
| 132 | err = v4l2_device_register(NULL, &tr->v4l2_dev); | 131 | err = v4l2_device_register(NULL, &tr->v4l2_dev); |
diff --git a/drivers/media/radio/si470x/radio-si470x-usb.c b/drivers/media/radio/si470x/radio-si470x-usb.c index 07ef40595efd..494fac061306 100644 --- a/drivers/media/radio/si470x/radio-si470x-usb.c +++ b/drivers/media/radio/si470x/radio-si470x-usb.c | |||
| @@ -680,7 +680,6 @@ static int si470x_usb_driver_probe(struct usb_interface *intf, | |||
| 680 | radio->videodev.lock = &radio->lock; | 680 | radio->videodev.lock = &radio->lock; |
| 681 | radio->videodev.v4l2_dev = &radio->v4l2_dev; | 681 | radio->videodev.v4l2_dev = &radio->v4l2_dev; |
| 682 | radio->videodev.release = video_device_release_empty; | 682 | radio->videodev.release = video_device_release_empty; |
| 683 | set_bit(V4L2_FL_USE_FH_PRIO, &radio->videodev.flags); | ||
| 684 | video_set_drvdata(&radio->videodev, radio); | 683 | video_set_drvdata(&radio->videodev, radio); |
| 685 | 684 | ||
| 686 | /* get device and chip versions */ | 685 | /* get device and chip versions */ |
diff --git a/drivers/media/radio/si4713/radio-platform-si4713.c b/drivers/media/radio/si4713/radio-platform-si4713.c index ba4cfc946868..a47502a330f0 100644 --- a/drivers/media/radio/si4713/radio-platform-si4713.c +++ b/drivers/media/radio/si4713/radio-platform-si4713.c | |||
| @@ -196,7 +196,6 @@ static int radio_si4713_pdriver_probe(struct platform_device *pdev) | |||
| 196 | rsdev->radio_dev = radio_si4713_vdev_template; | 196 | rsdev->radio_dev = radio_si4713_vdev_template; |
| 197 | rsdev->radio_dev.v4l2_dev = &rsdev->v4l2_dev; | 197 | rsdev->radio_dev.v4l2_dev = &rsdev->v4l2_dev; |
| 198 | rsdev->radio_dev.ctrl_handler = sd->ctrl_handler; | 198 | rsdev->radio_dev.ctrl_handler = sd->ctrl_handler; |
| 199 | set_bit(V4L2_FL_USE_FH_PRIO, &rsdev->radio_dev.flags); | ||
| 200 | /* Serialize all access to the si4713 */ | 199 | /* Serialize all access to the si4713 */ |
| 201 | rsdev->radio_dev.lock = &rsdev->lock; | 200 | rsdev->radio_dev.lock = &rsdev->lock; |
| 202 | video_set_drvdata(&rsdev->radio_dev, rsdev); | 201 | video_set_drvdata(&rsdev->radio_dev, rsdev); |
diff --git a/drivers/media/radio/si4713/radio-usb-si4713.c b/drivers/media/radio/si4713/radio-usb-si4713.c index 86502b2786d0..a77319dcba05 100644 --- a/drivers/media/radio/si4713/radio-usb-si4713.c +++ b/drivers/media/radio/si4713/radio-usb-si4713.c | |||
| @@ -492,7 +492,6 @@ static int usb_si4713_probe(struct usb_interface *intf, | |||
| 492 | radio->vdev.vfl_dir = VFL_DIR_TX; | 492 | radio->vdev.vfl_dir = VFL_DIR_TX; |
| 493 | 493 | ||
| 494 | video_set_drvdata(&radio->vdev, radio); | 494 | video_set_drvdata(&radio->vdev, radio); |
| 495 | set_bit(V4L2_FL_USE_FH_PRIO, &radio->vdev.flags); | ||
| 496 | 495 | ||
| 497 | retval = video_register_device(&radio->vdev, VFL_TYPE_RADIO, -1); | 496 | retval = video_register_device(&radio->vdev, VFL_TYPE_RADIO, -1); |
| 498 | if (retval < 0) { | 497 | if (retval < 0) { |
diff --git a/drivers/media/radio/si4713/si4713.c b/drivers/media/radio/si4713/si4713.c index 07d5153811e8..b5765557ea3d 100644 --- a/drivers/media/radio/si4713/si4713.c +++ b/drivers/media/radio/si4713/si4713.c | |||
| @@ -957,6 +957,41 @@ static int si4713_choose_econtrol_action(struct si4713_device *sdev, u32 id, | |||
| 957 | *bit = 5; | 957 | *bit = 5; |
| 958 | *mask = 0x1F << 5; | 958 | *mask = 0x1F << 5; |
| 959 | break; | 959 | break; |
| 960 | case V4L2_CID_RDS_TX_DYNAMIC_PTY: | ||
| 961 | *property = SI4713_TX_RDS_PS_MISC; | ||
| 962 | *bit = 15; | ||
| 963 | *mask = 1 << 15; | ||
| 964 | break; | ||
| 965 | case V4L2_CID_RDS_TX_COMPRESSED: | ||
| 966 | *property = SI4713_TX_RDS_PS_MISC; | ||
| 967 | *bit = 14; | ||
| 968 | *mask = 1 << 14; | ||
| 969 | break; | ||
| 970 | case V4L2_CID_RDS_TX_ARTIFICIAL_HEAD: | ||
| 971 | *property = SI4713_TX_RDS_PS_MISC; | ||
| 972 | *bit = 13; | ||
| 973 | *mask = 1 << 13; | ||
| 974 | break; | ||
| 975 | case V4L2_CID_RDS_TX_MONO_STEREO: | ||
| 976 | *property = SI4713_TX_RDS_PS_MISC; | ||
| 977 | *bit = 12; | ||
| 978 | *mask = 1 << 12; | ||
| 979 | break; | ||
| 980 | case V4L2_CID_RDS_TX_TRAFFIC_PROGRAM: | ||
| 981 | *property = SI4713_TX_RDS_PS_MISC; | ||
| 982 | *bit = 10; | ||
| 983 | *mask = 1 << 10; | ||
| 984 | break; | ||
| 985 | case V4L2_CID_RDS_TX_TRAFFIC_ANNOUNCEMENT: | ||
| 986 | *property = SI4713_TX_RDS_PS_MISC; | ||
| 987 | *bit = 4; | ||
| 988 | *mask = 1 << 4; | ||
| 989 | break; | ||
| 990 | case V4L2_CID_RDS_TX_MUSIC_SPEECH: | ||
| 991 | *property = SI4713_TX_RDS_PS_MISC; | ||
| 992 | *bit = 3; | ||
| 993 | *mask = 1 << 3; | ||
| 994 | break; | ||
| 960 | case V4L2_CID_AUDIO_LIMITER_ENABLED: | 995 | case V4L2_CID_AUDIO_LIMITER_ENABLED: |
| 961 | *property = SI4713_TX_ACOMP_ENABLE; | 996 | *property = SI4713_TX_ACOMP_ENABLE; |
| 962 | *bit = 1; | 997 | *bit = 1; |
| @@ -1098,11 +1133,11 @@ static int si4713_s_ctrl(struct v4l2_ctrl *ctrl) | |||
| 1098 | 1133 | ||
| 1099 | switch (ctrl->id) { | 1134 | switch (ctrl->id) { |
| 1100 | case V4L2_CID_RDS_TX_PS_NAME: | 1135 | case V4L2_CID_RDS_TX_PS_NAME: |
| 1101 | ret = si4713_set_rds_ps_name(sdev, ctrl->string); | 1136 | ret = si4713_set_rds_ps_name(sdev, ctrl->p_new.p_char); |
| 1102 | break; | 1137 | break; |
| 1103 | 1138 | ||
| 1104 | case V4L2_CID_RDS_TX_RADIO_TEXT: | 1139 | case V4L2_CID_RDS_TX_RADIO_TEXT: |
| 1105 | ret = si4713_set_rds_radio_text(sdev, ctrl->string); | 1140 | ret = si4713_set_rds_radio_text(sdev, ctrl->p_new.p_char); |
| 1106 | break; | 1141 | break; |
| 1107 | 1142 | ||
| 1108 | case V4L2_CID_TUNE_ANTENNA_CAPACITOR: | 1143 | case V4L2_CID_TUNE_ANTENNA_CAPACITOR: |
| @@ -1122,6 +1157,17 @@ static int si4713_s_ctrl(struct v4l2_ctrl *ctrl) | |||
| 1122 | } | 1157 | } |
| 1123 | break; | 1158 | break; |
| 1124 | 1159 | ||
| 1160 | case V4L2_CID_RDS_TX_ALT_FREQS_ENABLE: | ||
| 1161 | case V4L2_CID_RDS_TX_ALT_FREQS: | ||
| 1162 | if (sdev->rds_alt_freqs_enable->val) { | ||
| 1163 | val = sdev->rds_alt_freqs->p_new.p_u32[0]; | ||
| 1164 | val = val / 100 - 876 + 0xe101; | ||
| 1165 | } else { | ||
| 1166 | val = 0xe0e0; | ||
| 1167 | } | ||
| 1168 | ret = si4713_write_property(sdev, SI4713_TX_RDS_PS_AF, val); | ||
| 1169 | break; | ||
| 1170 | |||
| 1125 | default: | 1171 | default: |
| 1126 | ret = si4713_choose_econtrol_action(sdev, ctrl->id, &bit, | 1172 | ret = si4713_choose_econtrol_action(sdev, ctrl->id, &bit, |
| 1127 | &mask, &property, &mul, &table, &size); | 1173 | &mask, &property, &mul, &table, &size); |
| @@ -1355,6 +1401,17 @@ static const struct v4l2_subdev_ops si4713_subdev_ops = { | |||
| 1355 | .tuner = &si4713_subdev_tuner_ops, | 1401 | .tuner = &si4713_subdev_tuner_ops, |
| 1356 | }; | 1402 | }; |
| 1357 | 1403 | ||
| 1404 | static const struct v4l2_ctrl_config si4713_alt_freqs_ctrl = { | ||
| 1405 | .id = V4L2_CID_RDS_TX_ALT_FREQS, | ||
| 1406 | .type = V4L2_CTRL_TYPE_U32, | ||
| 1407 | .min = 87600, | ||
| 1408 | .max = 107900, | ||
| 1409 | .step = 100, | ||
| 1410 | .def = 87600, | ||
| 1411 | .dims = { 1 }, | ||
| 1412 | .elem_size = sizeof(u32), | ||
| 1413 | }; | ||
| 1414 | |||
| 1358 | /* | 1415 | /* |
| 1359 | * I2C driver interface | 1416 | * I2C driver interface |
| 1360 | */ | 1417 | */ |
| @@ -1410,6 +1467,23 @@ static int si4713_probe(struct i2c_client *client, | |||
| 1410 | V4L2_CID_RDS_TX_PI, 0, 0xffff, 1, DEFAULT_RDS_PI); | 1467 | V4L2_CID_RDS_TX_PI, 0, 0xffff, 1, DEFAULT_RDS_PI); |
| 1411 | sdev->rds_pty = v4l2_ctrl_new_std(hdl, &si4713_ctrl_ops, | 1468 | sdev->rds_pty = v4l2_ctrl_new_std(hdl, &si4713_ctrl_ops, |
| 1412 | V4L2_CID_RDS_TX_PTY, 0, 31, 1, DEFAULT_RDS_PTY); | 1469 | V4L2_CID_RDS_TX_PTY, 0, 31, 1, DEFAULT_RDS_PTY); |
| 1470 | sdev->rds_compressed = v4l2_ctrl_new_std(hdl, &si4713_ctrl_ops, | ||
| 1471 | V4L2_CID_RDS_TX_COMPRESSED, 0, 1, 1, 0); | ||
| 1472 | sdev->rds_art_head = v4l2_ctrl_new_std(hdl, &si4713_ctrl_ops, | ||
| 1473 | V4L2_CID_RDS_TX_ARTIFICIAL_HEAD, 0, 1, 1, 0); | ||
| 1474 | sdev->rds_stereo = v4l2_ctrl_new_std(hdl, &si4713_ctrl_ops, | ||
| 1475 | V4L2_CID_RDS_TX_MONO_STEREO, 0, 1, 1, 1); | ||
| 1476 | sdev->rds_tp = v4l2_ctrl_new_std(hdl, &si4713_ctrl_ops, | ||
| 1477 | V4L2_CID_RDS_TX_TRAFFIC_PROGRAM, 0, 1, 1, 0); | ||
| 1478 | sdev->rds_ta = v4l2_ctrl_new_std(hdl, &si4713_ctrl_ops, | ||
| 1479 | V4L2_CID_RDS_TX_TRAFFIC_ANNOUNCEMENT, 0, 1, 1, 0); | ||
| 1480 | sdev->rds_ms = v4l2_ctrl_new_std(hdl, &si4713_ctrl_ops, | ||
| 1481 | V4L2_CID_RDS_TX_MUSIC_SPEECH, 0, 1, 1, 1); | ||
| 1482 | sdev->rds_dyn_pty = v4l2_ctrl_new_std(hdl, &si4713_ctrl_ops, | ||
| 1483 | V4L2_CID_RDS_TX_DYNAMIC_PTY, 0, 1, 1, 0); | ||
| 1484 | sdev->rds_alt_freqs_enable = v4l2_ctrl_new_std(hdl, &si4713_ctrl_ops, | ||
| 1485 | V4L2_CID_RDS_TX_ALT_FREQS_ENABLE, 0, 1, 1, 0); | ||
| 1486 | sdev->rds_alt_freqs = v4l2_ctrl_new_custom(hdl, &si4713_alt_freqs_ctrl, NULL); | ||
| 1413 | sdev->rds_deviation = v4l2_ctrl_new_std(hdl, &si4713_ctrl_ops, | 1487 | sdev->rds_deviation = v4l2_ctrl_new_std(hdl, &si4713_ctrl_ops, |
| 1414 | V4L2_CID_RDS_TX_DEVIATION, 0, MAX_RDS_DEVIATION, | 1488 | V4L2_CID_RDS_TX_DEVIATION, 0, MAX_RDS_DEVIATION, |
| 1415 | 10, DEFAULT_RDS_DEVIATION); | 1489 | 10, DEFAULT_RDS_DEVIATION); |
| @@ -1476,7 +1550,7 @@ static int si4713_probe(struct i2c_client *client, | |||
| 1476 | rval = hdl->error; | 1550 | rval = hdl->error; |
| 1477 | goto free_ctrls; | 1551 | goto free_ctrls; |
| 1478 | } | 1552 | } |
| 1479 | v4l2_ctrl_cluster(20, &sdev->mute); | 1553 | v4l2_ctrl_cluster(29, &sdev->mute); |
| 1480 | sdev->sd.ctrl_handler = hdl; | 1554 | sdev->sd.ctrl_handler = hdl; |
| 1481 | 1555 | ||
| 1482 | if (client->irq) { | 1556 | if (client->irq) { |
diff --git a/drivers/media/radio/si4713/si4713.h b/drivers/media/radio/si4713/si4713.h index 4837cf6e0e1b..ed700e387605 100644 --- a/drivers/media/radio/si4713/si4713.h +++ b/drivers/media/radio/si4713/si4713.h | |||
| @@ -211,6 +211,15 @@ struct si4713_device { | |||
| 211 | struct v4l2_ctrl *rds_pi; | 211 | struct v4l2_ctrl *rds_pi; |
| 212 | struct v4l2_ctrl *rds_deviation; | 212 | struct v4l2_ctrl *rds_deviation; |
| 213 | struct v4l2_ctrl *rds_pty; | 213 | struct v4l2_ctrl *rds_pty; |
| 214 | struct v4l2_ctrl *rds_compressed; | ||
| 215 | struct v4l2_ctrl *rds_art_head; | ||
| 216 | struct v4l2_ctrl *rds_stereo; | ||
| 217 | struct v4l2_ctrl *rds_ta; | ||
| 218 | struct v4l2_ctrl *rds_tp; | ||
| 219 | struct v4l2_ctrl *rds_ms; | ||
| 220 | struct v4l2_ctrl *rds_dyn_pty; | ||
| 221 | struct v4l2_ctrl *rds_alt_freqs_enable; | ||
| 222 | struct v4l2_ctrl *rds_alt_freqs; | ||
| 214 | struct v4l2_ctrl *compression_enabled; | 223 | struct v4l2_ctrl *compression_enabled; |
| 215 | struct v4l2_ctrl *compression_threshold; | 224 | struct v4l2_ctrl *compression_threshold; |
| 216 | struct v4l2_ctrl *compression_gain; | 225 | struct v4l2_ctrl *compression_gain; |
diff --git a/drivers/media/radio/tea575x.c b/drivers/media/radio/tea575x.c index 7c14060a40b8..f1a0867789fe 100644 --- a/drivers/media/radio/tea575x.c +++ b/drivers/media/radio/tea575x.c | |||
| @@ -523,7 +523,6 @@ int snd_tea575x_init(struct snd_tea575x *tea, struct module *owner) | |||
| 523 | tea->fops = tea575x_fops; | 523 | tea->fops = tea575x_fops; |
| 524 | tea->fops.owner = owner; | 524 | tea->fops.owner = owner; |
| 525 | tea->vd.fops = &tea->fops; | 525 | tea->vd.fops = &tea->fops; |
| 526 | set_bit(V4L2_FL_USE_FH_PRIO, &tea->vd.flags); | ||
| 527 | /* disable hw_freq_seek if we can't use it */ | 526 | /* disable hw_freq_seek if we can't use it */ |
| 528 | if (tea->cannot_read_data) | 527 | if (tea->cannot_read_data) |
| 529 | v4l2_disable_ioctl(&tea->vd, VIDIOC_S_HW_FREQ_SEEK); | 528 | v4l2_disable_ioctl(&tea->vd, VIDIOC_S_HW_FREQ_SEEK); |
