diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-07-23 11:16:26 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-01-04 19:49:04 -0500 |
commit | b52e7c768724bde20669f37f37290922de348151 (patch) | |
tree | db84d41e66b0a5390e68b4828912274f201191a4 /drivers/media/common/tuners/mt2063.c | |
parent | d1244f77d9029938796a6da82b0d184df26d7322 (diff) |
[media] mt2063: add some useful info for the dvb callback calls
The per-delivery system tables are confusing.
Add an extra table that explains them, and some
dprintk calls, that allows to check if mt2063 driver
is working as expected.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/common/tuners/mt2063.c')
-rw-r--r-- | drivers/media/common/tuners/mt2063.c | 68 |
1 files changed, 47 insertions, 21 deletions
diff --git a/drivers/media/common/tuners/mt2063.c b/drivers/media/common/tuners/mt2063.c index de45c9db887d..6f14ee3bb263 100644 --- a/drivers/media/common/tuners/mt2063.c +++ b/drivers/media/common/tuners/mt2063.c | |||
@@ -1008,29 +1008,38 @@ static unsigned int mt2063_lockStatus(struct mt2063_state *state) | |||
1008 | */ | 1008 | */ |
1009 | 1009 | ||
1010 | enum mt2063_delivery_sys { | 1010 | enum mt2063_delivery_sys { |
1011 | MT2063_CABLE_QAM = 0, /* Digital cable */ | 1011 | MT2063_CABLE_QAM = 0, |
1012 | MT2063_CABLE_ANALOG, /* Analog cable */ | 1012 | MT2063_CABLE_ANALOG, |
1013 | MT2063_OFFAIR_COFDM, /* Digital offair */ | 1013 | MT2063_OFFAIR_COFDM, |
1014 | MT2063_OFFAIR_COFDM_SAWLESS, /* Digital offair without SAW */ | 1014 | MT2063_OFFAIR_COFDM_SAWLESS, |
1015 | MT2063_OFFAIR_ANALOG, /* Analog offair */ | 1015 | MT2063_OFFAIR_ANALOG, |
1016 | MT2063_OFFAIR_8VSB, /* Analog offair */ | 1016 | MT2063_OFFAIR_8VSB, |
1017 | MT2063_NUM_RCVR_MODES | 1017 | MT2063_NUM_RCVR_MODES |
1018 | }; | 1018 | }; |
1019 | 1019 | ||
1020 | static const u8 RFAGCEN[] = { 0, 0, 0, 0, 0, 0 }; | 1020 | static const char *mt2063_mode_name[] = { |
1021 | static const u8 LNARIN[] = { 0, 0, 3, 3, 3, 3 }; | 1021 | [MT2063_CABLE_QAM] = "digital cable", |
1022 | static const u8 FIFFQEN[] = { 1, 1, 1, 1, 1, 1 }; | 1022 | [MT2063_CABLE_ANALOG] = "analog cable", |
1023 | static const u8 FIFFQ[] = { 0, 0, 0, 0, 0, 0 }; | 1023 | [MT2063_OFFAIR_COFDM] = "digital offair", |
1024 | static const u8 DNC1GC[] = { 0, 0, 0, 0, 0, 0 }; | 1024 | [MT2063_OFFAIR_COFDM_SAWLESS] = "digital offair without SAW", |
1025 | static const u8 DNC2GC[] = { 0, 0, 0, 0, 0, 0 }; | 1025 | [MT2063_OFFAIR_ANALOG] = "analog offair", |
1026 | static const u8 ACLNAMAX[] = { 31, 31, 31, 31, 31, 31 }; | 1026 | [MT2063_OFFAIR_8VSB] = "analog offair 8vsb", |
1027 | static const u8 LNATGT[] = { 44, 43, 43, 43, 43, 43 }; | 1027 | }; |
1028 | static const u8 RFOVDIS[] = { 0, 0, 0, 0, 0, 0 }; | 1028 | |
1029 | static const u8 ACRFMAX[] = { 31, 31, 31, 31, 31, 31 }; | 1029 | static const u8 RFAGCEN[] = { 0, 0, 0, 0, 0, 0 }; |
1030 | static const u8 PD1TGT[] = { 36, 36, 38, 38, 36, 38 }; | 1030 | static const u8 LNARIN[] = { 0, 0, 3, 3, 3, 3 }; |
1031 | static const u8 FIFOVDIS[] = { 0, 0, 0, 0, 0, 0 }; | 1031 | static const u8 FIFFQEN[] = { 1, 1, 1, 1, 1, 1 }; |
1032 | static const u8 ACFIFMAX[] = { 29, 29, 29, 29, 29, 29 }; | 1032 | static const u8 FIFFQ[] = { 0, 0, 0, 0, 0, 0 }; |
1033 | static const u8 PD2TGT[] = { 40, 33, 38, 42, 30, 38 }; | 1033 | static const u8 DNC1GC[] = { 0, 0, 0, 0, 0, 0 }; |
1034 | static const u8 DNC2GC[] = { 0, 0, 0, 0, 0, 0 }; | ||
1035 | static const u8 ACLNAMAX[] = { 31, 31, 31, 31, 31, 31 }; | ||
1036 | static const u8 LNATGT[] = { 44, 43, 43, 43, 43, 43 }; | ||
1037 | static const u8 RFOVDIS[] = { 0, 0, 0, 0, 0, 0 }; | ||
1038 | static const u8 ACRFMAX[] = { 31, 31, 31, 31, 31, 31 }; | ||
1039 | static const u8 PD1TGT[] = { 36, 36, 38, 38, 36, 38 }; | ||
1040 | static const u8 FIFOVDIS[] = { 0, 0, 0, 0, 0, 0 }; | ||
1041 | static const u8 ACFIFMAX[] = { 29, 29, 29, 29, 29, 29 }; | ||
1042 | static const u8 PD2TGT[] = { 40, 33, 38, 42, 30, 38 }; | ||
1034 | 1043 | ||
1035 | /* | 1044 | /* |
1036 | * mt2063_set_dnc_output_enable() | 1045 | * mt2063_set_dnc_output_enable() |
@@ -1315,8 +1324,11 @@ static u32 MT2063_SetReceiverMode(struct mt2063_state *state, | |||
1315 | status |= mt2063_setreg(state, MT2063_REG_PD1_TGT, val); | 1324 | status |= mt2063_setreg(state, MT2063_REG_PD1_TGT, val); |
1316 | } | 1325 | } |
1317 | 1326 | ||
1318 | if (status >= 0) | 1327 | if (status >= 0) { |
1319 | state->rcvr_mode = Mode; | 1328 | state->rcvr_mode = Mode; |
1329 | dprintk(1, "mt2063 mode changed to %s\n", | ||
1330 | mt2063_mode_name[state->rcvr_mode]); | ||
1331 | } | ||
1320 | 1332 | ||
1321 | return status; | 1333 | return status; |
1322 | } | 1334 | } |
@@ -2023,6 +2035,8 @@ static int mt2063_get_status(struct dvb_frontend *fe, u32 *tuner_status) | |||
2023 | if (status) | 2035 | if (status) |
2024 | *tuner_status = TUNER_STATUS_LOCKED; | 2036 | *tuner_status = TUNER_STATUS_LOCKED; |
2025 | 2037 | ||
2038 | dprintk(1, "Tuner status: %d", *tuner_status); | ||
2039 | |||
2026 | return 0; | 2040 | return 0; |
2027 | } | 2041 | } |
2028 | 2042 | ||
@@ -2092,6 +2106,9 @@ static int mt2063_set_analog_params(struct dvb_frontend *fe, | |||
2092 | if (status < 0) | 2106 | if (status < 0) |
2093 | return status; | 2107 | return status; |
2094 | 2108 | ||
2109 | dprintk(1, "Tuning to frequency: %d, bandwidth %d, foffset %d\n", | ||
2110 | params->frequency, ch_bw, pict2chanb_vsb); | ||
2111 | |||
2095 | status = MT2063_Tune(state, (params->frequency + (pict2chanb_vsb + (ch_bw / 2)))); | 2112 | status = MT2063_Tune(state, (params->frequency + (pict2chanb_vsb + (ch_bw / 2)))); |
2096 | if (status < 0) | 2113 | if (status < 0) |
2097 | return status; | 2114 | return status; |
@@ -2161,6 +2178,9 @@ static int mt2063_set_params(struct dvb_frontend *fe) | |||
2161 | if (status < 0) | 2178 | if (status < 0) |
2162 | return status; | 2179 | return status; |
2163 | 2180 | ||
2181 | dprintk(1, "Tuning to frequency: %d, bandwidth %d, foffset %d\n", | ||
2182 | c->frequency, ch_bw, pict2chanb_vsb); | ||
2183 | |||
2164 | status = MT2063_Tune(state, (c->frequency + (pict2chanb_vsb + (ch_bw / 2)))); | 2184 | status = MT2063_Tune(state, (c->frequency + (pict2chanb_vsb + (ch_bw / 2)))); |
2165 | 2185 | ||
2166 | if (status < 0) | 2186 | if (status < 0) |
@@ -2180,6 +2200,9 @@ static int mt2063_get_frequency(struct dvb_frontend *fe, u32 *freq) | |||
2180 | return -ENODEV; | 2200 | return -ENODEV; |
2181 | 2201 | ||
2182 | *freq = state->frequency; | 2202 | *freq = state->frequency; |
2203 | |||
2204 | dprintk(1, "frequency: %d\n", *freq); | ||
2205 | |||
2183 | return 0; | 2206 | return 0; |
2184 | } | 2207 | } |
2185 | 2208 | ||
@@ -2193,6 +2216,9 @@ static int mt2063_get_bandwidth(struct dvb_frontend *fe, u32 *bw) | |||
2193 | return -ENODEV; | 2216 | return -ENODEV; |
2194 | 2217 | ||
2195 | *bw = state->AS_Data.f_out_bw - 750000; | 2218 | *bw = state->AS_Data.f_out_bw - 750000; |
2219 | |||
2220 | dprintk(1, "bandwidth: %d\n", *bw); | ||
2221 | |||
2196 | return 0; | 2222 | return 0; |
2197 | } | 2223 | } |
2198 | 2224 | ||