23 #include <linux/module.h>
27 #include <linux/videodev2.h>
29 #include <linux/slab.h>
42 #define FREQ_LOW (87U * 16000U)
43 #define FREQ_HIGH (108U * 16000U)
45 static int radio_isa_querycap(
struct file *
file,
void *
priv,
59 static int radio_isa_g_tuner(
struct file *
file,
void *
priv,
73 if (isa->
drv->has_stereo)
89 static int radio_isa_s_tuner(
struct file *file,
void *priv,
104 static int radio_isa_s_frequency(
struct file *file,
void *priv,
119 static int radio_isa_g_frequency(
struct file *file,
void *priv,
138 return isa->
drv->ops->s_mute_volume(isa, ctrl->
val,
144 static int radio_isa_log_status(
struct file *file,
void *priv)
154 .s_ctrl = radio_isa_s_ctrl,
166 .vidioc_querycap = radio_isa_querycap,
167 .vidioc_g_tuner = radio_isa_g_tuner,
168 .vidioc_s_tuner = radio_isa_s_tuner,
169 .vidioc_g_frequency = radio_isa_g_frequency,
170 .vidioc_s_frequency = radio_isa_s_frequency,
171 .vidioc_log_status = radio_isa_log_status,
211 int radio_nr,
unsigned region_size)
219 v4l2_err(v4l2_dev,
"port 0x%x already in use\n", isa->
io);
226 v4l2_err(v4l2_dev,
"Could not register v4l2_device\n");
238 if (isa->
hdl.error) {
239 res = isa->
hdl.error;
240 v4l2_err(v4l2_dev,
"Could not register controls\n");
250 isa->
vdev.v4l2_dev = v4l2_dev;
251 isa->
vdev.fops = &radio_isa_fops;
252 isa->
vdev.ioctl_ops = &radio_isa_ioctl_ops;
255 video_set_drvdata(&isa->
vdev, isa);
260 res = ops->
init(isa);
268 v4l2_err(v4l2_dev,
"Could not setup card\n");
274 v4l2_err(v4l2_dev,
"Could not register device node\n");
278 v4l2_info(v4l2_dev,
"Initialized radio card %s on port 0x%03x\n",
324 bool found = ops->
probe(isa, io);
335 if (!radio_isa_valid_io(drv, isa->
io)) {
340 v4l2_err(v4l2_dev,
"you must set an I/O address with io=0x%03x",
370 if (!pnp_port_valid(dev, 0))
377 isa->
io = pnp_port_start(dev, 0);
380 pnp_port_len(dev, 0));
384 void radio_isa_pnp_remove(
struct pnp_dev *dev)