Lines Matching refs:isa
36 #include "radio-isa.h"
48 struct radio_isa_card *isa = video_drvdata(file);
50 strlcpy(v->driver, isa->drv->driver.driver.name, sizeof(v->driver));
51 strlcpy(v->card, isa->drv->card, sizeof(v->card));
52 snprintf(v->bus_info, sizeof(v->bus_info), "ISA:%s", isa->v4l2_dev.name);
62 struct radio_isa_card *isa = video_drvdata(file);
63 const struct radio_isa_ops *ops = isa->drv->ops;
73 if (isa->drv->has_stereo)
77 v->rxsubchans = ops->g_rxsubchans(isa);
80 v->audmode = isa->stereo ? V4L2_TUNER_MODE_STEREO : V4L2_TUNER_MODE_MONO;
82 v->signal = ops->g_signal(isa);
92 struct radio_isa_card *isa = video_drvdata(file);
93 const struct radio_isa_ops *ops = isa->drv->ops;
98 isa->stereo = (v->audmode == V4L2_TUNER_MODE_STEREO);
99 return ops->s_stereo(isa, isa->stereo);
107 struct radio_isa_card *isa = video_drvdata(file);
114 res = isa->drv->ops->s_frequency(isa, freq);
116 isa->freq = freq;
123 struct radio_isa_card *isa = video_drvdata(file);
128 f->frequency = isa->freq;
134 struct radio_isa_card *isa =
139 return isa->drv->ops->s_mute_volume(isa, ctrl->val,
140 isa->volume ? isa->volume->val : 0);
147 struct radio_isa_card *isa = video_drvdata(file);
149 v4l2_info(&isa->v4l2_dev, "I/O Port = 0x%03x\n", isa->io);
150 v4l2_ctrl_handler_log_status(&isa->hdl, isa->v4l2_dev.name);
199 struct radio_isa_card *isa = drv->ops->alloc();
200 if (!isa)
203 dev_set_drvdata(pdev, isa);
204 isa->drv = drv;
205 v4l2_dev = &isa->v4l2_dev;
208 return isa;
211 static int radio_isa_common_probe(struct radio_isa_card *isa,
215 const struct radio_isa_driver *drv = isa->drv;
217 struct v4l2_device *v4l2_dev = &isa->v4l2_dev;
220 if (!request_region(isa->io, region_size, v4l2_dev->name)) {
221 v4l2_err(v4l2_dev, "port 0x%x already in use\n", isa->io);
222 kfree(isa);
232 v4l2_ctrl_handler_init(&isa->hdl, 1);
233 isa->mute = v4l2_ctrl_new_std(&isa->hdl, &radio_isa_ctrl_ops,
236 isa->volume = v4l2_ctrl_new_std(&isa->hdl, &radio_isa_ctrl_ops,
239 v4l2_dev->ctrl_handler = &isa->hdl;
240 if (isa->hdl.error) {
241 res = isa->hdl.error;
246 v4l2_ctrl_cluster(2, &isa->mute);
247 v4l2_dev->ctrl_handler = &isa->hdl;
249 mutex_init(&isa->lock);
250 isa->vdev.lock = &isa->lock;
251 strlcpy(isa->vdev.name, v4l2_dev->name, sizeof(isa->vdev.name));
252 isa->vdev.v4l2_dev = v4l2_dev;
253 isa->vdev.fops = &radio_isa_fops;
254 isa->vdev.ioctl_ops = &radio_isa_ioctl_ops;
255 isa->vdev.release = video_device_release_empty;
256 video_set_drvdata(&isa->vdev, isa);
257 isa->freq = FREQ_LOW;
258 isa->stereo = drv->has_stereo;
261 res = ops->init(isa);
263 res = v4l2_ctrl_handler_setup(&isa->hdl);
265 res = ops->s_frequency(isa, isa->freq);
267 res = ops->s_stereo(isa, isa->stereo);
272 res = video_register_device(&isa->vdev, VFL_TYPE_RADIO, radio_nr);
280 drv->card, isa->io);
284 v4l2_ctrl_handler_free(&isa->hdl);
286 release_region(isa->io, region_size);
287 kfree(isa);
291 static int radio_isa_common_remove(struct radio_isa_card *isa,
294 const struct radio_isa_ops *ops = isa->drv->ops;
296 ops->s_mute_volume(isa, true, isa->volume ? isa->volume->cur.val : 0);
297 video_unregister_device(&isa->vdev);
298 v4l2_ctrl_handler_free(&isa->hdl);
299 v4l2_device_unregister(&isa->v4l2_dev);
300 release_region(isa->io, region_size);
301 v4l2_info(&isa->v4l2_dev, "Removed radio card %s\n", isa->drv->card);
302 kfree(isa);
311 struct radio_isa_card *isa;
313 isa = radio_isa_alloc(drv, pdev);
314 if (!isa)
316 isa->io = drv->io_params[dev];
317 v4l2_dev = &isa->v4l2_dev;
326 bool found = ops->probe(isa, io);
330 isa->io = io;
337 if (!radio_isa_valid_io(drv, isa->io)) {
340 if (isa->io < 0)
347 kfree(isa);
351 return radio_isa_common_probe(isa, pdev, drv->radio_nr_params[dev],
358 struct radio_isa_card *isa = dev_get_drvdata(pdev);
360 return radio_isa_common_remove(isa, isa->drv->region_size);
370 struct radio_isa_card *isa;
375 isa = radio_isa_alloc(drv, &dev->dev);
376 if (!isa)
379 isa->io = pnp_port_start(dev, 0);
381 return radio_isa_common_probe(isa, &dev->dev, drv->radio_nr_params[0],
388 struct radio_isa_card *isa = dev_get_drvdata(&dev->dev);
390 radio_isa_common_remove(isa, pnp_port_len(dev, 0));