Lines Matching refs:dev

182 static int pcm20_setfreq(struct pcm20 *dev, unsigned long freq)  in pcm20_setfreq()  argument
186 struct snd_miro_aci *aci = dev->aci; in pcm20_setfreq()
202 struct pcm20 *dev = video_drvdata(file); in vidioc_querycap() local
206 snprintf(v->bus_info, sizeof(v->bus_info), "ISA:%s", dev->v4l2_dev.name); in vidioc_querycap()
227 struct pcm20 *dev = video_drvdata(file); in vidioc_g_tuner() local
237 res = snd_aci_cmd(dev->aci, ACI_READ_TUNERSTATION, -1, -1); in vidioc_g_tuner()
241 res = snd_aci_cmd(dev->aci, ACI_READ_TUNERSTEREO, -1, -1); in vidioc_g_tuner()
246 v->audmode = dev->audmode; in vidioc_g_tuner()
247 res = rds_cmd(dev->aci, RDS_RXVALUE, &buf, 1); in vidioc_g_tuner()
256 struct pcm20 *dev = video_drvdata(file); in vidioc_s_tuner() local
261 dev->audmode = V4L2_TUNER_MODE_STEREO; in vidioc_s_tuner()
263 dev->audmode = v->audmode; in vidioc_s_tuner()
264 snd_aci_cmd(dev->aci, ACI_SET_TUNERMONO, in vidioc_s_tuner()
265 dev->audmode == V4L2_TUNER_MODE_MONO, -1); in vidioc_s_tuner()
272 struct pcm20 *dev = video_drvdata(file); in vidioc_g_frequency() local
278 f->frequency = dev->freq; in vidioc_g_frequency()
286 struct pcm20 *dev = video_drvdata(file); in vidioc_s_frequency() local
291 dev->freq = clamp_t(u32, f->frequency, 87 * 16000U, 108 * 16000U); in vidioc_s_frequency()
292 pcm20_setfreq(dev, dev->freq); in vidioc_s_frequency()
298 struct pcm20 *dev = container_of(ctrl->handler, struct pcm20, ctrl_handler); in pcm20_s_ctrl() local
302 snd_aci_cmd(dev->aci, ACI_SET_TUNERMUTE, ctrl->val, -1); in pcm20_s_ctrl()
310 struct pcm20 *dev = data; in pcm20_thread() local
325 res = rds_cmd(dev->aci, RDS_RXVALUE, &buf, 1); in pcm20_thread()
340 v4l2_ctrl_s_ctrl_string(dev->rds_ps_name, ""); in pcm20_thread()
341 v4l2_ctrl_s_ctrl(dev->rds_ms, 1); in pcm20_thread()
342 v4l2_ctrl_s_ctrl(dev->rds_ta, 0); in pcm20_thread()
343 v4l2_ctrl_s_ctrl(dev->rds_tp, 0); in pcm20_thread()
344 v4l2_ctrl_s_ctrl(dev->rds_pty, 0); in pcm20_thread()
345 v4l2_ctrl_s_ctrl_string(dev->rds_radio_test, ""); in pcm20_thread()
350 res = rds_cmd(dev->aci, RDS_STATUS, &buf, 1); in pcm20_thread()
354 res = rds_cmd(dev->aci, RDS_STATIONNAME, text_buffer, 8); in pcm20_thread()
357 v4l2_ctrl_s_ctrl_string(dev->rds_ps_name, text_buffer); in pcm20_thread()
362 res = rds_cmd(dev->aci, RDS_PTYTATP, &pty, 1); in pcm20_thread()
364 v4l2_ctrl_s_ctrl(dev->rds_ms, !!(pty & 0x01)); in pcm20_thread()
365 v4l2_ctrl_s_ctrl(dev->rds_ta, !!(pty & 0x02)); in pcm20_thread()
366 v4l2_ctrl_s_ctrl(dev->rds_tp, !!(pty & 0x80)); in pcm20_thread()
367 v4l2_ctrl_s_ctrl(dev->rds_pty, (pty >> 2) & 0x1f); in pcm20_thread()
371 res = rds_cmd(dev->aci, RDS_TEXT, text_buffer, 65); in pcm20_thread()
374 v4l2_ctrl_s_ctrl_string(dev->rds_radio_test, text_buffer + 1); in pcm20_thread()
382 struct pcm20 *dev = video_drvdata(file); in pcm20_open() local
386 IS_ERR_OR_NULL(dev->kthread)) { in pcm20_open()
387 dev->kthread = kthread_run(pcm20_thread, dev, "%s", in pcm20_open()
388 dev->v4l2_dev.name); in pcm20_open()
389 if (IS_ERR(dev->kthread)) { in pcm20_open()
390 v4l2_err(&dev->v4l2_dev, "kernel_thread() failed\n"); in pcm20_open()
392 return PTR_ERR(dev->kthread); in pcm20_open()
400 struct pcm20 *dev = video_drvdata(file); in pcm20_release() local
402 if (v4l2_fh_is_singular_file(file) && !IS_ERR_OR_NULL(dev->kthread)) { in pcm20_release()
403 kthread_stop(dev->kthread); in pcm20_release()
404 dev->kthread = NULL; in pcm20_release()
434 struct pcm20 *dev = &pcm20_card; in pcm20_init() local
435 struct v4l2_device *v4l2_dev = &dev->v4l2_dev; in pcm20_init()
439 dev->aci = snd_aci_get_aci(); in pcm20_init()
440 if (dev->aci == NULL) { in pcm20_init()
446 mutex_init(&dev->lock); in pcm20_init()
454 hdl = &dev->ctrl_handler; in pcm20_init()
458 dev->rds_pty = v4l2_ctrl_new_std(hdl, NULL, in pcm20_init()
460 dev->rds_ps_name = v4l2_ctrl_new_std(hdl, NULL, in pcm20_init()
462 dev->rds_radio_test = v4l2_ctrl_new_std(hdl, NULL, in pcm20_init()
464 dev->rds_ta = v4l2_ctrl_new_std(hdl, NULL, in pcm20_init()
466 dev->rds_tp = v4l2_ctrl_new_std(hdl, NULL, in pcm20_init()
468 dev->rds_ms = v4l2_ctrl_new_std(hdl, NULL, in pcm20_init()
476 strscpy(dev->vdev.name, v4l2_dev->name, sizeof(dev->vdev.name)); in pcm20_init()
477 dev->vdev.v4l2_dev = v4l2_dev; in pcm20_init()
478 dev->vdev.fops = &pcm20_fops; in pcm20_init()
479 dev->vdev.ioctl_ops = &pcm20_ioctl_ops; in pcm20_init()
480 dev->vdev.release = video_device_release_empty; in pcm20_init()
481 dev->vdev.lock = &dev->lock; in pcm20_init()
482 dev->vdev.device_caps = V4L2_CAP_TUNER | V4L2_CAP_RADIO | in pcm20_init()
484 video_set_drvdata(&dev->vdev, dev); in pcm20_init()
485 snd_aci_cmd(dev->aci, ACI_SET_TUNERMONO, in pcm20_init()
486 dev->audmode == V4L2_TUNER_MODE_MONO, -1); in pcm20_init()
487 pcm20_setfreq(dev, dev->freq); in pcm20_init()
489 if (video_register_device(&dev->vdev, VFL_TYPE_RADIO, radio_nr) < 0) in pcm20_init()
506 struct pcm20 *dev = &pcm20_card; in pcm20_cleanup() local
508 video_unregister_device(&dev->vdev); in pcm20_cleanup()
509 snd_aci_cmd(dev->aci, ACI_SET_TUNERMUTE, 1, -1); in pcm20_cleanup()
510 v4l2_ctrl_handler_free(&dev->ctrl_handler); in pcm20_cleanup()
511 v4l2_device_unregister(&dev->v4l2_dev); in pcm20_cleanup()