1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Afatech AF9033 demodulator driver
5 * Copyright (C) 2009 Antti Palosaari <crope@iki.fi>
6 * Copyright (C) 2012 Antti Palosaari <crope@iki.fi>
12 #include <media/dvb_frontend.h>
14 #include <linux/math64.h>
15 #include <linux/regmap.h>
16 #include <linux/kernel.h>
17 #include <media/dvb_math.h>
46 /* Xtal clock vs. ADC clock lookup table */
47 static const struct clock_adc clock_adc_lut
[] = {
48 { 16384000, 20480000 },
49 { 20480000, 20480000 },
50 { 36000000, 20250000 },
51 { 30000000, 20156250 },
52 { 26000000, 20583333 },
53 { 28000000, 20416667 },
54 { 32000000, 20500000 },
55 { 34000000, 20187500 },
56 { 24000000, 20500000 },
57 { 22000000, 20625000 },
58 { 12000000, 20250000 },
61 /* Pre-calculated coeff lookup table */
62 static const struct coeff coeff_lut
[] = {
64 { 12000000, 8000000, {
65 0x01, 0xce, 0x55, 0xc9, 0x00, 0xe7, 0x2a, 0xe4, 0x00, 0x73,
66 0x99, 0x0f, 0x00, 0x73, 0x95, 0x72, 0x00, 0x73, 0x91, 0xd5,
67 0x00, 0x39, 0xca, 0xb9, 0x00, 0xe7, 0x2a, 0xe4, 0x00, 0x73,
68 0x95, 0x72, 0x37, 0x02, 0xce, 0x01 }
70 { 12000000, 7000000, {
71 0x01, 0x94, 0x8b, 0x10, 0x00, 0xca, 0x45, 0x88, 0x00, 0x65,
72 0x25, 0xed, 0x00, 0x65, 0x22, 0xc4, 0x00, 0x65, 0x1f, 0x9b,
73 0x00, 0x32, 0x91, 0x62, 0x00, 0xca, 0x45, 0x88, 0x00, 0x65,
74 0x22, 0xc4, 0x88, 0x02, 0x95, 0x01 }
76 { 12000000, 6000000, {
77 0x01, 0x5a, 0xc0, 0x56, 0x00, 0xad, 0x60, 0x2b, 0x00, 0x56,
78 0xb2, 0xcb, 0x00, 0x56, 0xb0, 0x15, 0x00, 0x56, 0xad, 0x60,
79 0x00, 0x2b, 0x58, 0x0b, 0x00, 0xad, 0x60, 0x2b, 0x00, 0x56,
80 0xb0, 0x15, 0xf4, 0x02, 0x5b, 0x01 }
85 * Afatech AF9033 demod init
87 static const struct reg_val ofsm_init
[] = {
199 * Infineon TUA 9001 tuner init
200 * AF9033_TUNER_TUA9001 = 0x27
202 static const struct reg_val tuner_init_tua9001
[] = {
243 * Fitipower FC0011 tuner init
244 * AF9033_TUNER_FC0011 = 0x28
246 static const struct reg_val tuner_init_fc0011
[] = {
306 * Fitipower FC0012 tuner init
307 * AF9033_TUNER_FC0012 = 0x2e
309 static const struct reg_val tuner_init_fc0012
[] = {
351 * MaxLinear MxL5007T tuner init
352 * AF9033_TUNER_MXL5007T = 0xa0
354 static const struct reg_val tuner_init_mxl5007t
[] = {
388 * NXP TDA18218HN tuner init
389 * AF9033_TUNER_TDA18218 = 0xa1
391 static const struct reg_val tuner_init_tda18218
[] = {
424 * FCI FC2580 tuner init
425 * AF9033_TUNER_FC2580 = 0x32
427 static const struct reg_val tuner_init_fc2580
[] = {
465 * IT9133 AX demod init
467 static const struct reg_val ofsm_init_it9135_v1
[] = {
579 * ITE Tech IT9133 AX Omega tuner init
580 * AF9033_TUNER_IT9135_38 = 0x38
582 static const struct reg_val tuner_init_it9135_38
[] = {
798 * ITE Tech IT9133 AX Omega LNA config 1 tuner init
799 * AF9033_TUNER_IT9135_51 = 0x51
801 static const struct reg_val tuner_init_it9135_51
[] = {
1017 * ITE Tech IT9133 AX Omega LNA config 2 tuner init
1018 * AF9033_TUNER_IT9135_52 = 0x52
1020 static const struct reg_val tuner_init_it9135_52
[] = {
1236 * ITE Tech IT9133 BX demod init
1238 static const struct reg_val ofsm_init_it9135_v2
[] = {
1337 * ITE Tech IT9133 BX Omega tuner init
1338 * AF9033_TUNER_IT9135_60 = 0x60
1340 static const struct reg_val tuner_init_it9135_60
[] = {
1553 * ITE Tech IT9133 BX Omega LNA config 1 tuner init
1554 * AF9033_TUNER_IT9135_61 = 0x61
1556 static const struct reg_val tuner_init_it9135_61
[] = {
1769 * ITE Tech IT9133 BX Omega LNA config 2 tuner init
1770 * AF9033_TUNER_IT9135_62 = 0x62
1772 static const struct reg_val tuner_init_it9135_62
[] = {
1985 /* NorDig power reference table */
1986 static const int power_reference
[][5] = {
1987 {-93, -91, -90, -89, -88}, /* QPSK 1/2 ~ 7/8 */
1988 {-87, -85, -84, -83, -82}, /* 16QAM 1/2 ~ 7/8 */
1989 {-82, -80, -78, -77, -76}, /* 64QAM 1/2 ~ 7/8 */
1991 #endif /* AF9033_PRIV_H */