Lines Matching refs:fmdev

50 	struct fmdev *fmdev;  in fm_v4l2_fops_read()  local
52 fmdev = video_drvdata(file); in fm_v4l2_fops_read()
59 if (mutex_lock_interruptible(&fmdev->mutex)) in fm_v4l2_fops_read()
63 ret = fm_rx_get_rds_mode(fmdev, &rds_mode); in fm_v4l2_fops_read()
70 ret = fmc_set_rds_mode(fmdev, FM_RDS_ENABLE); in fm_v4l2_fops_read()
78 ret = fmc_transfer_rds_from_internal_buff(fmdev, file, buf, count); in fm_v4l2_fops_read()
80 mutex_unlock(&fmdev->mutex); in fm_v4l2_fops_read()
90 struct fmdev *fmdev; in fm_v4l2_fops_write() local
99 fmdev = video_drvdata(file); in fm_v4l2_fops_write()
100 if (mutex_lock_interruptible(&fmdev->mutex)) in fm_v4l2_fops_write()
102 fm_tx_set_radio_text(fmdev, rds.text, rds.text_type); in fm_v4l2_fops_write()
103 fm_tx_set_af(fmdev, rds.af_freq); in fm_v4l2_fops_write()
104 mutex_unlock(&fmdev->mutex); in fm_v4l2_fops_write()
112 struct fmdev *fmdev; in fm_v4l2_fops_poll() local
114 fmdev = video_drvdata(file); in fm_v4l2_fops_poll()
115 mutex_lock(&fmdev->mutex); in fm_v4l2_fops_poll()
116 ret = fmc_is_rds_data_available(fmdev, file, pts); in fm_v4l2_fops_poll()
117 mutex_unlock(&fmdev->mutex); in fm_v4l2_fops_poll()
131 struct fmdev *fmdev = NULL; in fm_v4l2_fops_open() local
139 fmdev = video_drvdata(file); in fm_v4l2_fops_open()
141 if (mutex_lock_interruptible(&fmdev->mutex)) in fm_v4l2_fops_open()
143 ret = fmc_prepare(fmdev); in fm_v4l2_fops_open()
151 ret = fmc_set_mode(fmdev, FM_MODE_RX); in fm_v4l2_fops_open()
159 mutex_unlock(&fmdev->mutex); in fm_v4l2_fops_open()
166 struct fmdev *fmdev; in fm_v4l2_fops_release() local
168 fmdev = video_drvdata(file); in fm_v4l2_fops_release()
174 mutex_lock(&fmdev->mutex); in fm_v4l2_fops_release()
175 ret = fmc_set_mode(fmdev, FM_MODE_OFF); in fm_v4l2_fops_release()
181 ret = fmc_release(fmdev); in fm_v4l2_fops_release()
189 mutex_unlock(&fmdev->mutex); in fm_v4l2_fops_release()
213 struct fmdev *fmdev = container_of(ctrl->handler, in fm_g_volatile_ctrl() local
214 struct fmdev, ctrl_handler); in fm_g_volatile_ctrl()
218 ctrl->val = fm_tx_get_tune_cap_val(fmdev); in fm_g_volatile_ctrl()
230 struct fmdev *fmdev = container_of(ctrl->handler, in fm_v4l2_s_ctrl() local
231 struct fmdev, ctrl_handler); in fm_v4l2_s_ctrl()
235 return fm_rx_set_volume(fmdev, (u16)ctrl->val); in fm_v4l2_s_ctrl()
238 return fmc_set_mute_mode(fmdev, (u8)ctrl->val); in fm_v4l2_s_ctrl()
242 return fm_tx_set_pwr_lvl(fmdev, (u8)ctrl->val); in fm_v4l2_s_ctrl()
245 return fm_tx_set_preemph_filter(fmdev, (u8) ctrl->val); in fm_v4l2_s_ctrl()
275 struct fmdev *fmdev = video_drvdata(file); in fm_v4l2_vidioc_g_tuner() local
285 if (fmdev->curr_fmmode != FM_MODE_RX) in fm_v4l2_vidioc_g_tuner()
288 ret = fm_rx_get_band_freq_range(fmdev, &bottom_freq, &top_freq); in fm_v4l2_vidioc_g_tuner()
292 ret = fm_rx_get_stereo_mono(fmdev, &stereo_mono_mode); in fm_v4l2_vidioc_g_tuner()
296 ret = fm_rx_get_rssi_level(fmdev, &rssilvl); in fm_v4l2_vidioc_g_tuner()
306 ((fmdev->rx.rds.flag == FM_RDS_ENABLE) ? V4L2_TUNER_SUB_RDS : 0); in fm_v4l2_vidioc_g_tuner()
338 struct fmdev *fmdev = video_drvdata(file); in fm_v4l2_vidioc_s_tuner() local
351 if (fmdev->curr_fmmode != FM_MODE_RX) { in fm_v4l2_vidioc_s_tuner()
352 ret = fmc_set_mode(fmdev, FM_MODE_RX); in fm_v4l2_vidioc_s_tuner()
359 ret = fmc_set_stereo_mono(fmdev, aud_mode); in fm_v4l2_vidioc_s_tuner()
365 ret = fmc_set_rds_mode(fmdev, rds_mode); in fm_v4l2_vidioc_s_tuner()
376 struct fmdev *fmdev = video_drvdata(file); in fm_v4l2_vidioc_g_freq() local
379 ret = fmc_get_freq(fmdev, &freq->frequency); in fm_v4l2_vidioc_g_freq()
395 struct fmdev *fmdev = video_drvdata(file); in fm_v4l2_vidioc_s_freq() local
401 return fmc_set_freq(fmdev, freq->frequency / 16); in fm_v4l2_vidioc_s_freq()
408 struct fmdev *fmdev = video_drvdata(file); in fm_v4l2_vidioc_s_hw_freq_seek() local
414 if (fmdev->curr_fmmode != FM_MODE_RX) { in fm_v4l2_vidioc_s_hw_freq_seek()
415 ret = fmc_set_mode(fmdev, FM_MODE_RX); in fm_v4l2_vidioc_s_hw_freq_seek()
422 ret = fm_rx_seek(fmdev, seek->seek_upward, seek->wrap_around, in fm_v4l2_vidioc_s_hw_freq_seek()
433 struct fmdev *fmdev = video_drvdata(file); in fm_v4l2_vidioc_g_modulator() local
438 if (fmdev->curr_fmmode != FM_MODE_TX) in fm_v4l2_vidioc_g_modulator()
441 mod->txsubchans = ((fmdev->tx_data.aud_mode == FM_STEREO_MODE) ? in fm_v4l2_vidioc_g_modulator()
443 ((fmdev->tx_data.rds.flag == FM_RDS_ENABLE) ? in fm_v4l2_vidioc_g_modulator()
456 struct fmdev *fmdev = video_drvdata(file); in fm_v4l2_vidioc_s_modulator() local
464 if (fmdev->curr_fmmode != FM_MODE_TX) { in fm_v4l2_vidioc_s_modulator()
465 ret = fmc_set_mode(fmdev, FM_MODE_TX); in fm_v4l2_vidioc_s_modulator()
476 ret = fm_tx_set_stereo_mono(fmdev, aud_mode); in fm_v4l2_vidioc_s_modulator()
481 ret = fm_tx_set_rds_mode(fmdev, rds_mode); in fm_v4l2_vidioc_s_modulator()
533 int fm_v4l2_init_video_device(struct fmdev *fmdev, int radio_nr) in fm_v4l2_init_video_device() argument
538 strlcpy(fmdev->v4l2_dev.name, FM_DRV_NAME, sizeof(fmdev->v4l2_dev.name)); in fm_v4l2_init_video_device()
539 ret = v4l2_device_register(NULL, &fmdev->v4l2_dev); in fm_v4l2_init_video_device()
544 mutex_init(&fmdev->mutex); in fm_v4l2_init_video_device()
549 video_set_drvdata(&gradio_dev, fmdev); in fm_v4l2_init_video_device()
551 gradio_dev.lock = &fmdev->mutex; in fm_v4l2_init_video_device()
552 gradio_dev.v4l2_dev = &fmdev->v4l2_dev; in fm_v4l2_init_video_device()
560 fmdev->radio_dev = &gradio_dev; in fm_v4l2_init_video_device()
563 fmdev->radio_dev->ctrl_handler = &fmdev->ctrl_handler; in fm_v4l2_init_video_device()
565 ret = v4l2_ctrl_handler_init(&fmdev->ctrl_handler, 5); in fm_v4l2_init_video_device()
568 v4l2_ctrl_handler_free(&fmdev->ctrl_handler); in fm_v4l2_init_video_device()
576 v4l2_ctrl_new_std(&fmdev->ctrl_handler, &fm_ctrl_ops, in fm_v4l2_init_video_device()
580 v4l2_ctrl_new_std(&fmdev->ctrl_handler, &fm_ctrl_ops, in fm_v4l2_init_video_device()
583 v4l2_ctrl_new_std_menu(&fmdev->ctrl_handler, &fm_ctrl_ops, in fm_v4l2_init_video_device()
587 v4l2_ctrl_new_std(&fmdev->ctrl_handler, &fm_ctrl_ops, in fm_v4l2_init_video_device()
591 ctrl = v4l2_ctrl_new_std(&fmdev->ctrl_handler, &fm_ctrl_ops, in fm_v4l2_init_video_device()
603 struct fmdev *fmdev; in fm_v4l2_deinit_video_device() local
606 fmdev = video_get_drvdata(&gradio_dev); in fm_v4l2_deinit_video_device()
609 v4l2_ctrl_handler_free(&fmdev->ctrl_handler); in fm_v4l2_deinit_video_device()
614 v4l2_device_unregister(&fmdev->v4l2_dev); in fm_v4l2_deinit_video_device()
616 return fmdev; in fm_v4l2_deinit_video_device()