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.
21 #include <media/dvb_frontend.h>
23 #include <linux/math64.h>
24 #include <linux/regmap.h>
25 #include <linux/kernel.h>
26 #include <media/dvb_math.h>
55 /* Xtal clock vs. ADC clock lookup table */
56 static const struct clock_adc clock_adc_lut
[] = {
57 { 16384000, 20480000 },
58 { 20480000, 20480000 },
59 { 36000000, 20250000 },
60 { 30000000, 20156250 },
61 { 26000000, 20583333 },
62 { 28000000, 20416667 },
63 { 32000000, 20500000 },
64 { 34000000, 20187500 },
65 { 24000000, 20500000 },
66 { 22000000, 20625000 },
67 { 12000000, 20250000 },
70 /* Pre-calculated coeff lookup table */
71 static const struct coeff coeff_lut
[] = {
73 { 12000000, 8000000, {
74 0x01, 0xce, 0x55, 0xc9, 0x00, 0xe7, 0x2a, 0xe4, 0x00, 0x73,
75 0x99, 0x0f, 0x00, 0x73, 0x95, 0x72, 0x00, 0x73, 0x91, 0xd5,
76 0x00, 0x39, 0xca, 0xb9, 0x00, 0xe7, 0x2a, 0xe4, 0x00, 0x73,
77 0x95, 0x72, 0x37, 0x02, 0xce, 0x01 }
79 { 12000000, 7000000, {
80 0x01, 0x94, 0x8b, 0x10, 0x00, 0xca, 0x45, 0x88, 0x00, 0x65,
81 0x25, 0xed, 0x00, 0x65, 0x22, 0xc4, 0x00, 0x65, 0x1f, 0x9b,
82 0x00, 0x32, 0x91, 0x62, 0x00, 0xca, 0x45, 0x88, 0x00, 0x65,
83 0x22, 0xc4, 0x88, 0x02, 0x95, 0x01 }
85 { 12000000, 6000000, {
86 0x01, 0x5a, 0xc0, 0x56, 0x00, 0xad, 0x60, 0x2b, 0x00, 0x56,
87 0xb2, 0xcb, 0x00, 0x56, 0xb0, 0x15, 0x00, 0x56, 0xad, 0x60,
88 0x00, 0x2b, 0x58, 0x0b, 0x00, 0xad, 0x60, 0x2b, 0x00, 0x56,
89 0xb0, 0x15, 0xf4, 0x02, 0x5b, 0x01 }
94 * Afatech AF9033 demod init
96 static const struct reg_val ofsm_init
[] = {
208 * Infineon TUA 9001 tuner init
209 * AF9033_TUNER_TUA9001 = 0x27
211 static const struct reg_val tuner_init_tua9001
[] = {
252 * Fitipower FC0011 tuner init
253 * AF9033_TUNER_FC0011 = 0x28
255 static const struct reg_val tuner_init_fc0011
[] = {
315 * Fitipower FC0012 tuner init
316 * AF9033_TUNER_FC0012 = 0x2e
318 static const struct reg_val tuner_init_fc0012
[] = {
360 * MaxLinear MxL5007T tuner init
361 * AF9033_TUNER_MXL5007T = 0xa0
363 static const struct reg_val tuner_init_mxl5007t
[] = {
397 * NXP TDA18218HN tuner init
398 * AF9033_TUNER_TDA18218 = 0xa1
400 static const struct reg_val tuner_init_tda18218
[] = {
433 * FCI FC2580 tuner init
434 * AF9033_TUNER_FC2580 = 0x32
436 static const struct reg_val tuner_init_fc2580
[] = {
474 * IT9133 AX demod init
476 static const struct reg_val ofsm_init_it9135_v1
[] = {
588 * ITE Tech IT9133 AX Omega tuner init
589 * AF9033_TUNER_IT9135_38 = 0x38
591 static const struct reg_val tuner_init_it9135_38
[] = {
807 * ITE Tech IT9133 AX Omega LNA config 1 tuner init
808 * AF9033_TUNER_IT9135_51 = 0x51
810 static const struct reg_val tuner_init_it9135_51
[] = {
1026 * ITE Tech IT9133 AX Omega LNA config 2 tuner init
1027 * AF9033_TUNER_IT9135_52 = 0x52
1029 static const struct reg_val tuner_init_it9135_52
[] = {
1245 * ITE Tech IT9133 BX demod init
1247 static const struct reg_val ofsm_init_it9135_v2
[] = {
1346 * ITE Tech IT9133 BX Omega tuner init
1347 * AF9033_TUNER_IT9135_60 = 0x60
1349 static const struct reg_val tuner_init_it9135_60
[] = {
1562 * ITE Tech IT9133 BX Omega LNA config 1 tuner init
1563 * AF9033_TUNER_IT9135_61 = 0x61
1565 static const struct reg_val tuner_init_it9135_61
[] = {
1778 * ITE Tech IT9133 BX Omega LNA config 2 tuner init
1779 * AF9033_TUNER_IT9135_62 = 0x62
1781 static const struct reg_val tuner_init_it9135_62
[] = {
1994 /* NorDig power reference table */
1995 static const int power_reference
[][5] = {
1996 {-93, -91, -90, -89, -88}, /* QPSK 1/2 ~ 7/8 */
1997 {-87, -85, -84, -83, -82}, /* 16QAM 1/2 ~ 7/8 */
1998 {-82, -80, -78, -77, -76}, /* 64QAM 1/2 ~ 7/8 */
2000 #endif /* AF9033_PRIV_H */