2 * Afatech AF9033 demodulator driver
4 * Copyright (C) 2009 Antti Palosaari <crope@iki.fi>
5 * Copyright (C) 2012 Antti Palosaari <crope@iki.fi>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 #include "dvb_frontend.h"
27 #include <linux/math64.h>
28 #include <linux/regmap.h>
29 #include <linux/kernel.h>
58 /* Xtal clock vs. ADC clock lookup table */
59 static const struct clock_adc clock_adc_lut[] = {
60 { 16384000, 20480000 },
61 { 20480000, 20480000 },
62 { 36000000, 20250000 },
63 { 30000000, 20156250 },
64 { 26000000, 20583333 },
65 { 28000000, 20416667 },
66 { 32000000, 20500000 },
67 { 34000000, 20187500 },
68 { 24000000, 20500000 },
69 { 22000000, 20625000 },
70 { 12000000, 20250000 },
73 /* pre-calculated coeff lookup table */
74 static const struct coeff coeff_lut[] = {
76 { 12000000, 8000000, {
77 0x01, 0xce, 0x55, 0xc9, 0x00, 0xe7, 0x2a, 0xe4, 0x00, 0x73,
78 0x99, 0x0f, 0x00, 0x73, 0x95, 0x72, 0x00, 0x73, 0x91, 0xd5,
79 0x00, 0x39, 0xca, 0xb9, 0x00, 0xe7, 0x2a, 0xe4, 0x00, 0x73,
80 0x95, 0x72, 0x37, 0x02, 0xce, 0x01 }
82 { 12000000, 7000000, {
83 0x01, 0x94, 0x8b, 0x10, 0x00, 0xca, 0x45, 0x88, 0x00, 0x65,
84 0x25, 0xed, 0x00, 0x65, 0x22, 0xc4, 0x00, 0x65, 0x1f, 0x9b,
85 0x00, 0x32, 0x91, 0x62, 0x00, 0xca, 0x45, 0x88, 0x00, 0x65,
86 0x22, 0xc4, 0x88, 0x02, 0x95, 0x01 }
88 { 12000000, 6000000, {
89 0x01, 0x5a, 0xc0, 0x56, 0x00, 0xad, 0x60, 0x2b, 0x00, 0x56,
90 0xb2, 0xcb, 0x00, 0x56, 0xb0, 0x15, 0x00, 0x56, 0xad, 0x60,
91 0x00, 0x2b, 0x58, 0x0b, 0x00, 0xad, 0x60, 0x2b, 0x00, 0x56,
92 0xb0, 0x15, 0xf4, 0x02, 0x5b, 0x01 }
96 /* QPSK SNR lookup table */
97 static const struct val_snr qpsk_snr_lut[] = {
124 /* QAM16 SNR lookup table */
125 static const struct val_snr qam16_snr_lut[] = {
155 /* QAM64 SNR lookup table */
156 static const struct val_snr qam64_snr_lut[] = {
192 static const struct reg_val ofsm_init[] = {
303 /* Infineon TUA 9001 tuner init
304 AF9033_TUNER_TUA9001 = 0x27 */
305 static const struct reg_val tuner_init_tua9001[] = {
345 /* Fitipower fc0011 tuner init
346 AF9033_TUNER_FC0011 = 0x28 */
347 static const struct reg_val tuner_init_fc0011[] = {
406 /* Fitipower FC0012 tuner init
407 AF9033_TUNER_FC0012 = 0x2e */
408 static const struct reg_val tuner_init_fc0012[] = {
449 /* MaxLinear MxL5007T tuner init
450 AF9033_TUNER_MXL5007T = 0xa0 */
451 static const struct reg_val tuner_init_mxl5007t[] = {
484 /* NXP TDA 18218HN tuner init
485 AF9033_TUNER_TDA18218 = 0xa1 */
486 static const struct reg_val tuner_init_tda18218[] = {
518 /* FCI FC2580 tuner init */
519 static const struct reg_val tuner_init_fc2580[] = {
556 static const struct reg_val ofsm_init_it9135_v1[] = {
667 /* ITE Tech IT9135 Omega tuner init
668 AF9033_TUNER_IT9135_38 = 0x38 */
669 static const struct reg_val tuner_init_it9135_38[] = {
884 /* ITE Tech IT9135 Omega LNA config 1 tuner init
885 AF9033_TUNER_IT9135_51 = 0x51 */
886 static const struct reg_val tuner_init_it9135_51[] = {
1101 /* ITE Tech IT9135 Omega LNA config 2 tuner init
1102 AF9033_TUNER_IT9135_52 = 0x52 */
1103 static const struct reg_val tuner_init_it9135_52[] = {
1318 static const struct reg_val ofsm_init_it9135_v2[] = {
1416 /* ITE Tech IT9135 Omega v2 tuner init
1417 AF9033_TUNER_IT9135_60 = 0x60 */
1418 static const struct reg_val tuner_init_it9135_60[] = {
1630 /* ITE Tech IT9135 Omega v2 LNA config 1 tuner init
1631 AF9033_TUNER_IT9135_61 = 0x61 */
1632 static const struct reg_val tuner_init_it9135_61[] = {
1844 /* ITE Tech IT9135 Omega v2 LNA config 2 tuner init
1845 AF9033_TUNER_IT9135_62 = 0x62 */
1846 static const struct reg_val tuner_init_it9135_62[] = {
2059 /* NorDig power reference table */
2060 static const int power_reference[][5] = {
2061 {-93, -91, -90, -89, -88}, /* QPSK 1/2 ~ 7/8 */
2062 {-87, -85, -84, -83, -82}, /* 16QAM 1/2 ~ 7/8 */
2063 {-82, -80, -78, -77, -76}, /* 64QAM 1/2 ~ 7/8 */
2065 #endif /* AF9033_PRIV_H */