Lines Matching +full:sense +full:- +full:freq
1 // SPDX-License-Identifier: GPL-2.0
4 * Sony CXD2880 DVB-T2/T tuner + demodulator driver
5 * DVB-T2 monitor functions
17 {-96000, -95000, -94000, -93000, -92000, -92000, -98000, -97000},
18 {-91000, -89000, -88000, -87000, -86000, -86000, -93000, -92000},
19 {-86000, -85000, -83000, -82000, -81000, -80000, -89000, -88000},
20 {-82000, -80000, -78000, -76000, -75000, -74000, -86000, -84000},
32 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_sync_stat()
34 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_dvbt2_mon_sync_stat()
35 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_sync_stat()
37 if (tnr_dmd->sys != CXD2880_DTV_SYS_DVBT2) in cxd2880_tnrdmd_dvbt2_mon_sync_stat()
38 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_sync_stat()
40 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_sync_stat()
46 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_sync_stat()
57 return -EAGAIN; in cxd2880_tnrdmd_dvbt2_mon_sync_stat()
70 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_sync_stat_sub()
72 if (tnr_dmd->diver_mode != CXD2880_TNRDMD_DIVERMODE_MAIN) in cxd2880_tnrdmd_dvbt2_mon_sync_stat_sub()
73 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_sync_stat_sub()
75 return cxd2880_tnrdmd_dvbt2_mon_sync_stat(tnr_dmd->diver_sub, in cxd2880_tnrdmd_dvbt2_mon_sync_stat_sub()
92 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_carrier_offset()
94 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_dvbt2_mon_carrier_offset()
95 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_carrier_offset()
97 if (tnr_dmd->sys != CXD2880_DTV_SYS_DVBT2) in cxd2880_tnrdmd_dvbt2_mon_carrier_offset()
98 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_carrier_offset()
115 return -EAGAIN; in cxd2880_tnrdmd_dvbt2_mon_carrier_offset()
118 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_carrier_offset()
126 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_carrier_offset()
141 switch (tnr_dmd->bandwidth) { in cxd2880_tnrdmd_dvbt2_mon_carrier_offset()
143 *offset = -1 * ((*offset) / 582); in cxd2880_tnrdmd_dvbt2_mon_carrier_offset()
149 *offset = -1 * ((*offset) * tnr_dmd->bandwidth / 940); in cxd2880_tnrdmd_dvbt2_mon_carrier_offset()
152 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_carrier_offset()
164 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_carrier_offset_sub()
166 if (tnr_dmd->diver_mode != CXD2880_TNRDMD_DIVERMODE_MAIN) in cxd2880_tnrdmd_dvbt2_mon_carrier_offset_sub()
167 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_carrier_offset_sub()
169 return cxd2880_tnrdmd_dvbt2_mon_carrier_offset(tnr_dmd->diver_sub, in cxd2880_tnrdmd_dvbt2_mon_carrier_offset_sub()
186 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
188 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_SUB) in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
189 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
191 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
192 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
194 if (tnr_dmd->sys != CXD2880_DTV_SYS_DVBT2) in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
195 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
211 if (tnr_dmd->diver_mode == in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
223 return -EAGAIN; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
227 return -EAGAIN; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
237 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
245 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
254 l1_pre->type = (enum cxd2880_dvbt2_l1pre_type)data[0]; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
255 l1_pre->bw_ext = data[1] & 0x01; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
256 l1_pre->s1 = (enum cxd2880_dvbt2_s1)(data[2] & 0x07); in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
257 l1_pre->s2 = data[3] & 0x0f; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
258 l1_pre->l1_rep = data[4] & 0x01; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
259 l1_pre->gi = (enum cxd2880_dvbt2_guard)(data[5] & 0x07); in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
260 l1_pre->papr = (enum cxd2880_dvbt2_papr)(data[6] & 0x0f); in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
261 l1_pre->mod = in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
263 l1_pre->cr = (enum cxd2880_dvbt2_l1post_cr)(data[8] & 0x03); in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
264 l1_pre->fec = in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
266 l1_pre->l1_post_size = (data[10] & 0x03) << 16; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
267 l1_pre->l1_post_size |= (data[11]) << 8; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
268 l1_pre->l1_post_size |= (data[12]); in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
269 l1_pre->l1_post_info_size = (data[13] & 0x03) << 16; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
270 l1_pre->l1_post_info_size |= (data[14]) << 8; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
271 l1_pre->l1_post_info_size |= (data[15]); in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
272 l1_pre->pp = (enum cxd2880_dvbt2_pp)(data[16] & 0x0f); in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
273 l1_pre->tx_id_availability = data[17]; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
274 l1_pre->cell_id = (data[18] << 8); in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
275 l1_pre->cell_id |= (data[19]); in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
276 l1_pre->network_id = (data[20] << 8); in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
277 l1_pre->network_id |= (data[21]); in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
278 l1_pre->sys_id = (data[22] << 8); in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
279 l1_pre->sys_id |= (data[23]); in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
280 l1_pre->num_frames = data[24]; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
281 l1_pre->num_symbols = (data[25] & 0x0f) << 8; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
282 l1_pre->num_symbols |= data[26]; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
283 l1_pre->regen = data[27] & 0x07; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
284 l1_pre->post_ext = data[28] & 0x01; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
285 l1_pre->num_rf_freqs = data[29] & 0x07; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
286 l1_pre->rf_idx = data[30] & 0x07; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
289 l1_pre->t2_version = (enum cxd2880_dvbt2_version)version; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
290 l1_pre->l1_post_scrambled = (data[32] & 0x20) >> 5; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
291 l1_pre->t2_base_lite = (data[32] & 0x10) >> 4; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
292 l1_pre->crc32 = (data[33] << 24); in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
293 l1_pre->crc32 |= (data[34] << 16); in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
294 l1_pre->crc32 |= (data[35] << 8); in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
295 l1_pre->crc32 |= data[36]; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
298 switch ((l1_pre->s2 >> 1)) { in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
300 l1_pre->fft_mode = CXD2880_DVBT2_M1K; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
303 l1_pre->fft_mode = CXD2880_DVBT2_M2K; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
306 l1_pre->fft_mode = CXD2880_DVBT2_M4K; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
310 l1_pre->fft_mode = CXD2880_DVBT2_M8K; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
313 l1_pre->fft_mode = CXD2880_DVBT2_M16K; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
317 l1_pre->fft_mode = CXD2880_DVBT2_M32K; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
320 return -EAGAIN; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
323 switch ((l1_pre->s2 >> 1)) { in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
325 l1_pre->fft_mode = CXD2880_DVBT2_M2K; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
328 l1_pre->fft_mode = CXD2880_DVBT2_M4K; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
332 l1_pre->fft_mode = CXD2880_DVBT2_M8K; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
336 l1_pre->fft_mode = CXD2880_DVBT2_M16K; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
339 return -EAGAIN; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
342 return -EAGAIN; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
345 l1_pre->mixed = l1_pre->s2 & 0x01; in cxd2880_tnrdmd_dvbt2_mon_l1_pre()
363 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_version()
365 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_SUB) in cxd2880_tnrdmd_dvbt2_mon_version()
366 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_version()
368 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_dvbt2_mon_version()
369 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_version()
371 if (tnr_dmd->sys != CXD2880_DTV_SYS_DVBT2) in cxd2880_tnrdmd_dvbt2_mon_version()
372 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_version()
388 if (tnr_dmd->diver_mode == in cxd2880_tnrdmd_dvbt2_mon_version()
400 return -EAGAIN; in cxd2880_tnrdmd_dvbt2_mon_version()
404 return -EAGAIN; in cxd2880_tnrdmd_dvbt2_mon_version()
408 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_version()
416 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_version()
443 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_ofdm()
445 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_dvbt2_mon_ofdm()
446 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_ofdm()
448 if (tnr_dmd->sys != CXD2880_DTV_SYS_DVBT2) in cxd2880_tnrdmd_dvbt2_mon_ofdm()
449 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_ofdm()
467 ret = -EAGAIN; in cxd2880_tnrdmd_dvbt2_mon_ofdm()
469 if (tnr_dmd->diver_mode == in cxd2880_tnrdmd_dvbt2_mon_ofdm()
472 cxd2880_tnrdmd_dvbt2_mon_ofdm(tnr_dmd->diver_sub, in cxd2880_tnrdmd_dvbt2_mon_ofdm()
478 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_ofdm()
486 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_ofdm()
496 ofdm->mixed = ((data[0] & 0x20) ? 1 : 0); in cxd2880_tnrdmd_dvbt2_mon_ofdm()
497 ofdm->is_miso = ((data[0] & 0x10) >> 4); in cxd2880_tnrdmd_dvbt2_mon_ofdm()
498 ofdm->mode = (enum cxd2880_dvbt2_mode)(data[0] & 0x07); in cxd2880_tnrdmd_dvbt2_mon_ofdm()
499 ofdm->gi = (enum cxd2880_dvbt2_guard)((data[1] & 0x70) >> 4); in cxd2880_tnrdmd_dvbt2_mon_ofdm()
500 ofdm->pp = (enum cxd2880_dvbt2_pp)(data[1] & 0x07); in cxd2880_tnrdmd_dvbt2_mon_ofdm()
501 ofdm->bw_ext = (data[2] & 0x10) >> 4; in cxd2880_tnrdmd_dvbt2_mon_ofdm()
502 ofdm->papr = (enum cxd2880_dvbt2_papr)(data[2] & 0x0f); in cxd2880_tnrdmd_dvbt2_mon_ofdm()
503 ofdm->num_symbols = (data[3] << 8) | data[4]; in cxd2880_tnrdmd_dvbt2_mon_ofdm()
516 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_data_plps()
518 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_SUB) in cxd2880_tnrdmd_dvbt2_mon_data_plps()
519 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_data_plps()
521 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_dvbt2_mon_data_plps()
522 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_data_plps()
524 if (tnr_dmd->sys != CXD2880_DTV_SYS_DVBT2) in cxd2880_tnrdmd_dvbt2_mon_data_plps()
525 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_data_plps()
527 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_data_plps()
537 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_data_plps()
547 return -EAGAIN; in cxd2880_tnrdmd_dvbt2_mon_data_plps()
550 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_data_plps()
560 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_data_plps()
568 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_data_plps()
580 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_data_plps()
588 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_data_plps()
591 *num_plps - 62); in cxd2880_tnrdmd_dvbt2_mon_data_plps()
618 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_active_plp()
620 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_SUB) in cxd2880_tnrdmd_dvbt2_mon_active_plp()
621 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_active_plp()
623 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_dvbt2_mon_active_plp()
624 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_active_plp()
626 if (tnr_dmd->sys != CXD2880_DTV_SYS_DVBT2) in cxd2880_tnrdmd_dvbt2_mon_active_plp()
627 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_active_plp()
633 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_active_plp()
641 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_active_plp()
651 return -EAGAIN; in cxd2880_tnrdmd_dvbt2_mon_active_plp()
659 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_active_plp()
670 return -EAGAIN; in cxd2880_tnrdmd_dvbt2_mon_active_plp()
672 plp_info->id = data[index++]; in cxd2880_tnrdmd_dvbt2_mon_active_plp()
673 plp_info->type = in cxd2880_tnrdmd_dvbt2_mon_active_plp()
675 plp_info->payload = in cxd2880_tnrdmd_dvbt2_mon_active_plp()
677 plp_info->ff = data[index++] & 0x01; in cxd2880_tnrdmd_dvbt2_mon_active_plp()
678 plp_info->first_rf_idx = data[index++] & 0x07; in cxd2880_tnrdmd_dvbt2_mon_active_plp()
679 plp_info->first_frm_idx = data[index++]; in cxd2880_tnrdmd_dvbt2_mon_active_plp()
680 plp_info->group_id = data[index++]; in cxd2880_tnrdmd_dvbt2_mon_active_plp()
681 plp_info->plp_cr = in cxd2880_tnrdmd_dvbt2_mon_active_plp()
683 plp_info->constell = in cxd2880_tnrdmd_dvbt2_mon_active_plp()
685 plp_info->rot = data[index++] & 0x01; in cxd2880_tnrdmd_dvbt2_mon_active_plp()
686 plp_info->fec = in cxd2880_tnrdmd_dvbt2_mon_active_plp()
688 plp_info->num_blocks_max = (data[index++] & 0x03) << 8; in cxd2880_tnrdmd_dvbt2_mon_active_plp()
689 plp_info->num_blocks_max |= data[index++]; in cxd2880_tnrdmd_dvbt2_mon_active_plp()
690 plp_info->frm_int = data[index++]; in cxd2880_tnrdmd_dvbt2_mon_active_plp()
691 plp_info->til_len = data[index++]; in cxd2880_tnrdmd_dvbt2_mon_active_plp()
692 plp_info->til_type = data[index++] & 0x01; in cxd2880_tnrdmd_dvbt2_mon_active_plp()
694 plp_info->in_band_a_flag = data[index++] & 0x01; in cxd2880_tnrdmd_dvbt2_mon_active_plp()
695 plp_info->rsvd = data[index++] << 8; in cxd2880_tnrdmd_dvbt2_mon_active_plp()
696 plp_info->rsvd |= data[index++]; in cxd2880_tnrdmd_dvbt2_mon_active_plp()
698 plp_info->in_band_b_flag = in cxd2880_tnrdmd_dvbt2_mon_active_plp()
699 (plp_info->rsvd & 0x8000) >> 15; in cxd2880_tnrdmd_dvbt2_mon_active_plp()
700 plp_info->plp_mode = in cxd2880_tnrdmd_dvbt2_mon_active_plp()
701 (enum cxd2880_dvbt2_plp_mode)((plp_info->rsvd & 0x000c) >> 2); in cxd2880_tnrdmd_dvbt2_mon_active_plp()
702 plp_info->static_flag = (plp_info->rsvd & 0x0002) >> 1; in cxd2880_tnrdmd_dvbt2_mon_active_plp()
703 plp_info->static_padding_flag = plp_info->rsvd & 0x0001; in cxd2880_tnrdmd_dvbt2_mon_active_plp()
704 plp_info->rsvd = (plp_info->rsvd & 0x7ff0) >> 4; in cxd2880_tnrdmd_dvbt2_mon_active_plp()
717 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_data_plp_error()
719 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_SUB) in cxd2880_tnrdmd_dvbt2_mon_data_plp_error()
720 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_data_plp_error()
722 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_dvbt2_mon_data_plp_error()
723 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_data_plp_error()
725 if (tnr_dmd->sys != CXD2880_DTV_SYS_DVBT2) in cxd2880_tnrdmd_dvbt2_mon_data_plp_error()
726 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_data_plp_error()
732 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_data_plp_error()
740 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_data_plp_error()
750 return -EAGAIN; in cxd2880_tnrdmd_dvbt2_mon_data_plp_error()
753 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_data_plp_error()
778 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_l1_change()
780 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_SUB) in cxd2880_tnrdmd_dvbt2_mon_l1_change()
781 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_l1_change()
783 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_dvbt2_mon_l1_change()
784 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_l1_change()
786 if (tnr_dmd->sys != CXD2880_DTV_SYS_DVBT2) in cxd2880_tnrdmd_dvbt2_mon_l1_change()
787 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_l1_change()
803 if (tnr_dmd->diver_mode == in cxd2880_tnrdmd_dvbt2_mon_l1_change()
815 return -EAGAIN; in cxd2880_tnrdmd_dvbt2_mon_l1_change()
819 return -EAGAIN; in cxd2880_tnrdmd_dvbt2_mon_l1_change()
823 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_l1_change()
831 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_l1_change()
841 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_l1_change()
849 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_l1_change()
871 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_l1_post()
873 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_SUB) in cxd2880_tnrdmd_dvbt2_mon_l1_post()
874 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_l1_post()
876 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_dvbt2_mon_l1_post()
877 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_l1_post()
879 if (tnr_dmd->sys != CXD2880_DTV_SYS_DVBT2) in cxd2880_tnrdmd_dvbt2_mon_l1_post()
880 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_l1_post()
882 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_l1_post()
888 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_l1_post()
895 return -EAGAIN; in cxd2880_tnrdmd_dvbt2_mon_l1_post()
897 l1_post->sub_slices_per_frame = (data[1] & 0x7f) << 8; in cxd2880_tnrdmd_dvbt2_mon_l1_post()
898 l1_post->sub_slices_per_frame |= data[2]; in cxd2880_tnrdmd_dvbt2_mon_l1_post()
899 l1_post->num_plps = data[3]; in cxd2880_tnrdmd_dvbt2_mon_l1_post()
900 l1_post->num_aux = data[4] & 0x0f; in cxd2880_tnrdmd_dvbt2_mon_l1_post()
901 l1_post->aux_cfg_rfu = data[5]; in cxd2880_tnrdmd_dvbt2_mon_l1_post()
902 l1_post->rf_idx = data[6] & 0x07; in cxd2880_tnrdmd_dvbt2_mon_l1_post()
903 l1_post->freq = data[7] << 24; in cxd2880_tnrdmd_dvbt2_mon_l1_post()
904 l1_post->freq |= data[8] << 16; in cxd2880_tnrdmd_dvbt2_mon_l1_post()
905 l1_post->freq |= data[9] << 8; in cxd2880_tnrdmd_dvbt2_mon_l1_post()
906 l1_post->freq |= data[10]; in cxd2880_tnrdmd_dvbt2_mon_l1_post()
907 l1_post->fef_type = data[11] & 0x0f; in cxd2880_tnrdmd_dvbt2_mon_l1_post()
908 l1_post->fef_length = data[12] << 16; in cxd2880_tnrdmd_dvbt2_mon_l1_post()
909 l1_post->fef_length |= data[13] << 8; in cxd2880_tnrdmd_dvbt2_mon_l1_post()
910 l1_post->fef_length |= data[14]; in cxd2880_tnrdmd_dvbt2_mon_l1_post()
911 l1_post->fef_intvl = data[15]; in cxd2880_tnrdmd_dvbt2_mon_l1_post()
931 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_bbheader()
933 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_SUB) in cxd2880_tnrdmd_dvbt2_mon_bbheader()
934 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_bbheader()
936 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_dvbt2_mon_bbheader()
937 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_bbheader()
939 if (tnr_dmd->sys != CXD2880_DTV_SYS_DVBT2) in cxd2880_tnrdmd_dvbt2_mon_bbheader()
940 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_bbheader()
957 return -EAGAIN; in cxd2880_tnrdmd_dvbt2_mon_bbheader()
960 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_bbheader()
972 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_bbheader()
982 return -EAGAIN; in cxd2880_tnrdmd_dvbt2_mon_bbheader()
985 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_bbheader()
995 return -EAGAIN; in cxd2880_tnrdmd_dvbt2_mon_bbheader()
1004 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_bbheader()
1014 bbheader->stream_input = in cxd2880_tnrdmd_dvbt2_mon_bbheader()
1016 bbheader->is_single_input_stream = (data[0] >> 5) & 0x01; in cxd2880_tnrdmd_dvbt2_mon_bbheader()
1017 bbheader->is_constant_coding_modulation = in cxd2880_tnrdmd_dvbt2_mon_bbheader()
1019 bbheader->issy_indicator = (data[0] >> 3) & 0x01; in cxd2880_tnrdmd_dvbt2_mon_bbheader()
1020 bbheader->null_packet_deletion = (data[0] >> 2) & 0x01; in cxd2880_tnrdmd_dvbt2_mon_bbheader()
1021 bbheader->ext = data[0] & 0x03; in cxd2880_tnrdmd_dvbt2_mon_bbheader()
1023 bbheader->input_stream_identifier = data[1]; in cxd2880_tnrdmd_dvbt2_mon_bbheader()
1024 bbheader->plp_mode = in cxd2880_tnrdmd_dvbt2_mon_bbheader()
1027 bbheader->data_field_length = (data[4] << 8) | data[5]; in cxd2880_tnrdmd_dvbt2_mon_bbheader()
1029 if (bbheader->plp_mode == CXD2880_DVBT2_PLP_MODE_NM) { in cxd2880_tnrdmd_dvbt2_mon_bbheader()
1030 bbheader->user_packet_length = in cxd2880_tnrdmd_dvbt2_mon_bbheader()
1032 bbheader->sync_byte = data[8]; in cxd2880_tnrdmd_dvbt2_mon_bbheader()
1033 bbheader->issy = 0; in cxd2880_tnrdmd_dvbt2_mon_bbheader()
1035 bbheader->user_packet_length = 0; in cxd2880_tnrdmd_dvbt2_mon_bbheader()
1036 bbheader->sync_byte = 0; in cxd2880_tnrdmd_dvbt2_mon_bbheader()
1037 bbheader->issy = in cxd2880_tnrdmd_dvbt2_mon_bbheader()
1061 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_in_bandb_ts_rate()
1063 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_SUB) in cxd2880_tnrdmd_dvbt2_mon_in_bandb_ts_rate()
1064 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_in_bandb_ts_rate()
1066 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_dvbt2_mon_in_bandb_ts_rate()
1067 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_in_bandb_ts_rate()
1069 if (tnr_dmd->sys != CXD2880_DTV_SYS_DVBT2) in cxd2880_tnrdmd_dvbt2_mon_in_bandb_ts_rate()
1070 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_in_bandb_ts_rate()
1087 return -EAGAIN; in cxd2880_tnrdmd_dvbt2_mon_in_bandb_ts_rate()
1090 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_in_bandb_ts_rate()
1098 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_in_bandb_ts_rate()
1108 return -EAGAIN; in cxd2880_tnrdmd_dvbt2_mon_in_bandb_ts_rate()
1116 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_in_bandb_ts_rate()
1126 return -EAGAIN; in cxd2880_tnrdmd_dvbt2_mon_in_bandb_ts_rate()
1129 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_in_bandb_ts_rate()
1142 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_in_bandb_ts_rate()
1160 *sense) in cxd2880_tnrdmd_dvbt2_mon_spectrum_sense()
1168 if (!tnr_dmd || !sense) in cxd2880_tnrdmd_dvbt2_mon_spectrum_sense()
1169 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_spectrum_sense()
1171 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_dvbt2_mon_spectrum_sense()
1172 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_spectrum_sense()
1174 if (tnr_dmd->sys != CXD2880_DTV_SYS_DVBT2) in cxd2880_tnrdmd_dvbt2_mon_spectrum_sense()
1175 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_spectrum_sense()
1192 ret = -EAGAIN; in cxd2880_tnrdmd_dvbt2_mon_spectrum_sense()
1194 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_MAIN) in cxd2880_tnrdmd_dvbt2_mon_spectrum_sense()
1196 cxd2880_tnrdmd_dvbt2_mon_spectrum_sense(tnr_dmd->diver_sub, in cxd2880_tnrdmd_dvbt2_mon_spectrum_sense()
1197 sense); in cxd2880_tnrdmd_dvbt2_mon_spectrum_sense()
1202 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_spectrum_sense()
1210 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_spectrum_sense()
1220 *sense = in cxd2880_tnrdmd_dvbt2_mon_spectrum_sense()
1237 return -EINVAL; in dvbt2_read_snr_reg()
1254 return -EAGAIN; in dvbt2_read_snr_reg()
1257 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in dvbt2_read_snr_reg()
1265 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in dvbt2_read_snr_reg()
1284 return -EINVAL; in dvbt2_calc_snr()
1287 return -EAGAIN; in dvbt2_calc_snr()
1292 *snr = intlog10(reg_value) - intlog10(12600 - reg_value); in dvbt2_calc_snr()
1305 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_snr()
1307 *snr = -1000 * 1000; in cxd2880_tnrdmd_dvbt2_mon_snr()
1309 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_SUB) in cxd2880_tnrdmd_dvbt2_mon_snr()
1310 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_snr()
1312 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_dvbt2_mon_snr()
1313 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_snr()
1315 if (tnr_dmd->sys != CXD2880_DTV_SYS_DVBT2) in cxd2880_tnrdmd_dvbt2_mon_snr()
1316 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_snr()
1318 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_SINGLE) { in cxd2880_tnrdmd_dvbt2_mon_snr()
1345 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_snr_diver()
1347 *snr = -1000 * 1000; in cxd2880_tnrdmd_dvbt2_mon_snr_diver()
1348 *snr_main = -1000 * 1000; in cxd2880_tnrdmd_dvbt2_mon_snr_diver()
1349 *snr_sub = -1000 * 1000; in cxd2880_tnrdmd_dvbt2_mon_snr_diver()
1351 if (tnr_dmd->diver_mode != CXD2880_TNRDMD_DIVERMODE_MAIN) in cxd2880_tnrdmd_dvbt2_mon_snr_diver()
1352 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_snr_diver()
1354 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_dvbt2_mon_snr_diver()
1355 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_snr_diver()
1357 if (tnr_dmd->sys != CXD2880_DTV_SYS_DVBT2) in cxd2880_tnrdmd_dvbt2_mon_snr_diver()
1358 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_snr_diver()
1365 } else if (ret == -EAGAIN) { in cxd2880_tnrdmd_dvbt2_mon_snr_diver()
1373 ret = dvbt2_read_snr_reg(tnr_dmd->diver_sub, ®_value); in cxd2880_tnrdmd_dvbt2_mon_snr_diver()
1375 ret = dvbt2_calc_snr(tnr_dmd->diver_sub, reg_value, snr_sub); in cxd2880_tnrdmd_dvbt2_mon_snr_diver()
1378 } else if (ret == -EAGAIN) { in cxd2880_tnrdmd_dvbt2_mon_snr_diver()
1398 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_packet_error_number()
1400 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_SUB) in cxd2880_tnrdmd_dvbt2_mon_packet_error_number()
1401 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_packet_error_number()
1403 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_dvbt2_mon_packet_error_number()
1404 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_packet_error_number()
1406 if (tnr_dmd->sys != CXD2880_DTV_SYS_DVBT2) in cxd2880_tnrdmd_dvbt2_mon_packet_error_number()
1407 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_packet_error_number()
1409 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_packet_error_number()
1415 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_packet_error_number()
1422 return -EAGAIN; in cxd2880_tnrdmd_dvbt2_mon_packet_error_number()
1445 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_sampling_offset()
1447 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_dvbt2_mon_sampling_offset()
1448 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_sampling_offset()
1450 if (tnr_dmd->sys != CXD2880_DTV_SYS_DVBT2) in cxd2880_tnrdmd_dvbt2_mon_sampling_offset()
1451 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_sampling_offset()
1468 return -EAGAIN; in cxd2880_tnrdmd_dvbt2_mon_sampling_offset()
1471 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_sampling_offset()
1479 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_sampling_offset()
1488 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_sampling_offset()
1496 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_sampling_offset()
1508 (ctl_val_reg[0] & 0x7f) - (nominal_rate_reg[0] & 0x7f); in cxd2880_tnrdmd_dvbt2_mon_sampling_offset()
1510 if (diff_upper < -1 || diff_upper > 1) in cxd2880_tnrdmd_dvbt2_mon_sampling_offset()
1511 return -EAGAIN; in cxd2880_tnrdmd_dvbt2_mon_sampling_offset()
1528 (int)((trl_ctl_val + 0x80000000u) - in cxd2880_tnrdmd_dvbt2_mon_sampling_offset()
1530 else if (diff_upper == -1) in cxd2880_tnrdmd_dvbt2_mon_sampling_offset()
1532 -(int)((trcg_nominal_rate + 0x80000000u) - in cxd2880_tnrdmd_dvbt2_mon_sampling_offset()
1535 num = (int)(trl_ctl_val - trcg_nominal_rate); in cxd2880_tnrdmd_dvbt2_mon_sampling_offset()
1548 *ppm = (num - (den / 2)) / den; in cxd2880_tnrdmd_dvbt2_mon_sampling_offset()
1559 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_sampling_offset_sub()
1561 if (tnr_dmd->diver_mode != CXD2880_TNRDMD_DIVERMODE_MAIN) in cxd2880_tnrdmd_dvbt2_mon_sampling_offset_sub()
1562 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_sampling_offset_sub()
1564 return cxd2880_tnrdmd_dvbt2_mon_sampling_offset(tnr_dmd->diver_sub, in cxd2880_tnrdmd_dvbt2_mon_sampling_offset_sub()
1577 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_qam()
1579 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_SUB) in cxd2880_tnrdmd_dvbt2_mon_qam()
1580 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_qam()
1582 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_dvbt2_mon_qam()
1583 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_qam()
1585 if (tnr_dmd->sys != CXD2880_DTV_SYS_DVBT2) in cxd2880_tnrdmd_dvbt2_mon_qam()
1586 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_qam()
1592 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_qam()
1600 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_qam()
1610 return -EAGAIN; in cxd2880_tnrdmd_dvbt2_mon_qam()
1614 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_qam()
1624 return -EAGAIN; in cxd2880_tnrdmd_dvbt2_mon_qam()
1627 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_qam()
1635 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_qam()
1664 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_code_rate()
1666 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_SUB) in cxd2880_tnrdmd_dvbt2_mon_code_rate()
1667 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_code_rate()
1669 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_dvbt2_mon_code_rate()
1670 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_code_rate()
1672 if (tnr_dmd->sys != CXD2880_DTV_SYS_DVBT2) in cxd2880_tnrdmd_dvbt2_mon_code_rate()
1673 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_code_rate()
1679 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_code_rate()
1687 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_code_rate()
1697 return -EAGAIN; in cxd2880_tnrdmd_dvbt2_mon_code_rate()
1701 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_code_rate()
1711 return -EAGAIN; in cxd2880_tnrdmd_dvbt2_mon_code_rate()
1714 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_code_rate()
1722 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_code_rate()
1747 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_profile()
1749 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_dvbt2_mon_profile()
1750 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_profile()
1752 if (tnr_dmd->sys != CXD2880_DTV_SYS_DVBT2) in cxd2880_tnrdmd_dvbt2_mon_profile()
1753 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_profile()
1755 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_profile()
1761 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_dvbt2_mon_profile()
1773 ret = -EAGAIN; in cxd2880_tnrdmd_dvbt2_mon_profile()
1774 if (tnr_dmd->diver_mode == in cxd2880_tnrdmd_dvbt2_mon_profile()
1777 cxd2880_tnrdmd_dvbt2_mon_profile(tnr_dmd->diver_sub, in cxd2880_tnrdmd_dvbt2_mon_profile()
1796 return -EINVAL; in dvbt2_calc_ssi()
1810 return -EINVAL; in dvbt2_calc_ssi()
1812 prel = rf_lvl - ref_dbm_1000[qam][code_rate]; in dvbt2_calc_ssi()
1814 if (prel < -15000) in dvbt2_calc_ssi()
1821 temp_ssi = (((2 * (prel - 20000)) + 1500) / 3000) + 90; in dvbt2_calc_ssi()
1837 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_ssi()
1839 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_SUB) in cxd2880_tnrdmd_dvbt2_mon_ssi()
1840 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_ssi()
1842 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_dvbt2_mon_ssi()
1843 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_ssi()
1845 if (tnr_dmd->sys != CXD2880_DTV_SYS_DVBT2) in cxd2880_tnrdmd_dvbt2_mon_ssi()
1846 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_ssi()
1862 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_ssi_sub()
1864 if (tnr_dmd->diver_mode != CXD2880_TNRDMD_DIVERMODE_MAIN) in cxd2880_tnrdmd_dvbt2_mon_ssi_sub()
1865 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_ssi_sub()
1867 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_dvbt2_mon_ssi_sub()
1868 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_ssi_sub()
1870 if (tnr_dmd->sys != CXD2880_DTV_SYS_DVBT2) in cxd2880_tnrdmd_dvbt2_mon_ssi_sub()
1871 return -EINVAL; in cxd2880_tnrdmd_dvbt2_mon_ssi_sub()
1873 ret = cxd2880_tnrdmd_mon_rf_lvl(tnr_dmd->diver_sub, &rf_lvl); in cxd2880_tnrdmd_dvbt2_mon_ssi_sub()