Lines Matching full:isa

3  * Framework for ISA radio drivers.
4 * This takes care of all the V4L2 scaffolding, allowing the ISA drivers
23 #include "radio-isa.h"
26 MODULE_DESCRIPTION("A framework for ISA radio drivers.");
35 struct radio_isa_card *isa = video_drvdata(file); in radio_isa_querycap() local
37 strscpy(v->driver, isa->drv->driver.driver.name, sizeof(v->driver)); in radio_isa_querycap()
38 strscpy(v->card, isa->drv->card, sizeof(v->card)); in radio_isa_querycap()
39 snprintf(v->bus_info, sizeof(v->bus_info), "ISA:%s", dev_name(isa->v4l2_dev.dev)); in radio_isa_querycap()
46 struct radio_isa_card *isa = video_drvdata(file); in radio_isa_g_tuner() local
47 const struct radio_isa_ops *ops = isa->drv->ops; in radio_isa_g_tuner()
57 if (isa->drv->has_stereo) in radio_isa_g_tuner()
61 v->rxsubchans = ops->g_rxsubchans(isa); in radio_isa_g_tuner()
64 v->audmode = isa->stereo ? V4L2_TUNER_MODE_STEREO : V4L2_TUNER_MODE_MONO; in radio_isa_g_tuner()
66 v->signal = ops->g_signal(isa); in radio_isa_g_tuner()
76 struct radio_isa_card *isa = video_drvdata(file); in radio_isa_s_tuner() local
77 const struct radio_isa_ops *ops = isa->drv->ops; in radio_isa_s_tuner()
82 isa->stereo = (v->audmode == V4L2_TUNER_MODE_STEREO); in radio_isa_s_tuner()
83 return ops->s_stereo(isa, isa->stereo); in radio_isa_s_tuner()
91 struct radio_isa_card *isa = video_drvdata(file); in radio_isa_s_frequency() local
98 res = isa->drv->ops->s_frequency(isa, freq); in radio_isa_s_frequency()
100 isa->freq = freq; in radio_isa_s_frequency()
107 struct radio_isa_card *isa = video_drvdata(file); in radio_isa_g_frequency() local
112 f->frequency = isa->freq; in radio_isa_g_frequency()
118 struct radio_isa_card *isa = in radio_isa_s_ctrl() local
123 return isa->drv->ops->s_mute_volume(isa, ctrl->val, in radio_isa_s_ctrl()
124 isa->volume ? isa->volume->val : 0); in radio_isa_s_ctrl()
131 struct radio_isa_card *isa = video_drvdata(file); in radio_isa_log_status() local
133 v4l2_info(&isa->v4l2_dev, "I/O Port = 0x%03x\n", isa->io); in radio_isa_log_status()
134 v4l2_ctrl_handler_log_status(&isa->hdl, isa->v4l2_dev.name); in radio_isa_log_status()
183 struct radio_isa_card *isa = drv->ops->alloc(); in radio_isa_alloc() local
184 if (!isa) in radio_isa_alloc()
187 dev_set_drvdata(pdev, isa); in radio_isa_alloc()
188 isa->drv = drv; in radio_isa_alloc()
189 v4l2_dev = &isa->v4l2_dev; in radio_isa_alloc()
192 return isa; in radio_isa_alloc()
195 static int radio_isa_common_probe(struct radio_isa_card *isa, in radio_isa_common_probe() argument
199 const struct radio_isa_driver *drv = isa->drv; in radio_isa_common_probe()
201 struct v4l2_device *v4l2_dev = &isa->v4l2_dev; in radio_isa_common_probe()
204 if (!request_region(isa->io, region_size, v4l2_dev->name)) { in radio_isa_common_probe()
205 v4l2_err(v4l2_dev, "port 0x%x already in use\n", isa->io); in radio_isa_common_probe()
206 kfree(isa); in radio_isa_common_probe()
216 v4l2_ctrl_handler_init(&isa->hdl, 1); in radio_isa_common_probe()
217 isa->mute = v4l2_ctrl_new_std(&isa->hdl, &radio_isa_ctrl_ops, in radio_isa_common_probe()
220 isa->volume = v4l2_ctrl_new_std(&isa->hdl, &radio_isa_ctrl_ops, in radio_isa_common_probe()
223 v4l2_dev->ctrl_handler = &isa->hdl; in radio_isa_common_probe()
224 if (isa->hdl.error) { in radio_isa_common_probe()
225 res = isa->hdl.error; in radio_isa_common_probe()
230 v4l2_ctrl_cluster(2, &isa->mute); in radio_isa_common_probe()
231 v4l2_dev->ctrl_handler = &isa->hdl; in radio_isa_common_probe()
233 mutex_init(&isa->lock); in radio_isa_common_probe()
234 isa->vdev.lock = &isa->lock; in radio_isa_common_probe()
235 strscpy(isa->vdev.name, v4l2_dev->name, sizeof(isa->vdev.name)); in radio_isa_common_probe()
236 isa->vdev.v4l2_dev = v4l2_dev; in radio_isa_common_probe()
237 isa->vdev.fops = &radio_isa_fops; in radio_isa_common_probe()
238 isa->vdev.ioctl_ops = &radio_isa_ioctl_ops; in radio_isa_common_probe()
239 isa->vdev.release = video_device_release_empty; in radio_isa_common_probe()
240 isa->vdev.device_caps = V4L2_CAP_TUNER | V4L2_CAP_RADIO; in radio_isa_common_probe()
241 video_set_drvdata(&isa->vdev, isa); in radio_isa_common_probe()
242 isa->freq = FREQ_LOW; in radio_isa_common_probe()
243 isa->stereo = drv->has_stereo; in radio_isa_common_probe()
246 res = ops->init(isa); in radio_isa_common_probe()
248 res = v4l2_ctrl_handler_setup(&isa->hdl); in radio_isa_common_probe()
250 res = ops->s_frequency(isa, isa->freq); in radio_isa_common_probe()
252 res = ops->s_stereo(isa, isa->stereo); in radio_isa_common_probe()
257 res = video_register_device(&isa->vdev, VFL_TYPE_RADIO, radio_nr); in radio_isa_common_probe()
265 drv->card, isa->io); in radio_isa_common_probe()
269 v4l2_ctrl_handler_free(&isa->hdl); in radio_isa_common_probe()
271 release_region(isa->io, region_size); in radio_isa_common_probe()
272 kfree(isa); in radio_isa_common_probe()
276 static void radio_isa_common_remove(struct radio_isa_card *isa, in radio_isa_common_remove() argument
279 const struct radio_isa_ops *ops = isa->drv->ops; in radio_isa_common_remove()
281 ops->s_mute_volume(isa, true, isa->volume ? isa->volume->cur.val : 0); in radio_isa_common_remove()
282 video_unregister_device(&isa->vdev); in radio_isa_common_remove()
283 v4l2_ctrl_handler_free(&isa->hdl); in radio_isa_common_remove()
284 v4l2_device_unregister(&isa->v4l2_dev); in radio_isa_common_remove()
285 release_region(isa->io, region_size); in radio_isa_common_remove()
286 v4l2_info(&isa->v4l2_dev, "Removed radio card %s\n", isa->drv->card); in radio_isa_common_remove()
287 kfree(isa); in radio_isa_common_remove()
295 struct radio_isa_card *isa; in radio_isa_probe() local
297 isa = radio_isa_alloc(drv, pdev); in radio_isa_probe()
298 if (!isa) in radio_isa_probe()
300 isa->io = drv->io_params[dev]; in radio_isa_probe()
301 v4l2_dev = &isa->v4l2_dev; in radio_isa_probe()
310 bool found = ops->probe(isa, io); in radio_isa_probe()
314 isa->io = io; in radio_isa_probe()
321 if (!radio_isa_valid_io(drv, isa->io)) { in radio_isa_probe()
324 if (isa->io < 0) in radio_isa_probe()
331 kfree(isa); in radio_isa_probe()
335 return radio_isa_common_probe(isa, pdev, drv->radio_nr_params[dev], in radio_isa_probe()
342 struct radio_isa_card *isa = dev_get_drvdata(pdev); in radio_isa_remove() local
344 radio_isa_common_remove(isa, isa->drv->region_size); in radio_isa_remove()
354 struct radio_isa_card *isa; in radio_isa_pnp_probe() local
359 isa = radio_isa_alloc(drv, &dev->dev); in radio_isa_pnp_probe()
360 if (!isa) in radio_isa_pnp_probe()
363 isa->io = pnp_port_start(dev, 0); in radio_isa_pnp_probe()
365 return radio_isa_common_probe(isa, &dev->dev, drv->radio_nr_params[0], in radio_isa_pnp_probe()
372 struct radio_isa_card *isa = dev_get_drvdata(&dev->dev); in radio_isa_pnp_remove() local
374 radio_isa_common_remove(isa, pnp_port_len(dev, 0)); in radio_isa_pnp_remove()