diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-07-21 13:12:04 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-01-04 19:21:16 -0500 |
commit | 6fb167000e6b726bc9f129af08b6aad3ef075da4 (patch) | |
tree | 598a0d83922d4db977ba9459fe16acd62175bbc5 /drivers/media | |
parent | e3f94fb8c53bb0537396b66da5f86f3865fdb616 (diff) |
[media] mt2063: make checkpatch.pl happy
Fix everything but 80 columns and two msleep warnings
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/common/tuners/mt2063.c | 129 |
1 files changed, 48 insertions, 81 deletions
diff --git a/drivers/media/common/tuners/mt2063.c b/drivers/media/common/tuners/mt2063.c index d13b78ba45d0..5154b9d08384 100644 --- a/drivers/media/common/tuners/mt2063.c +++ b/drivers/media/common/tuners/mt2063.c | |||
@@ -263,7 +263,7 @@ static u32 mt2063_write(struct mt2063_state *state, u8 reg, u8 *data, u32 len) | |||
263 | fe->ops.i2c_gate_ctrl(fe, 0); | 263 | fe->ops.i2c_gate_ctrl(fe, 0); |
264 | 264 | ||
265 | if (ret < 0) | 265 | if (ret < 0) |
266 | printk("mt2063_writeregs error ret=%d\n", ret); | 266 | printk(KERN_ERR "%s error ret=%d\n", __func__, ret); |
267 | 267 | ||
268 | return ret; | 268 | return ret; |
269 | } | 269 | } |
@@ -287,7 +287,6 @@ static u32 mt2063_setreg(struct mt2063_state *state, u8 reg, u8 val) | |||
287 | return 0; | 287 | return 0; |
288 | } | 288 | } |
289 | 289 | ||
290 | |||
291 | /* | 290 | /* |
292 | * mt2063_read - Read data from the I2C bus | 291 | * mt2063_read - Read data from the I2C bus |
293 | */ | 292 | */ |
@@ -322,7 +321,7 @@ static u32 mt2063_read(struct mt2063_state *state, | |||
322 | break; | 321 | break; |
323 | } | 322 | } |
324 | fe->ops.i2c_gate_ctrl(fe, 0); | 323 | fe->ops.i2c_gate_ctrl(fe, 0); |
325 | return (status); | 324 | return status; |
326 | } | 325 | } |
327 | 326 | ||
328 | /* | 327 | /* |
@@ -600,10 +599,6 @@ static u32 MT2063_ChooseFirstIF(struct MT2063_AvoidSpursData_t *pAS_Info) | |||
600 | ((f_Desired - pAS_Info->f_if1_Center + | 599 | ((f_Desired - pAS_Info->f_if1_Center + |
601 | f_Step / 2) / f_Step); | 600 | f_Step / 2) / f_Step); |
602 | 601 | ||
603 | //assert; | ||
604 | //if (!abs((s32) f_Center - (s32) pAS_Info->f_if1_Center) <= (s32) (f_Step/2)) | ||
605 | // return 0; | ||
606 | |||
607 | /* Take MT_ExclZones, center around f_Center and change the resolution to f_Step */ | 602 | /* Take MT_ExclZones, center around f_Center and change the resolution to f_Step */ |
608 | while (pNode != NULL) { | 603 | while (pNode != NULL) { |
609 | /* floor function */ | 604 | /* floor function */ |
@@ -625,10 +620,6 @@ static u32 MT2063_ChooseFirstIF(struct MT2063_AvoidSpursData_t *pAS_Info) | |||
625 | zones[j - 1].max_ = tmpMax; | 620 | zones[j - 1].max_ = tmpMax; |
626 | else { | 621 | else { |
627 | /* Add new zone */ | 622 | /* Add new zone */ |
628 | //assert(j<MT2063_MAX_ZONES); | ||
629 | //if (j>=MT2063_MAX_ZONES) | ||
630 | //break; | ||
631 | |||
632 | zones[j].min_ = tmpMin; | 623 | zones[j].min_ = tmpMin; |
633 | zones[j].max_ = tmpMax; | 624 | zones[j].max_ = tmpMax; |
634 | j++; | 625 | j++; |
@@ -903,15 +894,13 @@ static u32 MT2063_AvoidSpurs(struct MT2063_AvoidSpursData_t *pAS_Info) | |||
903 | delta_IF1 = zfIF1 - pAS_Info->f_if1_Center; | 894 | delta_IF1 = zfIF1 - pAS_Info->f_if1_Center; |
904 | else | 895 | else |
905 | delta_IF1 = pAS_Info->f_if1_Center - zfIF1; | 896 | delta_IF1 = pAS_Info->f_if1_Center - zfIF1; |
906 | } | 897 | |
898 | pAS_Info->bSpurPresent = IsSpurInBand(pAS_Info, &fm, &fp); | ||
907 | /* | 899 | /* |
908 | ** Continue while the new 1st IF is still within the 1st IF bandwidth | 900 | ** Continue while the new 1st IF is still within the 1st IF bandwidth |
909 | ** and there is a spur in the band (again) | 901 | ** and there is a spur in the band (again) |
910 | */ | 902 | */ |
911 | while ((2 * delta_IF1 + pAS_Info->f_out_bw <= | 903 | } while ((2 * delta_IF1 + pAS_Info->f_out_bw <= pAS_Info->f_if1_bw) && pAS_Info->bSpurPresent); |
912 | pAS_Info->f_if1_bw) | ||
913 | && (pAS_Info->bSpurPresent = | ||
914 | IsSpurInBand(pAS_Info, &fm, &fp))); | ||
915 | 904 | ||
916 | /* | 905 | /* |
917 | ** Use the LO-spur free values found. If the search went all the way to | 906 | ** Use the LO-spur free values found. If the search went all the way to |
@@ -930,19 +919,9 @@ static u32 MT2063_AvoidSpurs(struct MT2063_AvoidSpursData_t *pAS_Info) | |||
930 | ((pAS_Info-> | 919 | ((pAS_Info-> |
931 | nSpursFound << MT2063_SPUR_SHIFT) & MT2063_SPUR_CNT_MASK); | 920 | nSpursFound << MT2063_SPUR_SHIFT) & MT2063_SPUR_CNT_MASK); |
932 | 921 | ||
933 | return (status); | 922 | return status; |
934 | } | 923 | } |
935 | 924 | ||
936 | /* | ||
937 | ** The expected version of MT_AvoidSpursData_t | ||
938 | ** If the version is different, an updated file is needed from Microtune | ||
939 | */ | ||
940 | |||
941 | typedef enum { | ||
942 | MT2063_SET_ATTEN, | ||
943 | MT2063_INCR_ATTEN, | ||
944 | MT2063_DECR_ATTEN | ||
945 | } MT2063_ATTEN_CNTL_MODE; | ||
946 | 925 | ||
947 | /* | 926 | /* |
948 | * Constants used by the tuning algorithm | 927 | * Constants used by the tuning algorithm |
@@ -1044,8 +1023,7 @@ unsigned int mt2063_lockStatus(struct mt2063_state *state) | |||
1044 | return TUNER_STATUS_LOCKED | TUNER_STATUS_STEREO; | 1023 | return TUNER_STATUS_LOCKED | TUNER_STATUS_STEREO; |
1045 | } | 1024 | } |
1046 | msleep(nPollRate); /* Wait between retries */ | 1025 | msleep(nPollRate); /* Wait between retries */ |
1047 | } | 1026 | } while (++nDelays < nMaxLoops); |
1048 | while (++nDelays < nMaxLoops); | ||
1049 | 1027 | ||
1050 | /* | 1028 | /* |
1051 | * Got no lock or partial lock | 1029 | * Got no lock or partial lock |
@@ -1058,7 +1036,7 @@ EXPORT_SYMBOL_GPL(mt2063_lockStatus); | |||
1058 | * mt2063_set_dnc_output_enable() | 1036 | * mt2063_set_dnc_output_enable() |
1059 | */ | 1037 | */ |
1060 | static u32 mt2063_get_dnc_output_enable(struct mt2063_state *state, | 1038 | static u32 mt2063_get_dnc_output_enable(struct mt2063_state *state, |
1061 | enum MT2063_DNC_Output_Enable *pValue) | 1039 | enum MT2063_DNC_Output_Enable *pValue) |
1062 | { | 1040 | { |
1063 | if ((state->reg[MT2063_REG_DNC_GAIN] & 0x03) == 0x03) { /* if DNC1 is off */ | 1041 | if ((state->reg[MT2063_REG_DNC_GAIN] & 0x03) == 0x03) { /* if DNC1 is off */ |
1064 | if ((state->reg[MT2063_REG_VGA_GAIN] & 0x03) == 0x03) /* if DNC2 is off */ | 1042 | if ((state->reg[MT2063_REG_VGA_GAIN] & 0x03) == 0x03) /* if DNC2 is off */ |
@@ -1078,7 +1056,7 @@ static u32 mt2063_get_dnc_output_enable(struct mt2063_state *state, | |||
1078 | * mt2063_set_dnc_output_enable() | 1056 | * mt2063_set_dnc_output_enable() |
1079 | */ | 1057 | */ |
1080 | static u32 mt2063_set_dnc_output_enable(struct mt2063_state *state, | 1058 | static u32 mt2063_set_dnc_output_enable(struct mt2063_state *state, |
1081 | enum MT2063_DNC_Output_Enable nValue) | 1059 | enum MT2063_DNC_Output_Enable nValue) |
1082 | { | 1060 | { |
1083 | u32 status = 0; /* Status to be returned */ | 1061 | u32 status = 0; /* Status to be returned */ |
1084 | u8 val = 0; | 1062 | u8 val = 0; |
@@ -1201,7 +1179,7 @@ static u32 mt2063_set_dnc_output_enable(struct mt2063_state *state, | |||
1201 | break; | 1179 | break; |
1202 | } | 1180 | } |
1203 | 1181 | ||
1204 | return (status); | 1182 | return status; |
1205 | } | 1183 | } |
1206 | 1184 | ||
1207 | /****************************************************************************** | 1185 | /****************************************************************************** |
@@ -1301,28 +1279,26 @@ static u32 MT2063_SetReceiverMode(struct mt2063_state *state, | |||
1301 | if (status >= 0) { | 1279 | if (status >= 0) { |
1302 | val = | 1280 | val = |
1303 | (state-> | 1281 | (state-> |
1304 | reg[MT2063_REG_PD1_TGT] & (u8) ~ 0x40) | (RFAGCEN[Mode] | 1282 | reg[MT2063_REG_PD1_TGT] & (u8) ~0x40) | (RFAGCEN[Mode] |
1305 | ? 0x40 : | 1283 | ? 0x40 : |
1306 | 0x00); | 1284 | 0x00); |
1307 | if (state->reg[MT2063_REG_PD1_TGT] != val) { | 1285 | if (state->reg[MT2063_REG_PD1_TGT] != val) |
1308 | status |= mt2063_setreg(state, MT2063_REG_PD1_TGT, val); | 1286 | status |= mt2063_setreg(state, MT2063_REG_PD1_TGT, val); |
1309 | } | ||
1310 | } | 1287 | } |
1311 | 1288 | ||
1312 | /* LNARin */ | 1289 | /* LNARin */ |
1313 | if (status >= 0) { | 1290 | if (status >= 0) { |
1314 | u8 val = (state-> reg[MT2063_REG_CTRL_2C] & (u8) ~ 0x03) | | 1291 | u8 val = (state->reg[MT2063_REG_CTRL_2C] & (u8) ~0x03) | |
1315 | (LNARIN[Mode] & 0x03); | 1292 | (LNARIN[Mode] & 0x03); |
1316 | if (state->reg[MT2063_REG_CTRL_2C] != val) | 1293 | if (state->reg[MT2063_REG_CTRL_2C] != val) |
1317 | status |= mt2063_setreg(state, MT2063_REG_CTRL_2C, | 1294 | status |= mt2063_setreg(state, MT2063_REG_CTRL_2C, val); |
1318 | val); | ||
1319 | } | 1295 | } |
1320 | 1296 | ||
1321 | /* FIFFQEN and FIFFQ */ | 1297 | /* FIFFQEN and FIFFQ */ |
1322 | if (status >= 0) { | 1298 | if (status >= 0) { |
1323 | val = | 1299 | val = |
1324 | (state-> | 1300 | (state-> |
1325 | reg[MT2063_REG_FIFF_CTRL2] & (u8) ~ 0xF0) | | 1301 | reg[MT2063_REG_FIFF_CTRL2] & (u8) ~0xF0) | |
1326 | (FIFFQEN[Mode] << 7) | (FIFFQ[Mode] << 4); | 1302 | (FIFFQEN[Mode] << 7) | (FIFFQ[Mode] << 4); |
1327 | if (state->reg[MT2063_REG_FIFF_CTRL2] != val) { | 1303 | if (state->reg[MT2063_REG_FIFF_CTRL2] != val) { |
1328 | status |= | 1304 | status |= |
@@ -1334,7 +1310,7 @@ static u32 MT2063_SetReceiverMode(struct mt2063_state *state, | |||
1334 | mt2063_setreg(state, MT2063_REG_FIFF_CTRL, val); | 1310 | mt2063_setreg(state, MT2063_REG_FIFF_CTRL, val); |
1335 | val = | 1311 | val = |
1336 | (state-> | 1312 | (state-> |
1337 | reg[MT2063_REG_FIFF_CTRL] & (u8) ~ 0x01); | 1313 | reg[MT2063_REG_FIFF_CTRL] & (u8) ~0x01); |
1338 | status |= | 1314 | status |= |
1339 | mt2063_setreg(state, MT2063_REG_FIFF_CTRL, val); | 1315 | mt2063_setreg(state, MT2063_REG_FIFF_CTRL, val); |
1340 | } | 1316 | } |
@@ -1346,7 +1322,7 @@ static u32 MT2063_SetReceiverMode(struct mt2063_state *state, | |||
1346 | 1322 | ||
1347 | /* acLNAmax */ | 1323 | /* acLNAmax */ |
1348 | if (status >= 0) { | 1324 | if (status >= 0) { |
1349 | u8 val = (state-> reg[MT2063_REG_LNA_OV] & (u8) ~ 0x1F) | | 1325 | u8 val = (state->reg[MT2063_REG_LNA_OV] & (u8) ~0x1F) | |
1350 | (ACLNAMAX[Mode] & 0x1F); | 1326 | (ACLNAMAX[Mode] & 0x1F); |
1351 | if (state->reg[MT2063_REG_LNA_OV] != val) | 1327 | if (state->reg[MT2063_REG_LNA_OV] != val) |
1352 | status |= mt2063_setreg(state, MT2063_REG_LNA_OV, val); | 1328 | status |= mt2063_setreg(state, MT2063_REG_LNA_OV, val); |
@@ -1354,7 +1330,7 @@ static u32 MT2063_SetReceiverMode(struct mt2063_state *state, | |||
1354 | 1330 | ||
1355 | /* LNATGT */ | 1331 | /* LNATGT */ |
1356 | if (status >= 0) { | 1332 | if (status >= 0) { |
1357 | u8 val = (state-> reg[MT2063_REG_LNA_TGT] & (u8) ~ 0x3F) | | 1333 | u8 val = (state->reg[MT2063_REG_LNA_TGT] & (u8) ~0x3F) | |
1358 | (LNATGT[Mode] & 0x3F); | 1334 | (LNATGT[Mode] & 0x3F); |
1359 | if (state->reg[MT2063_REG_LNA_TGT] != val) | 1335 | if (state->reg[MT2063_REG_LNA_TGT] != val) |
1360 | status |= mt2063_setreg(state, MT2063_REG_LNA_TGT, val); | 1336 | status |= mt2063_setreg(state, MT2063_REG_LNA_TGT, val); |
@@ -1362,15 +1338,15 @@ static u32 MT2063_SetReceiverMode(struct mt2063_state *state, | |||
1362 | 1338 | ||
1363 | /* ACRF */ | 1339 | /* ACRF */ |
1364 | if (status >= 0) { | 1340 | if (status >= 0) { |
1365 | u8 val = (state-> reg[MT2063_REG_RF_OV] & (u8) ~ 0x1F) | | 1341 | u8 val = (state->reg[MT2063_REG_RF_OV] & (u8) ~0x1F) | |
1366 | (ACRFMAX[Mode] & 0x1F); | 1342 | (ACRFMAX[Mode] & 0x1F); |
1367 | if (state->reg[MT2063_REG_RF_OV] != val) | 1343 | if (state->reg[MT2063_REG_RF_OV] != val) |
1368 | status |= mt2063_setreg(state, MT2063_REG_RF_OV, val); | 1344 | status |= mt2063_setreg(state, MT2063_REG_RF_OV, val); |
1369 | } | 1345 | } |
1370 | 1346 | ||
1371 | /* PD1TGT */ | 1347 | /* PD1TGT */ |
1372 | if (status >= 0) { | 1348 | if (status >= 0) { |
1373 | u8 val = (state-> reg[MT2063_REG_PD1_TGT] & (u8) ~ 0x3F) | | 1349 | u8 val = (state->reg[MT2063_REG_PD1_TGT] & (u8) ~0x3F) | |
1374 | (PD1TGT[Mode] & 0x3F); | 1350 | (PD1TGT[Mode] & 0x3F); |
1375 | if (state->reg[MT2063_REG_PD1_TGT] != val) | 1351 | if (state->reg[MT2063_REG_PD1_TGT] != val) |
1376 | status |= mt2063_setreg(state, MT2063_REG_PD1_TGT, val); | 1352 | status |= mt2063_setreg(state, MT2063_REG_PD1_TGT, val); |
@@ -1381,16 +1357,15 @@ static u32 MT2063_SetReceiverMode(struct mt2063_state *state, | |||
1381 | u8 val = ACFIFMAX[Mode]; | 1357 | u8 val = ACFIFMAX[Mode]; |
1382 | if (state->reg[MT2063_REG_PART_REV] != MT2063_B3 && val > 5) | 1358 | if (state->reg[MT2063_REG_PART_REV] != MT2063_B3 && val > 5) |
1383 | val = 5; | 1359 | val = 5; |
1384 | val = (state-> reg[MT2063_REG_FIF_OV] & (u8) ~ 0x1F) | | 1360 | val = (state->reg[MT2063_REG_FIF_OV] & (u8) ~0x1F) | |
1385 | (val & 0x1F); | 1361 | (val & 0x1F); |
1386 | if (state->reg[MT2063_REG_FIF_OV] != val) { | 1362 | if (state->reg[MT2063_REG_FIF_OV] != val) |
1387 | status |= mt2063_setreg(state, MT2063_REG_FIF_OV, val); | 1363 | status |= mt2063_setreg(state, MT2063_REG_FIF_OV, val); |
1388 | } | ||
1389 | } | 1364 | } |
1390 | 1365 | ||
1391 | /* PD2TGT */ | 1366 | /* PD2TGT */ |
1392 | if (status >= 0) { | 1367 | if (status >= 0) { |
1393 | u8 val = (state-> reg[MT2063_REG_PD2_TGT] & (u8) ~ 0x3F) | | 1368 | u8 val = (state->reg[MT2063_REG_PD2_TGT] & (u8) ~0x3F) | |
1394 | (PD2TGT[Mode] & 0x3F); | 1369 | (PD2TGT[Mode] & 0x3F); |
1395 | if (state->reg[MT2063_REG_PD2_TGT] != val) | 1370 | if (state->reg[MT2063_REG_PD2_TGT] != val) |
1396 | status |= mt2063_setreg(state, MT2063_REG_PD2_TGT, val); | 1371 | status |= mt2063_setreg(state, MT2063_REG_PD2_TGT, val); |
@@ -1398,31 +1373,24 @@ static u32 MT2063_SetReceiverMode(struct mt2063_state *state, | |||
1398 | 1373 | ||
1399 | /* Ignore ATN Overload */ | 1374 | /* Ignore ATN Overload */ |
1400 | if (status >= 0) { | 1375 | if (status >= 0) { |
1401 | val = | 1376 | val = (state->reg[MT2063_REG_LNA_TGT] & (u8) ~0x80) | |
1402 | (state-> | 1377 | (RFOVDIS[Mode] ? 0x80 : 0x00); |
1403 | reg[MT2063_REG_LNA_TGT] & (u8) ~ 0x80) | (RFOVDIS[Mode] | 1378 | if (state->reg[MT2063_REG_LNA_TGT] != val) |
1404 | ? 0x80 : | ||
1405 | 0x00); | ||
1406 | if (state->reg[MT2063_REG_LNA_TGT] != val) { | ||
1407 | status |= mt2063_setreg(state, MT2063_REG_LNA_TGT, val); | 1379 | status |= mt2063_setreg(state, MT2063_REG_LNA_TGT, val); |
1408 | } | ||
1409 | } | 1380 | } |
1410 | 1381 | ||
1411 | /* Ignore FIF Overload */ | 1382 | /* Ignore FIF Overload */ |
1412 | if (status >= 0) { | 1383 | if (status >= 0) { |
1413 | val = | 1384 | val = (state->reg[MT2063_REG_PD1_TGT] & (u8) ~0x80) | |
1414 | (state-> | 1385 | (FIFOVDIS[Mode] ? 0x80 : 0x00); |
1415 | reg[MT2063_REG_PD1_TGT] & (u8) ~ 0x80) | | 1386 | if (state->reg[MT2063_REG_PD1_TGT] != val) |
1416 | (FIFOVDIS[Mode] ? 0x80 : 0x00); | ||
1417 | if (state->reg[MT2063_REG_PD1_TGT] != val) { | ||
1418 | status |= mt2063_setreg(state, MT2063_REG_PD1_TGT, val); | 1387 | status |= mt2063_setreg(state, MT2063_REG_PD1_TGT, val); |
1419 | } | ||
1420 | } | 1388 | } |
1421 | 1389 | ||
1422 | if (status >= 0) | 1390 | if (status >= 0) |
1423 | state->rcvr_mode = Mode; | 1391 | state->rcvr_mode = Mode; |
1424 | 1392 | ||
1425 | return (status); | 1393 | return status; |
1426 | } | 1394 | } |
1427 | 1395 | ||
1428 | /**************************************************************************** | 1396 | /**************************************************************************** |
@@ -1473,7 +1441,7 @@ static u32 MT2063_ClearPowerMaskBits(struct mt2063_state *state, | |||
1473 | &state->reg[MT2063_REG_PWR_1], 1); | 1441 | &state->reg[MT2063_REG_PWR_1], 1); |
1474 | } | 1442 | } |
1475 | 1443 | ||
1476 | return (status); | 1444 | return status; |
1477 | } | 1445 | } |
1478 | 1446 | ||
1479 | /**************************************************************************** | 1447 | /**************************************************************************** |
@@ -1580,7 +1548,7 @@ static u32 MT2063_fLO_FractionalTerm(u32 f_ref, u32 num, u32 denom) | |||
1580 | u32 loss = t1 % denom; | 1548 | u32 loss = t1 % denom; |
1581 | u32 term2 = | 1549 | u32 term2 = |
1582 | (((f_ref & 0x00003FFF) * num + (loss << 14)) + (denom / 2)) / denom; | 1550 | (((f_ref & 0x00003FFF) * num + (loss << 14)) + (denom / 2)) / denom; |
1583 | return ((term1 << 14) + term2); | 1551 | return (term1 << 14) + term2; |
1584 | } | 1552 | } |
1585 | 1553 | ||
1586 | /**************************************************************************** | 1554 | /**************************************************************************** |
@@ -1610,8 +1578,8 @@ static u32 MT2063_fLO_FractionalTerm(u32 f_ref, u32 num, u32 denom) | |||
1610 | ** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. | 1578 | ** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. |
1611 | ** | 1579 | ** |
1612 | ****************************************************************************/ | 1580 | ****************************************************************************/ |
1613 | static u32 MT2063_CalcLO1Mult(u32 * Div, | 1581 | static u32 MT2063_CalcLO1Mult(u32 *Div, |
1614 | u32 * FracN, | 1582 | u32 *FracN, |
1615 | u32 f_LO, | 1583 | u32 f_LO, |
1616 | u32 f_LO_Step, u32 f_Ref) | 1584 | u32 f_LO_Step, u32 f_Ref) |
1617 | { | 1585 | { |
@@ -1653,8 +1621,8 @@ static u32 MT2063_CalcLO1Mult(u32 * Div, | |||
1653 | ** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. | 1621 | ** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. |
1654 | ** | 1622 | ** |
1655 | ****************************************************************************/ | 1623 | ****************************************************************************/ |
1656 | static u32 MT2063_CalcLO2Mult(u32 * Div, | 1624 | static u32 MT2063_CalcLO2Mult(u32 *Div, |
1657 | u32 * FracN, | 1625 | u32 *FracN, |
1658 | u32 f_LO, | 1626 | u32 f_LO, |
1659 | u32 f_LO_Step, u32 f_Ref) | 1627 | u32 f_LO_Step, u32 f_Ref) |
1660 | { | 1628 | { |
@@ -2039,7 +2007,6 @@ int mt2063_setTune(struct dvb_frontend *fe, u32 f_in, u32 bw_in, | |||
2039 | pict2snd1 = 0; | 2007 | pict2snd1 = 0; |
2040 | pict2snd2 = 0; | 2008 | pict2snd2 = 0; |
2041 | rcvr_mode = 4; | 2009 | rcvr_mode = 4; |
2042 | //f_in -= 2900000; | ||
2043 | break; | 2010 | break; |
2044 | } | 2011 | } |
2045 | case MTTUNEA_DVBC:{ | 2012 | case MTTUNEA_DVBC:{ |
@@ -2053,7 +2020,7 @@ int mt2063_setTune(struct dvb_frontend *fe, u32 f_in, u32 bw_in, | |||
2053 | } | 2020 | } |
2054 | case MTTUNEA_DVBT:{ | 2021 | case MTTUNEA_DVBT:{ |
2055 | pict_car = 36125000; | 2022 | pict_car = 36125000; |
2056 | ch_bw = bw_in; //8000000 | 2023 | ch_bw = bw_in; |
2057 | pict2chanb_vsb = -(ch_bw / 2); | 2024 | pict2chanb_vsb = -(ch_bw / 2); |
2058 | pict2snd1 = 0; | 2025 | pict2snd1 = 0; |
2059 | pict2snd2 = 0; | 2026 | pict2snd2 = 0; |
@@ -2074,7 +2041,7 @@ int mt2063_setTune(struct dvb_frontend *fe, u32 f_in, u32 bw_in, | |||
2074 | state->AS_Data.f_out_bw = ch_bw + 750000; | 2041 | state->AS_Data.f_out_bw = ch_bw + 750000; |
2075 | status = MT2063_SetReceiverMode(state, rcvr_mode); | 2042 | status = MT2063_SetReceiverMode(state, rcvr_mode); |
2076 | if (status < 0) | 2043 | if (status < 0) |
2077 | return status; | 2044 | return status; |
2078 | 2045 | ||
2079 | status = MT2063_Tune(state, (f_in + (pict2chanb_vsb + (ch_bw / 2)))); | 2046 | status = MT2063_Tune(state, (f_in + (pict2chanb_vsb + (ch_bw / 2)))); |
2080 | 2047 | ||
@@ -2164,8 +2131,8 @@ static int mt2063_init(struct dvb_frontend *fe) | |||
2164 | 2131 | ||
2165 | /* Check the part/rev code */ | 2132 | /* Check the part/rev code */ |
2166 | if (((state->reg[MT2063_REG_PART_REV] != MT2063_B0) /* MT2063 B0 */ | 2133 | if (((state->reg[MT2063_REG_PART_REV] != MT2063_B0) /* MT2063 B0 */ |
2167 | &&(state->reg[MT2063_REG_PART_REV] != MT2063_B1) /* MT2063 B1 */ | 2134 | && (state->reg[MT2063_REG_PART_REV] != MT2063_B1) /* MT2063 B1 */ |
2168 | &&(state->reg[MT2063_REG_PART_REV] != MT2063_B3))) /* MT2063 B3 */ | 2135 | && (state->reg[MT2063_REG_PART_REV] != MT2063_B3))) /* MT2063 B3 */ |
2169 | return -ENODEV; /* Wrong tuner Part/Rev code */ | 2136 | return -ENODEV; /* Wrong tuner Part/Rev code */ |
2170 | 2137 | ||
2171 | /* Check the 2nd byte of the Part/Rev code from the tuner */ | 2138 | /* Check the 2nd byte of the Part/Rev code from the tuner */ |
@@ -2173,7 +2140,7 @@ static int mt2063_init(struct dvb_frontend *fe) | |||
2173 | &state->reg[MT2063_REG_RSVD_3B], 1); | 2140 | &state->reg[MT2063_REG_RSVD_3B], 1); |
2174 | 2141 | ||
2175 | /* b7 != 0 ==> NOT MT2063 */ | 2142 | /* b7 != 0 ==> NOT MT2063 */ |
2176 | if (status < 0 ||((state->reg[MT2063_REG_RSVD_3B] & 0x80) != 0x00)) | 2143 | if (status < 0 || ((state->reg[MT2063_REG_RSVD_3B] & 0x80) != 0x00)) |
2177 | return -ENODEV; /* Wrong tuner Part/Rev code */ | 2144 | return -ENODEV; /* Wrong tuner Part/Rev code */ |
2178 | 2145 | ||
2179 | /* Reset the tuner */ | 2146 | /* Reset the tuner */ |
@@ -2321,7 +2288,7 @@ static int mt2063_init(struct dvb_frontend *fe) | |||
2321 | 2288 | ||
2322 | /* Adjust each of the values in the ClearTune filter cross-over table */ | 2289 | /* Adjust each of the values in the ClearTune filter cross-over table */ |
2323 | for (i = 0; i < 31; i++) | 2290 | for (i = 0; i < 31; i++) |
2324 | state->CTFiltMax[i] =(state->CTFiltMax[i] / 768) * (fcu_osc + 640); | 2291 | state->CTFiltMax[i] = (state->CTFiltMax[i] / 768) * (fcu_osc + 640); |
2325 | 2292 | ||
2326 | status = MT2063_SoftwareShutdown(state, 1); | 2293 | status = MT2063_SoftwareShutdown(state, 1); |
2327 | if (status < 0) | 2294 | if (status < 0) |
@@ -2349,14 +2316,14 @@ static int mt2063_get_state(struct dvb_frontend *fe, | |||
2349 | 2316 | ||
2350 | switch (param) { | 2317 | switch (param) { |
2351 | case DVBFE_TUNER_FREQUENCY: | 2318 | case DVBFE_TUNER_FREQUENCY: |
2352 | //get frequency | 2319 | /* get frequency */ |
2353 | break; | 2320 | break; |
2354 | case DVBFE_TUNER_TUNERSTEP: | 2321 | case DVBFE_TUNER_TUNERSTEP: |
2355 | break; | 2322 | break; |
2356 | case DVBFE_TUNER_IFFREQ: | 2323 | case DVBFE_TUNER_IFFREQ: |
2357 | break; | 2324 | break; |
2358 | case DVBFE_TUNER_BANDWIDTH: | 2325 | case DVBFE_TUNER_BANDWIDTH: |
2359 | //get bandwidth | 2326 | /* get bandwidth */ |
2360 | break; | 2327 | break; |
2361 | case DVBFE_TUNER_REFCLOCK: | 2328 | case DVBFE_TUNER_REFCLOCK: |
2362 | tunstate->refclock = mt2063_lockStatus(state); | 2329 | tunstate->refclock = mt2063_lockStatus(state); |
@@ -2376,7 +2343,7 @@ static int mt2063_set_state(struct dvb_frontend *fe, | |||
2376 | 2343 | ||
2377 | switch (param) { | 2344 | switch (param) { |
2378 | case DVBFE_TUNER_FREQUENCY: | 2345 | case DVBFE_TUNER_FREQUENCY: |
2379 | //set frequency | 2346 | /* set frequency */ |
2380 | 2347 | ||
2381 | status = | 2348 | status = |
2382 | mt2063_setTune(fe, | 2349 | mt2063_setTune(fe, |
@@ -2390,7 +2357,7 @@ static int mt2063_set_state(struct dvb_frontend *fe, | |||
2390 | case DVBFE_TUNER_IFFREQ: | 2357 | case DVBFE_TUNER_IFFREQ: |
2391 | break; | 2358 | break; |
2392 | case DVBFE_TUNER_BANDWIDTH: | 2359 | case DVBFE_TUNER_BANDWIDTH: |
2393 | //set bandwidth | 2360 | /* set bandwidth */ |
2394 | state->bandwidth = tunstate->bandwidth; | 2361 | state->bandwidth = tunstate->bandwidth; |
2395 | break; | 2362 | break; |
2396 | case DVBFE_TUNER_REFCLOCK: | 2363 | case DVBFE_TUNER_REFCLOCK: |
@@ -2446,7 +2413,7 @@ struct dvb_frontend *mt2063_attach(struct dvb_frontend *fe, | |||
2446 | fe->tuner_priv = state; | 2413 | fe->tuner_priv = state; |
2447 | fe->ops.tuner_ops = mt2063_ops; | 2414 | fe->ops.tuner_ops = mt2063_ops; |
2448 | 2415 | ||
2449 | printk("%s: Attaching MT2063 \n", __func__); | 2416 | printk(KERN_INFO "%s: Attaching MT2063\n", __func__); |
2450 | return fe; | 2417 | return fe; |
2451 | 2418 | ||
2452 | error: | 2419 | error: |