Lines Matching refs:dev

28 	struct vivid_dev *dev = video_drvdata(file);  in vivid_radio_rx_read()  local
29 struct v4l2_rds_data *data = dev->rds_gen.data; in vivid_radio_rx_read()
36 if (dev->radio_rx_rds_controls) in vivid_radio_rx_read()
42 if (mutex_lock_interruptible(&dev->mutex)) in vivid_radio_rx_read()
44 if (dev->radio_rx_rds_owner && in vivid_radio_rx_read()
45 file->private_data != dev->radio_rx_rds_owner) { in vivid_radio_rx_read()
46 mutex_unlock(&dev->mutex); in vivid_radio_rx_read()
49 if (dev->radio_rx_rds_owner == NULL) { in vivid_radio_rx_read()
50 vivid_radio_rds_init(dev); in vivid_radio_rx_read()
51 dev->radio_rx_rds_owner = file->private_data; in vivid_radio_rx_read()
55 timestamp = ktime_sub(ktime_get(), dev->radio_rds_init_time); in vivid_radio_rx_read()
59 if (dev->radio_rx_rds_last_block == 0 || in vivid_radio_rx_read()
60 dev->radio_rx_rds_use_alternates != use_alternates) { in vivid_radio_rx_read()
61 dev->radio_rx_rds_use_alternates = use_alternates; in vivid_radio_rx_read()
63 vivid_radio_rds_init(dev); in vivid_radio_rx_read()
65 if (blk >= dev->radio_rx_rds_last_block + VIVID_RDS_GEN_BLOCKS) in vivid_radio_rx_read()
66 dev->radio_rx_rds_last_block = blk - VIVID_RDS_GEN_BLOCKS + 1; in vivid_radio_rx_read()
74 if (blk == dev->radio_rx_rds_last_block || !dev->radio_rx_rds_enabled || in vivid_radio_rx_read()
75 (dev->radio_rds_loop && !(dev->radio_tx_subchans & V4L2_TUNER_SUB_RDS)) || in vivid_radio_rx_read()
76 abs(dev->radio_rx_sig_qual) > 200) { in vivid_radio_rx_read()
77 mutex_unlock(&dev->mutex); in vivid_radio_rx_read()
82 if (mutex_lock_interruptible(&dev->mutex)) in vivid_radio_rx_read()
88 perc = abs(dev->radio_rx_sig_qual) / 4; in vivid_radio_rx_read()
90 for (i = 0; i < size && blk > dev->radio_rx_rds_last_block; in vivid_radio_rx_read()
91 dev->radio_rx_rds_last_block++) { in vivid_radio_rx_read()
92 unsigned data_blk = dev->radio_rx_rds_last_block % VIVID_RDS_GEN_BLOCKS; in vivid_radio_rx_read()
95 if (data_blk == 0 && dev->radio_rds_loop) in vivid_radio_rx_read()
96 vivid_radio_rds_init(dev); in vivid_radio_rx_read()
127 mutex_unlock(&dev->mutex); in vivid_radio_rx_read()
150 struct vivid_dev *dev = video_drvdata(file); in vivid_radio_rx_s_hw_freq_seek() local
158 if (a->wrap_around && dev->radio_rx_hw_seek_mode == VIVID_HW_SEEK_BOUNDED) in vivid_radio_rx_s_hw_freq_seek()
161 if (!a->wrap_around && dev->radio_rx_hw_seek_mode == VIVID_HW_SEEK_WRAP) in vivid_radio_rx_s_hw_freq_seek()
176 if (!dev->radio_rx_hw_seek_prog_lim && in vivid_radio_rx_s_hw_freq_seek()
184 if (dev->radio_rx_freq >= vivid_radio_bands[band].rangelow && in vivid_radio_rx_s_hw_freq_seek()
185 dev->radio_rx_freq <= vivid_radio_bands[band].rangehigh) in vivid_radio_rx_s_hw_freq_seek()
193 freq = clamp(dev->radio_rx_freq, low, high); in vivid_radio_rx_s_hw_freq_seek()
201 if (freq >= dev->radio_rx_freq) in vivid_radio_rx_s_hw_freq_seek()
210 if (freq <= dev->radio_rx_freq) in vivid_radio_rx_s_hw_freq_seek()
219 struct vivid_dev *dev = video_drvdata(file); in vivid_radio_rx_g_tuner() local
229 (dev->radio_rx_rds_controls ? in vivid_radio_rx_g_tuner()
232 (dev->radio_rx_hw_seek_prog_lim ? in vivid_radio_rx_g_tuner()
234 switch (dev->radio_rx_hw_seek_mode) { in vivid_radio_rx_g_tuner()
248 sig_qual = dev->radio_rx_sig_qual; in vivid_radio_rx_g_tuner()
254 else if (dev->radio_rx_freq < FM_FREQ_RANGE_LOW || vt->signal < 0x8000) in vivid_radio_rx_g_tuner()
256 else if (dev->radio_rds_loop && !(dev->radio_tx_subchans & V4L2_TUNER_SUB_STEREO)) in vivid_radio_rx_g_tuner()
260 if (dev->radio_rx_rds_enabled && in vivid_radio_rx_g_tuner()
261 (!dev->radio_rds_loop || (dev->radio_tx_subchans & V4L2_TUNER_SUB_RDS)) && in vivid_radio_rx_g_tuner()
262 dev->radio_rx_freq >= FM_FREQ_RANGE_LOW && vt->signal >= 0xc000) in vivid_radio_rx_g_tuner()
264 if (dev->radio_rx_rds_controls) in vivid_radio_rx_g_tuner()
265 vivid_radio_rds_init(dev); in vivid_radio_rx_g_tuner()
266 vt->audmode = dev->radio_rx_audmode; in vivid_radio_rx_g_tuner()
272 struct vivid_dev *dev = video_drvdata(file); in vivid_radio_rx_s_tuner() local
276 dev->radio_rx_audmode = vt->audmode >= V4L2_TUNER_MODE_STEREO; in vivid_radio_rx_s_tuner()