aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb/dib0700_devices.c
diff options
context:
space:
mode:
authorOlivier Grenie <Olivier.Grenie@dibcom.fr>2009-12-07 05:49:40 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-15 21:18:16 -0500
commit9c78303681278b983fac3c6c3c0aa3f93cf2ffa8 (patch)
tree1407987d9fa1d4234c46fcab6d22da1997e303a2 /drivers/media/dvb/dvb-usb/dib0700_devices.c
parent03245a5ee69a5faa99b020fe1aca9bafe10c46a9 (diff)
V4L/DVB (13584): DiBXXX0: fix most of the Codingstyle violations from the previous patch
This patch changes most of the Codingstyle violations which were introduced by the previous patch. Line length less that 80 chars are not corrected. Signed-off-by: Olivier Grenie <Olivier.Grenie@dibcom.fr> Signed-off-by: Patrick Boettcher <pboettcher@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/dvb-usb/dib0700_devices.c')
-rw-r--r--drivers/media/dvb/dvb-usb/dib0700_devices.c596
1 files changed, 301 insertions, 295 deletions
diff --git a/drivers/media/dvb/dvb-usb/dib0700_devices.c b/drivers/media/dvb/dvb-usb/dib0700_devices.c
index 80a126354477..d4673c71dff5 100644
--- a/drivers/media/dvb/dvb-usb/dib0700_devices.c
+++ b/drivers/media/dvb/dvb-usb/dib0700_devices.c
@@ -131,93 +131,95 @@ static int bristol_tuner_attach(struct dvb_usb_adapter *adap)
131/* MT226x */ 131/* MT226x */
132static struct dibx000_agc_config stk7700d_7000p_mt2266_agc_config[2] = { 132static struct dibx000_agc_config stk7700d_7000p_mt2266_agc_config[2] = {
133 { 133 {
134 BAND_UHF, // band_caps 134 BAND_UHF,
135 135
136 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=1, P_agc_inv_pwm1=1, P_agc_inv_pwm2=1, 136 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=1, P_agc_inv_pwm1=1, P_agc_inv_pwm2=1,
137 * P_agc_inh_dc_rv_est=0, P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=2, P_agc_write=0 */ 137 * P_agc_inh_dc_rv_est=0, P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=2, P_agc_write=0 */
138 (0 << 15) | (0 << 14) | (1 << 11) | (1 << 10) | (1 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0), // setup 138 (0 << 15) | (0 << 14) | (1 << 11) | (1 << 10) | (1 << 9) | (0 << 8)
139 139 | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0),
140 1130, // inv_gain 140
141 21, // time_stabiliz 141 1130,
142 142 21,
143 0, // alpha_level 143
144 118, // thlock 144 0,
145 145 118,
146 0, // wbd_inv 146
147 3530, // wbd_ref 147 0,
148 1, // wbd_sel 148 3530,
149 0, // wbd_alpha 149 1,
150 150 0,
151 65535, // agc1_max 151
152 33770, // agc1_min 152 65535,
153 65535, // agc2_max 153 33770,
154 23592, // agc2_min 154 65535,
155 155 23592,
156 0, // agc1_pt1 156
157 62, // agc1_pt2 157 0,
158 255, // agc1_pt3 158 62,
159 64, // agc1_slope1 159 255,
160 64, // agc1_slope2 160 64,
161 132, // agc2_pt1 161 64,
162 192, // agc2_pt2 162 132,
163 80, // agc2_slope1 163 192,
164 80, // agc2_slope2 164 80,
165 165 80,
166 17, // alpha_mant 166
167 27, // alpha_exp 167 17,
168 23, // beta_mant 168 27,
169 51, // beta_exp 169 23,
170 170 51,
171 1, // perform_agc_softsplit 171
172 1,
172 }, { 173 }, {
173 BAND_VHF | BAND_LBAND, // band_caps 174 BAND_VHF | BAND_LBAND,
174 175
175 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=1, P_agc_inv_pwm1=1, P_agc_inv_pwm2=1, 176 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=1, P_agc_inv_pwm1=1, P_agc_inv_pwm2=1,
176 * P_agc_inh_dc_rv_est=0, P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=2, P_agc_write=0 */ 177 * P_agc_inh_dc_rv_est=0, P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=2, P_agc_write=0 */
177 (0 << 15) | (0 << 14) | (1 << 11) | (1 << 10) | (1 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), // setup 178 (0 << 15) | (0 << 14) | (1 << 11) | (1 << 10) | (1 << 9) | (0 << 8)
178 179 | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0),
179 2372, // inv_gain 180
180 21, // time_stabiliz 181 2372,
181 182 21,
182 0, // alpha_level 183
183 118, // thlock 184 0,
184 185 118,
185 0, // wbd_inv 186
186 3530, // wbd_ref 187 0,
187 1, // wbd_sel 188 3530,
188 0, // wbd_alpha 189 1,
189 190 0,
190 65535, // agc1_max 191
191 0, // agc1_min 192 65535,
192 65535, // agc2_max 193 0,
193 23592, // agc2_min 194 65535,
194 195 23592,
195 0, // agc1_pt1 196
196 128, // agc1_pt2 197 0,
197 128, // agc1_pt3 198 128,
198 128, // agc1_slope1 199 128,
199 0, // agc1_slope2 200 128,
200 128, // agc2_pt1 201 0,
201 253, // agc2_pt2 202 128,
202 81, // agc2_slope1 203 253,
203 0, // agc2_slope2 204 81,
204 205 0,
205 17, // alpha_mant 206
206 27, // alpha_exp 207 17,
207 23, // beta_mant 208 27,
208 51, // beta_exp 209 23,
209 210 51,
210 1, // perform_agc_softsplit 211
212 1,
211 } 213 }
212}; 214};
213 215
214static struct dibx000_bandwidth_config stk7700d_mt2266_pll_config = { 216static struct dibx000_bandwidth_config stk7700d_mt2266_pll_config = {
215 60000, 30000, // internal, sampling 217 60000, 30000,
216 1, 8, 3, 1, 0, // pll_cfg: prediv, ratio, range, reset, bypass 218 1, 8, 3, 1, 0,
217 0, 0, 1, 1, 2, // misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc, modulo 219 0, 0, 1, 1, 2,
218 (3 << 14) | (1 << 12) | (524 << 0), // sad_cfg: refsel, sel, freq_15k 220 (3 << 14) | (1 << 12) | (524 << 0),
219 0, // ifreq 221 0,
220 20452225, // timf 222 20452225,
221}; 223};
222 224
223static struct dib7000p_config stk7700d_dib7000p_mt2266_config[] = { 225static struct dib7000p_config stk7700d_dib7000p_mt2266_config[] = {
@@ -934,47 +936,48 @@ static struct dvb_usb_rc_key dib0700_rc_keys[] = {
934 936
935/* STK7700P: Hauppauge Nova-T Stick, AVerMedia Volar */ 937/* STK7700P: Hauppauge Nova-T Stick, AVerMedia Volar */
936static struct dibx000_agc_config stk7700p_7000m_mt2060_agc_config = { 938static struct dibx000_agc_config stk7700p_7000m_mt2060_agc_config = {
937 BAND_UHF | BAND_VHF, // band_caps 939 BAND_UHF | BAND_VHF,
938 940
939 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=5, P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, 941 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=5, P_agc_inv_pwm1=0, P_agc_inv_pwm2=0,
940 * P_agc_inh_dc_rv_est=0, P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=2, P_agc_write=0 */ 942 * P_agc_inh_dc_rv_est=0, P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=2, P_agc_write=0 */
941 (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), // setup 943 (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8)
942 944 | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0),
943 712, // inv_gain 945
944 41, // time_stabiliz 946 712,
945 947 41,
946 0, // alpha_level 948
947 118, // thlock 949 0,
948 950 118,
949 0, // wbd_inv 951
950 4095, // wbd_ref 952 0,
951 0, // wbd_sel 953 4095,
952 0, // wbd_alpha 954 0,
953 955 0,
954 42598, // agc1_max 956
955 17694, // agc1_min 957 42598,
956 45875, // agc2_max 958 17694,
957 2621, // agc2_min 959 45875,
958 0, // agc1_pt1 960 2621,
959 76, // agc1_pt2 961 0,
960 139, // agc1_pt3 962 76,
961 52, // agc1_slope1 963 139,
962 59, // agc1_slope2 964 52,
963 107, // agc2_pt1 965 59,
964 172, // agc2_pt2 966 107,
965 57, // agc2_slope1 967 172,
966 70, // agc2_slope2 968 57,
967 969 70,
968 21, // alpha_mant 970
969 25, // alpha_exp 971 21,
970 28, // beta_mant 972 25,
971 48, // beta_exp 973 28,
972 974 48,
973 1, // perform_agc_softsplit 975
974 { 0, // split_min 976 1,
975 107, // split_max 977 { 0,
976 51800, // global_split_min 978 107,
977 24700 // global_split_max 979 51800,
980 24700
978 }, 981 },
979}; 982};
980 983
@@ -983,54 +986,55 @@ static struct dibx000_agc_config stk7700p_7000p_mt2060_agc_config = {
983 986
984 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=5, P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, 987 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=5, P_agc_inv_pwm1=0, P_agc_inv_pwm2=0,
985 * P_agc_inh_dc_rv_est=0, P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=2, P_agc_write=0 */ 988 * P_agc_inh_dc_rv_est=0, P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=2, P_agc_write=0 */
986 (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), // setup 989 (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8)
990 | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0),
987 991
988 712, // inv_gain 992 712,
989 41, // time_stabiliz 993 41,
990 994
991 0, // alpha_level 995 0,
992 118, // thlock 996 118,
993 997
994 0, // wbd_inv 998 0,
995 4095, // wbd_ref 999 4095,
996 0, // wbd_sel 1000 0,
997 0, // wbd_alpha 1001 0,
998 1002
999 42598, // agc1_max 1003 42598,
1000 16384, // agc1_min 1004 16384,
1001 42598, // agc2_max 1005 42598,
1002 0, // agc2_min 1006 0,
1003 1007
1004 0, // agc1_pt1 1008 0,
1005 137, // agc1_pt2 1009 137,
1006 255, // agc1_pt3 1010 255,
1007 1011
1008 0, // agc1_slope1 1012 0,
1009 255, // agc1_slope2 1013 255,
1010 1014
1011 0, // agc2_pt1 1015 0,
1012 0, // agc2_pt2 1016 0,
1013 1017
1014 0, // agc2_slope1 1018 0,
1015 41, // agc2_slope2 1019 41,
1016 1020
1017 15, // alpha_mant 1021 15,
1018 25, // alpha_exp 1022 25,
1019 1023
1020 28, // beta_mant 1024 28,
1021 48, // beta_exp 1025 48,
1022 1026
1023 0, // perform_agc_softsplit 1027 0,
1024}; 1028};
1025 1029
1026static struct dibx000_bandwidth_config stk7700p_pll_config = { 1030static struct dibx000_bandwidth_config stk7700p_pll_config = {
1027 60000, 30000, // internal, sampling 1031 60000, 30000,
1028 1, 8, 3, 1, 0, // pll_cfg: prediv, ratio, range, reset, bypass 1032 1, 8, 3, 1, 0,
1029 0, 0, 1, 1, 0, // misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc, modulo 1033 0, 0, 1, 1, 0,
1030 (3 << 14) | (1 << 12) | (524 << 0), // sad_cfg: refsel, sel, freq_15k 1034 (3 << 14) | (1 << 12) | (524 << 0),
1031 60258167, // ifreq 1035 60258167,
1032 20452225, // timf 1036 20452225,
1033 30000000, // xtal 1037 30000000,
1034}; 1038};
1035 1039
1036static struct dib7000m_config stk7700p_dib7000m_config = { 1040static struct dib7000m_config stk7700p_dib7000m_config = {
@@ -1116,41 +1120,42 @@ static struct dibx000_agc_config dib7070_agc_config = {
1116 BAND_UHF | BAND_VHF | BAND_LBAND | BAND_SBAND, 1120 BAND_UHF | BAND_VHF | BAND_LBAND | BAND_SBAND,
1117 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=5, P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, 1121 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=5, P_agc_inv_pwm1=0, P_agc_inv_pwm2=0,
1118 * P_agc_inh_dc_rv_est=0, P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5, P_agc_write=0 */ 1122 * P_agc_inh_dc_rv_est=0, P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5, P_agc_write=0 */
1119 (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0), // setup 1123 (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8)
1120 1124 | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0),
1121 600, // inv_gain 1125
1122 10, // time_stabiliz 1126 600,
1123 1127 10,
1124 0, // alpha_level 1128
1125 118, // thlock 1129 0,
1126 1130 118,
1127 0, // wbd_inv 1131
1128 3530, // wbd_ref 1132 0,
1129 1, // wbd_sel 1133 3530,
1130 5, // wbd_alpha 1134 1,
1131 1135 5,
1132 65535, // agc1_max 1136
1133 0, // agc1_min 1137 65535,
1134 1138 0,
1135 65535, // agc2_max 1139
1136 0, // agc2_min 1140 65535,
1137 1141 0,
1138 0, // agc1_pt1 1142
1139 40, // agc1_pt2 1143 0,
1140 183, // agc1_pt3 1144 40,
1141 206, // agc1_slope1 1145 183,
1142 255, // agc1_slope2 1146 206,
1143 72, // agc2_pt1 1147 255,
1144 152, // agc2_pt2 1148 72,
1145 88, // agc2_slope1 1149 152,
1146 90, // agc2_slope2 1150 88,
1147 1151 90,
1148 17, // alpha_mant 1152
1149 27, // alpha_exp 1153 17,
1150 23, // beta_mant 1154 27,
1151 51, // beta_exp 1155 23,
1152 1156 51,
1153 0, // perform_agc_softsplit 1157
1158 0,
1154}; 1159};
1155 1160
1156static int dib7070_tuner_reset(struct dvb_frontend *fe, int onoff) 1161static int dib7070_tuner_reset(struct dvb_frontend *fe, int onoff)
@@ -1277,13 +1282,13 @@ static int stk70x0p_pid_filter_ctrl(struct dvb_usb_adapter *adapter, int onoff)
1277} 1282}
1278 1283
1279static struct dibx000_bandwidth_config dib7070_bw_config_12_mhz = { 1284static struct dibx000_bandwidth_config dib7070_bw_config_12_mhz = {
1280 60000, 15000, // internal, sampling 1285 60000, 15000,
1281 1, 20, 3, 1, 0, // pll_cfg: prediv, ratio, range, reset, bypass 1286 1, 20, 3, 1, 0,
1282 0, 0, 1, 1, 2, // misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc, modulo 1287 0, 0, 1, 1, 2,
1283 (3 << 14) | (1 << 12) | (524 << 0), // sad_cfg: refsel, sel, freq_15k 1288 (3 << 14) | (1 << 12) | (524 << 0),
1284 (0 << 25) | 0, // ifreq = 0.000000 MHz 1289 (0 << 25) | 0,
1285 20452225, // timf 1290 20452225,
1286 12000000, // xtal_hz 1291 12000000,
1287}; 1292};
1288 1293
1289static struct dib7000p_config dib7070p_dib7000p_config = { 1294static struct dib7000p_config dib7070p_dib7000p_config = {
@@ -1567,12 +1572,14 @@ static int dib807x_tuner_attach(struct dvb_usb_adapter *adap)
1567 return 0; 1572 return 0;
1568} 1573}
1569 1574
1570static int stk80xx_pid_filter(struct dvb_usb_adapter *adapter, int index, u16 pid, int onoff) 1575static int stk80xx_pid_filter(struct dvb_usb_adapter *adapter, int index,
1576 u16 pid, int onoff)
1571{ 1577{
1572 return dib8000_pid_filter(adapter->fe, index, pid, onoff); 1578 return dib8000_pid_filter(adapter->fe, index, pid, onoff);
1573} 1579}
1574 1580
1575static int stk80xx_pid_filter_ctrl(struct dvb_usb_adapter *adapter, int onoff) 1581static int stk80xx_pid_filter_ctrl(struct dvb_usb_adapter *adapter,
1582 int onoff)
1576{ 1583{
1577 return dib8000_pid_filter_ctrl(adapter->fe, onoff); 1584 return dib8000_pid_filter_ctrl(adapter->fe, onoff);
1578} 1585}
@@ -1648,94 +1655,98 @@ static int stk807xpvr_frontend_attach1(struct dvb_usb_adapter *adap)
1648struct dibx000_agc_config dib8090_agc_config[2] = { 1655struct dibx000_agc_config dib8090_agc_config[2] = {
1649 { 1656 {
1650 BAND_UHF | BAND_VHF | BAND_LBAND | BAND_SBAND, 1657 BAND_UHF | BAND_VHF | BAND_LBAND | BAND_SBAND,
1651 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=1, P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, 1658 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=1,
1652 * P_agc_inh_dc_rv_est=0, P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5, P_agc_write=0 */ 1659 * P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0,
1653 (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0), // setup 1660 * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5, P_agc_write=0 */
1654 1661 (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8)
1655 787,// inv_gain = 1/ 90.4dB // no boost, lower gain due to ramp quantification 1662 | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0),
1656 10, // time_stabiliz 1663
1657 1664 787,
1658 0, // alpha_level 1665 10,
1659 118, // thlock 1666
1660 1667 0,
1661 0, // wbd_inv 1668 118,
1662 3530, // wbd_ref 1669
1663 1, // wbd_sel 1670 0,
1664 5, // wbd_alpha 1671 3530,
1665 1672 1,
1666 65535, // agc1_max 1673 5,
1667 0, // agc1_min 1674
1668 1675 65535,
1669 65535, // agc2_max 1676 0,
1670 0, // agc2_min 1677
1671 1678 65535,
1672 0, // agc1_pt1 1679 0,
1673 32, // agc1_pt2 1680
1674 114, // agc1_pt3 // 40.4dB 1681 0,
1675 143, // agc1_slope1 1682 32,
1676 144, // agc1_slope2 1683 114,
1677 114, // agc2_pt1 1684 143,
1678 227, // agc2_pt2 1685 144,
1679 116, // agc2_slope1 1686 114,
1680 117, // agc2_slope2 1687 227,
1681 1688 116,
1682 28, // alpha_mant // 5Hz with 90.2dB 1689 117,
1683 26, // alpha_exp 1690
1684 31, // beta_mant 1691 28,
1685 51, // beta_exp 1692 26,
1686 1693 31,
1687 0, // perform_agc_softsplit 1694 51,
1695
1696 0,
1688 }, 1697 },
1689 { 1698 {
1690 BAND_CBAND, 1699 BAND_CBAND,
1691 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=1, P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, 1700 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=1,
1692 * P_agc_inh_dc_rv_est=0, P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5, P_agc_write=0 */ 1701 * P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0,
1693 (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0), // setup 1702 * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5, P_agc_write=0 */
1694 1703 (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8)
1695 787,// inv_gain = 1/ 90.4dB // no boost, lower gain due to ramp quantification 1704 | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0),
1696 10, // time_stabiliz 1705
1697 1706 787,
1698 0, // alpha_level 1707 10,
1699 118, // thlock 1708
1700 1709 0,
1701 0, // wbd_inv 1710 118,
1702 3530, // wbd_ref 1711
1703 1, // wbd_sel 1712 0,
1704 5, // wbd_alpha 1713 3530,
1705 1714 1,
1706 0, // agc1_max 1715 5,
1707 0, // agc1_min 1716
1708 1717 0,
1709 65535, // agc2_max 1718 0,
1710 0, // agc2_min 1719
1711 1720 65535,
1712 0, // agc1_pt1 1721 0,
1713 32, // agc1_pt2 1722
1714 114, // agc1_pt3 // 40.4dB 1723 0,
1715 143, // agc1_slope1 1724 32,
1716 144, // agc1_slope2 1725 114,
1717 114, // agc2_pt1 1726 143,
1718 227, // agc2_pt2 1727 144,
1719 116, // agc2_slope1 1728 114,
1720 117, // agc2_slope2 1729 227,
1721 1730 116,
1722 28, // alpha_mant // 5Hz with 90.2dB 1731 117,
1723 26, // alpha_exp 1732
1724 31, // beta_mant 1733 28,
1725 51, // beta_exp 1734 26,
1726 1735 31,
1727 0, // perform_agc_softsplit 1736 51,
1737
1738 0,
1728 } 1739 }
1729}; 1740};
1730 1741
1731static struct dibx000_bandwidth_config dib8090_pll_config_12mhz = { 1742static struct dibx000_bandwidth_config dib8090_pll_config_12mhz = {
1732 54000, 13500, // internal, sampling 1743 54000, 13500,
1733 1, 18, 3, 1, 0, // pll_cfg: prediv, ratio, range, reset, bypass 1744 1, 18, 3, 1, 0,
1734 0, 0, 1, 1, 2, // misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc, modulo 1745 0, 0, 1, 1, 2,
1735 (3 << 14) | (1 << 12) | (599 << 0), // sad_cfg: refsel, sel, freq_15k 1746 (3 << 14) | (1 << 12) | (599 << 0),
1736 (0 << 25) | 0, // ifreq = 0 MHz 1747 (0 << 25) | 0,
1737 20199727, // timf 1748 20199727,
1738 12000000, // xtal_hz 1749 12000000,
1739}; 1750};
1740 1751
1741static int dib8090_get_adc_power(struct dvb_frontend *fe) 1752static int dib8090_get_adc_power(struct dvb_frontend *fe)
@@ -1802,13 +1813,13 @@ static int dib8096_set_param_override(struct dvb_frontend *fe,
1802 return ret; 1813 return ret;
1803 1814
1804 switch (band) { 1815 switch (band) {
1805 case BAND_VHF: 1816 case BAND_VHF:
1806 offset = 100; 1817 offset = 100;
1807 break; 1818 break;
1808 case BAND_UHF: 1819 case BAND_UHF:
1809 offset = 550; 1820 offset = 550;
1810 break; 1821 break;
1811 default: 1822 default:
1812 offset = 0; 1823 offset = 0;
1813 break; 1824 break;
1814 } 1825 }
@@ -1816,31 +1827,26 @@ static int dib8096_set_param_override(struct dvb_frontend *fe,
1816 dib8000_set_wbd_ref(fe, offset); 1827 dib8000_set_wbd_ref(fe, offset);
1817 1828
1818 1829
1819 if (band == BAND_CBAND) 1830 if (band == BAND_CBAND) {
1820 {
1821 deb_info("tuning in CBAND - soft-AGC startup\n"); 1831 deb_info("tuning in CBAND - soft-AGC startup\n");
1822 /* TODO specific wbd target for dib0090 - needed for startup ? */ 1832 /* TODO specific wbd target for dib0090 - needed for startup ? */
1823 dib0090_set_tune_state(fe, CT_AGC_START); 1833 dib0090_set_tune_state(fe, CT_AGC_START);
1824 do 1834 do {
1825 { 1835 ret = dib0090_gain_control(fe);
1826 ret = dib0090_gain_control(fe); 1836 msleep(ret);
1827 msleep(ret); 1837 tune_state = dib0090_get_tune_state(fe);
1828 tune_state = dib0090_get_tune_state(fe); 1838 if (tune_state == CT_AGC_STEP_0)
1829 if (tune_state == CT_AGC_STEP_0) 1839 dib8000_set_gpio(fe, 6, 0, 1);
1830 dib8000_set_gpio(fe, 6, 0, 1); 1840 else if (tune_state == CT_AGC_STEP_1) {
1831 else if (tune_state == CT_AGC_STEP_1) 1841 dib0090_get_current_gain(fe, NULL, NULL, &rf_gain_limit, &ltgain);
1832 { 1842 if (rf_gain_limit == 0)
1833 dib0090_get_current_gain(fe, NULL, NULL, &rf_gain_limit, &ltgain); 1843 dib8000_set_gpio(fe, 6, 0, 0);
1834 if (rf_gain_limit == 0) 1844 }
1835 dib8000_set_gpio(fe, 6, 0, 0); 1845 } while (tune_state < CT_AGC_STOP);
1836 }
1837 }
1838 while(tune_state<CT_AGC_STOP);
1839 dib0090_pwm_gain_reset(fe); 1846 dib0090_pwm_gain_reset(fe);
1840 dib8000_pwm_agc_reset(fe); 1847 dib8000_pwm_agc_reset(fe);
1841 dib8000_set_tune_state(fe, CT_DEMOD_START); 1848 dib8000_set_tune_state(fe, CT_DEMOD_START);
1842 } 1849 } else {
1843 else {
1844 deb_info("not tuning in CBAND - standard AGC startup\n"); 1850 deb_info("not tuning in CBAND - standard AGC startup\n");
1845 dib0090_pwm_gain_reset(fe); 1851 dib0090_pwm_gain_reset(fe);
1846 } 1852 }