15 #include <linux/module.h>
17 #include <linux/videodev2.h>
22 static int radio_nr = -1;
24 MODULE_PARM_DESC(radio_nr,
"Set radio device number (/dev/radioX). Default: -1 (autodetect)");
39 static struct pcm20 pcm20_card = {
44 static int pcm20_mute(
struct pcm20 *
dev,
unsigned char mute)
50 static int pcm20_stereo(
struct pcm20 *
dev,
unsigned char stereo)
55 static int pcm20_setfreq(
struct pcm20 *
dev,
unsigned long freq)
70 pcm20_stereo(dev, !mono);
79 static int vidioc_querycap(
struct file *
file,
void *
priv,
106 static int vidioc_s_tuner(
struct file *file,
void *priv,
112 static int vidioc_g_frequency(
struct file *file,
void *priv,
115 struct pcm20 *dev = video_drvdata(file);
126 static int vidioc_s_frequency(
struct file *file,
void *priv,
129 struct pcm20 *dev = video_drvdata(file);
139 static int vidioc_queryctrl(
struct file *file,
void *priv,
149 static int vidioc_g_ctrl(
struct file *file,
void *priv,
152 struct pcm20 *dev = video_drvdata(file);
164 static int vidioc_s_ctrl(
struct file *file,
void *priv,
167 struct pcm20 *dev = video_drvdata(file);
171 pcm20_mute(dev, ctrl->
value);
179 static int vidioc_g_input(
struct file *filp,
void *priv,
unsigned int *
i)
185 static int vidioc_s_input(
struct file *filp,
void *priv,
unsigned int i)
190 static int vidioc_g_audio(
struct file *file,
void *priv,
199 static int vidioc_s_audio(
struct file *file,
void *priv,
220 static int __init pcm20_init(
void)
222 struct pcm20 *dev = &pcm20_card;
229 "you must load the snd-miro driver first!\n");
237 v4l2_err(v4l2_dev,
"could not register v4l2_device\n");
242 dev->
vdev.v4l2_dev = v4l2_dev;
243 dev->
vdev.fops = &pcm20_fops;
244 dev->
vdev.ioctl_ops = &pcm20_ioctl_ops;
247 video_set_drvdata(&dev->
vdev, dev);
252 v4l2_info(v4l2_dev,
"Mirosound PCM20 Radio tuner\n");
263 static void __exit pcm20_cleanup(
void)
265 struct pcm20 *dev = &pcm20_card;