Lines Matching refs:fmdev

46 	struct fmdev *fmdev;  in fm_v4l2_fops_read()  local
48 fmdev = video_drvdata(file); in fm_v4l2_fops_read()
55 if (mutex_lock_interruptible(&fmdev->mutex)) in fm_v4l2_fops_read()
59 ret = fm_rx_get_rds_mode(fmdev, &rds_mode); in fm_v4l2_fops_read()
66 ret = fmc_set_rds_mode(fmdev, FM_RDS_ENABLE); in fm_v4l2_fops_read()
74 ret = fmc_transfer_rds_from_internal_buff(fmdev, file, buf, count); in fm_v4l2_fops_read()
76 mutex_unlock(&fmdev->mutex); in fm_v4l2_fops_read()
86 struct fmdev *fmdev; in fm_v4l2_fops_write() local
95 fmdev = video_drvdata(file); in fm_v4l2_fops_write()
96 if (mutex_lock_interruptible(&fmdev->mutex)) in fm_v4l2_fops_write()
98 fm_tx_set_radio_text(fmdev, rds.text, rds.text_type); in fm_v4l2_fops_write()
99 fm_tx_set_af(fmdev, rds.af_freq); in fm_v4l2_fops_write()
100 mutex_unlock(&fmdev->mutex); in fm_v4l2_fops_write()
108 struct fmdev *fmdev; in fm_v4l2_fops_poll() local
110 fmdev = video_drvdata(file); in fm_v4l2_fops_poll()
111 mutex_lock(&fmdev->mutex); in fm_v4l2_fops_poll()
112 ret = fmc_is_rds_data_available(fmdev, file, pts); in fm_v4l2_fops_poll()
113 mutex_unlock(&fmdev->mutex); in fm_v4l2_fops_poll()
127 struct fmdev *fmdev = NULL; in fm_v4l2_fops_open() local
135 fmdev = video_drvdata(file); in fm_v4l2_fops_open()
137 if (mutex_lock_interruptible(&fmdev->mutex)) in fm_v4l2_fops_open()
139 ret = fmc_prepare(fmdev); in fm_v4l2_fops_open()
147 ret = fmc_set_mode(fmdev, FM_MODE_RX); in fm_v4l2_fops_open()
155 mutex_unlock(&fmdev->mutex); in fm_v4l2_fops_open()
162 struct fmdev *fmdev; in fm_v4l2_fops_release() local
164 fmdev = video_drvdata(file); in fm_v4l2_fops_release()
170 mutex_lock(&fmdev->mutex); in fm_v4l2_fops_release()
171 ret = fmc_set_mode(fmdev, FM_MODE_OFF); in fm_v4l2_fops_release()
177 ret = fmc_release(fmdev); in fm_v4l2_fops_release()
185 mutex_unlock(&fmdev->mutex); in fm_v4l2_fops_release()
209 struct fmdev *fmdev = container_of(ctrl->handler, in fm_g_volatile_ctrl() local
210 struct fmdev, ctrl_handler); in fm_g_volatile_ctrl()
214 ctrl->val = fm_tx_get_tune_cap_val(fmdev); in fm_g_volatile_ctrl()
226 struct fmdev *fmdev = container_of(ctrl->handler, in fm_v4l2_s_ctrl() local
227 struct fmdev, ctrl_handler); in fm_v4l2_s_ctrl()
231 return fm_rx_set_volume(fmdev, (u16)ctrl->val); in fm_v4l2_s_ctrl()
234 return fmc_set_mute_mode(fmdev, (u8)ctrl->val); in fm_v4l2_s_ctrl()
238 return fm_tx_set_pwr_lvl(fmdev, (u8)ctrl->val); in fm_v4l2_s_ctrl()
241 return fm_tx_set_preemph_filter(fmdev, (u8) ctrl->val); in fm_v4l2_s_ctrl()
271 struct fmdev *fmdev = video_drvdata(file); in fm_v4l2_vidioc_g_tuner() local
281 if (fmdev->curr_fmmode != FM_MODE_RX) in fm_v4l2_vidioc_g_tuner()
284 ret = fm_rx_get_band_freq_range(fmdev, &bottom_freq, &top_freq); in fm_v4l2_vidioc_g_tuner()
288 ret = fm_rx_get_stereo_mono(fmdev, &stereo_mono_mode); in fm_v4l2_vidioc_g_tuner()
292 ret = fm_rx_get_rssi_level(fmdev, &rssilvl); in fm_v4l2_vidioc_g_tuner()
302 ((fmdev->rx.rds.flag == FM_RDS_ENABLE) ? V4L2_TUNER_SUB_RDS : 0); in fm_v4l2_vidioc_g_tuner()
334 struct fmdev *fmdev = video_drvdata(file); in fm_v4l2_vidioc_s_tuner() local
347 if (fmdev->curr_fmmode != FM_MODE_RX) { in fm_v4l2_vidioc_s_tuner()
348 ret = fmc_set_mode(fmdev, FM_MODE_RX); in fm_v4l2_vidioc_s_tuner()
355 ret = fmc_set_stereo_mono(fmdev, aud_mode); in fm_v4l2_vidioc_s_tuner()
361 ret = fmc_set_rds_mode(fmdev, rds_mode); in fm_v4l2_vidioc_s_tuner()
372 struct fmdev *fmdev = video_drvdata(file); in fm_v4l2_vidioc_g_freq() local
375 ret = fmc_get_freq(fmdev, &freq->frequency); in fm_v4l2_vidioc_g_freq()
391 struct fmdev *fmdev = video_drvdata(file); in fm_v4l2_vidioc_s_freq() local
397 return fmc_set_freq(fmdev, freq->frequency / 16); in fm_v4l2_vidioc_s_freq()
404 struct fmdev *fmdev = video_drvdata(file); in fm_v4l2_vidioc_s_hw_freq_seek() local
410 if (fmdev->curr_fmmode != FM_MODE_RX) { in fm_v4l2_vidioc_s_hw_freq_seek()
411 ret = fmc_set_mode(fmdev, FM_MODE_RX); in fm_v4l2_vidioc_s_hw_freq_seek()
418 ret = fm_rx_seek(fmdev, seek->seek_upward, seek->wrap_around, in fm_v4l2_vidioc_s_hw_freq_seek()
429 struct fmdev *fmdev = video_drvdata(file); in fm_v4l2_vidioc_g_modulator() local
434 if (fmdev->curr_fmmode != FM_MODE_TX) in fm_v4l2_vidioc_g_modulator()
437 mod->txsubchans = ((fmdev->tx_data.aud_mode == FM_STEREO_MODE) ? in fm_v4l2_vidioc_g_modulator()
439 ((fmdev->tx_data.rds.flag == FM_RDS_ENABLE) ? in fm_v4l2_vidioc_g_modulator()
452 struct fmdev *fmdev = video_drvdata(file); in fm_v4l2_vidioc_s_modulator() local
460 if (fmdev->curr_fmmode != FM_MODE_TX) { in fm_v4l2_vidioc_s_modulator()
461 ret = fmc_set_mode(fmdev, FM_MODE_TX); in fm_v4l2_vidioc_s_modulator()
472 ret = fm_tx_set_stereo_mono(fmdev, aud_mode); in fm_v4l2_vidioc_s_modulator()
477 ret = fm_tx_set_rds_mode(fmdev, rds_mode); in fm_v4l2_vidioc_s_modulator()
529 int fm_v4l2_init_video_device(struct fmdev *fmdev, int radio_nr) in fm_v4l2_init_video_device() argument
534 strlcpy(fmdev->v4l2_dev.name, FM_DRV_NAME, sizeof(fmdev->v4l2_dev.name)); in fm_v4l2_init_video_device()
535 ret = v4l2_device_register(NULL, &fmdev->v4l2_dev); in fm_v4l2_init_video_device()
540 mutex_init(&fmdev->mutex); in fm_v4l2_init_video_device()
545 video_set_drvdata(&gradio_dev, fmdev); in fm_v4l2_init_video_device()
547 gradio_dev.lock = &fmdev->mutex; in fm_v4l2_init_video_device()
548 gradio_dev.v4l2_dev = &fmdev->v4l2_dev; in fm_v4l2_init_video_device()
556 fmdev->radio_dev = &gradio_dev; in fm_v4l2_init_video_device()
559 fmdev->radio_dev->ctrl_handler = &fmdev->ctrl_handler; in fm_v4l2_init_video_device()
561 ret = v4l2_ctrl_handler_init(&fmdev->ctrl_handler, 5); in fm_v4l2_init_video_device()
564 v4l2_ctrl_handler_free(&fmdev->ctrl_handler); in fm_v4l2_init_video_device()
572 v4l2_ctrl_new_std(&fmdev->ctrl_handler, &fm_ctrl_ops, in fm_v4l2_init_video_device()
576 v4l2_ctrl_new_std(&fmdev->ctrl_handler, &fm_ctrl_ops, in fm_v4l2_init_video_device()
579 v4l2_ctrl_new_std_menu(&fmdev->ctrl_handler, &fm_ctrl_ops, in fm_v4l2_init_video_device()
583 v4l2_ctrl_new_std(&fmdev->ctrl_handler, &fm_ctrl_ops, in fm_v4l2_init_video_device()
587 ctrl = v4l2_ctrl_new_std(&fmdev->ctrl_handler, &fm_ctrl_ops, in fm_v4l2_init_video_device()
599 struct fmdev *fmdev; in fm_v4l2_deinit_video_device() local
602 fmdev = video_get_drvdata(&gradio_dev); in fm_v4l2_deinit_video_device()
605 v4l2_ctrl_handler_free(&fmdev->ctrl_handler); in fm_v4l2_deinit_video_device()
610 v4l2_device_unregister(&fmdev->v4l2_dev); in fm_v4l2_deinit_video_device()
612 return fmdev; in fm_v4l2_deinit_video_device()