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