aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/tda10071.c
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2012-07-01 14:59:13 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-07-05 12:00:15 -0400
commit21c8ba39ab775a9a1ff031d9418967c5731049a4 (patch)
treefe0013cf6898cddba7b18bcc633beae213673210 /drivers/media/dvb/frontends/tda10071.c
parent84431c2ae5e41dfcdba75e2f81e732664381cec9 (diff)
[media] tda10071: use decimal numbers for indexes and lengths
Dan asked "Btw, why are the sizes specified in hex instead of decimal here?". After looking code, I agree also decimal presentation is clearer. So lets change those. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends/tda10071.c')
-rw-r--r--drivers/media/dvb/frontends/tda10071.c216
1 files changed, 108 insertions, 108 deletions
diff --git a/drivers/media/dvb/frontends/tda10071.c b/drivers/media/dvb/frontends/tda10071.c
index 3a1b6c0ac4ae..bccfcf7d20d7 100644
--- a/drivers/media/dvb/frontends/tda10071.c
+++ b/drivers/media/dvb/frontends/tda10071.c
@@ -211,12 +211,12 @@ static int tda10071_set_tone(struct dvb_frontend *fe,
211 goto error; 211 goto error;
212 } 212 }
213 213
214 cmd.args[0x00] = CMD_LNB_PCB_CONFIG; 214 cmd.args[0] = CMD_LNB_PCB_CONFIG;
215 cmd.args[0x01] = 0; 215 cmd.args[1] = 0;
216 cmd.args[0x02] = 0x00; 216 cmd.args[2] = 0x00;
217 cmd.args[0x03] = 0x00; 217 cmd.args[3] = 0x00;
218 cmd.args[0x04] = tone; 218 cmd.args[4] = tone;
219 cmd.len = 0x05; 219 cmd.len = 5;
220 ret = tda10071_cmd_execute(priv, &cmd); 220 ret = tda10071_cmd_execute(priv, &cmd);
221 if (ret) 221 if (ret)
222 goto error; 222 goto error;
@@ -258,10 +258,10 @@ static int tda10071_set_voltage(struct dvb_frontend *fe,
258 goto error; 258 goto error;
259 }; 259 };
260 260
261 cmd.args[0x00] = CMD_LNB_SET_DC_LEVEL; 261 cmd.args[0] = CMD_LNB_SET_DC_LEVEL;
262 cmd.args[0x01] = 0; 262 cmd.args[1] = 0;
263 cmd.args[0x02] = voltage; 263 cmd.args[2] = voltage;
264 cmd.len = 0x03; 264 cmd.len = 3;
265 ret = tda10071_cmd_execute(priv, &cmd); 265 ret = tda10071_cmd_execute(priv, &cmd);
266 if (ret) 266 if (ret)
267 goto error; 267 goto error;
@@ -312,15 +312,15 @@ static int tda10071_diseqc_send_master_cmd(struct dvb_frontend *fe,
312 if (ret) 312 if (ret)
313 goto error; 313 goto error;
314 314
315 cmd.args[0x00] = CMD_LNB_SEND_DISEQC; 315 cmd.args[0] = CMD_LNB_SEND_DISEQC;
316 cmd.args[0x01] = 0; 316 cmd.args[1] = 0;
317 cmd.args[0x02] = 0; 317 cmd.args[2] = 0;
318 cmd.args[0x03] = 0; 318 cmd.args[3] = 0;
319 cmd.args[0x04] = 2; 319 cmd.args[4] = 2;
320 cmd.args[0x05] = 0; 320 cmd.args[5] = 0;
321 cmd.args[0x06] = diseqc_cmd->msg_len; 321 cmd.args[6] = diseqc_cmd->msg_len;
322 memcpy(&cmd.args[0x07], diseqc_cmd->msg, diseqc_cmd->msg_len); 322 memcpy(&cmd.args[7], diseqc_cmd->msg, diseqc_cmd->msg_len);
323 cmd.len = 0x07 + diseqc_cmd->msg_len; 323 cmd.len = 7 + diseqc_cmd->msg_len;
324 ret = tda10071_cmd_execute(priv, &cmd); 324 ret = tda10071_cmd_execute(priv, &cmd);
325 if (ret) 325 if (ret)
326 goto error; 326 goto error;
@@ -372,9 +372,9 @@ static int tda10071_diseqc_recv_slave_reply(struct dvb_frontend *fe,
372 reply->msg_len = sizeof(reply->msg); /* truncate API max */ 372 reply->msg_len = sizeof(reply->msg); /* truncate API max */
373 373
374 /* read reply */ 374 /* read reply */
375 cmd.args[0x00] = CMD_LNB_UPDATE_REPLY; 375 cmd.args[0] = CMD_LNB_UPDATE_REPLY;
376 cmd.args[0x01] = 0; 376 cmd.args[1] = 0;
377 cmd.len = 0x02; 377 cmd.len = 2;
378 ret = tda10071_cmd_execute(priv, &cmd); 378 ret = tda10071_cmd_execute(priv, &cmd);
379 if (ret) 379 if (ret)
380 goto error; 380 goto error;
@@ -437,10 +437,10 @@ static int tda10071_diseqc_send_burst(struct dvb_frontend *fe,
437 if (ret) 437 if (ret)
438 goto error; 438 goto error;
439 439
440 cmd.args[0x00] = CMD_LNB_SEND_TONEBURST; 440 cmd.args[0] = CMD_LNB_SEND_TONEBURST;
441 cmd.args[0x01] = 0; 441 cmd.args[1] = 0;
442 cmd.args[0x02] = burst; 442 cmd.args[2] = burst;
443 cmd.len = 0x03; 443 cmd.len = 3;
444 ret = tda10071_cmd_execute(priv, &cmd); 444 ret = tda10071_cmd_execute(priv, &cmd);
445 if (ret) 445 if (ret)
446 goto error; 446 goto error;
@@ -523,9 +523,9 @@ static int tda10071_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
523 goto error; 523 goto error;
524 } 524 }
525 525
526 cmd.args[0x00] = CMD_GET_AGCACC; 526 cmd.args[0] = CMD_GET_AGCACC;
527 cmd.args[0x01] = 0; 527 cmd.args[1] = 0;
528 cmd.len = 0x02; 528 cmd.len = 2;
529 ret = tda10071_cmd_execute(priv, &cmd); 529 ret = tda10071_cmd_execute(priv, &cmd);
530 if (ret) 530 if (ret)
531 goto error; 531 goto error;
@@ -590,10 +590,10 @@ static int tda10071_read_ber(struct dvb_frontend *fe, u32 *ber)
590 priv->meas_count[i] = tmp; 590 priv->meas_count[i] = tmp;
591 } 591 }
592 592
593 cmd.args[0x00] = CMD_BER_UPDATE_COUNTERS; 593 cmd.args[0] = CMD_BER_UPDATE_COUNTERS;
594 cmd.args[0x01] = 0; 594 cmd.args[1] = 0;
595 cmd.args[0x02] = i; 595 cmd.args[2] = i;
596 cmd.len = 0x03; 596 cmd.len = 3;
597 ret = tda10071_cmd_execute(priv, &cmd); 597 ret = tda10071_cmd_execute(priv, &cmd);
598 if (ret) 598 if (ret)
599 goto error; 599 goto error;
@@ -748,22 +748,22 @@ static int tda10071_set_frontend(struct dvb_frontend *fe)
748 if (ret) 748 if (ret)
749 goto error; 749 goto error;
750 750
751 cmd.args[0x00] = CMD_CHANGE_CHANNEL; 751 cmd.args[0] = CMD_CHANGE_CHANNEL;
752 cmd.args[0x01] = 0; 752 cmd.args[1] = 0;
753 cmd.args[0x02] = mode; 753 cmd.args[2] = mode;
754 cmd.args[0x03] = (c->frequency >> 16) & 0xff; 754 cmd.args[3] = (c->frequency >> 16) & 0xff;
755 cmd.args[0x04] = (c->frequency >> 8) & 0xff; 755 cmd.args[4] = (c->frequency >> 8) & 0xff;
756 cmd.args[0x05] = (c->frequency >> 0) & 0xff; 756 cmd.args[5] = (c->frequency >> 0) & 0xff;
757 cmd.args[0x06] = ((c->symbol_rate / 1000) >> 8) & 0xff; 757 cmd.args[6] = ((c->symbol_rate / 1000) >> 8) & 0xff;
758 cmd.args[0x07] = ((c->symbol_rate / 1000) >> 0) & 0xff; 758 cmd.args[7] = ((c->symbol_rate / 1000) >> 0) & 0xff;
759 cmd.args[0x08] = (tda10071_ops.info.frequency_tolerance >> 8) & 0xff; 759 cmd.args[8] = (tda10071_ops.info.frequency_tolerance >> 8) & 0xff;
760 cmd.args[0x09] = (tda10071_ops.info.frequency_tolerance >> 0) & 0xff; 760 cmd.args[9] = (tda10071_ops.info.frequency_tolerance >> 0) & 0xff;
761 cmd.args[0x0a] = rolloff; 761 cmd.args[10] = rolloff;
762 cmd.args[0x0b] = inversion; 762 cmd.args[11] = inversion;
763 cmd.args[0x0c] = pilot; 763 cmd.args[12] = pilot;
764 cmd.args[0x0d] = 0x00; 764 cmd.args[13] = 0x00;
765 cmd.args[0x0e] = 0x00; 765 cmd.args[14] = 0x00;
766 cmd.len = 0x0f; 766 cmd.len = 15;
767 ret = tda10071_cmd_execute(priv, &cmd); 767 ret = tda10071_cmd_execute(priv, &cmd);
768 if (ret) 768 if (ret)
769 goto error; 769 goto error;
@@ -915,10 +915,10 @@ static int tda10071_init(struct dvb_frontend *fe)
915 goto error; 915 goto error;
916 } 916 }
917 917
918 cmd.args[0x00] = CMD_SET_SLEEP_MODE; 918 cmd.args[0] = CMD_SET_SLEEP_MODE;
919 cmd.args[0x01] = 0; 919 cmd.args[1] = 0;
920 cmd.args[0x02] = 0; 920 cmd.args[2] = 0;
921 cmd.len = 0x03; 921 cmd.len = 3;
922 ret = tda10071_cmd_execute(priv, &cmd); 922 ret = tda10071_cmd_execute(priv, &cmd);
923 if (ret) 923 if (ret)
924 goto error; 924 goto error;
@@ -1009,8 +1009,8 @@ static int tda10071_init(struct dvb_frontend *fe)
1009 priv->warm = 1; 1009 priv->warm = 1;
1010 } 1010 }
1011 1011
1012 cmd.args[0x00] = CMD_GET_FW_VERSION; 1012 cmd.args[0] = CMD_GET_FW_VERSION;
1013 cmd.len = 0x01; 1013 cmd.len = 1;
1014 ret = tda10071_cmd_execute(priv, &cmd); 1014 ret = tda10071_cmd_execute(priv, &cmd);
1015 if (ret) 1015 if (ret)
1016 goto error; 1016 goto error;
@@ -1027,46 +1027,46 @@ static int tda10071_init(struct dvb_frontend *fe)
1027 if (ret) 1027 if (ret)
1028 goto error; 1028 goto error;
1029 1029
1030 cmd.args[0x00] = CMD_DEMOD_INIT; 1030 cmd.args[0] = CMD_DEMOD_INIT;
1031 cmd.args[0x01] = ((priv->cfg.xtal / 1000) >> 8) & 0xff; 1031 cmd.args[1] = ((priv->cfg.xtal / 1000) >> 8) & 0xff;
1032 cmd.args[0x02] = ((priv->cfg.xtal / 1000) >> 0) & 0xff; 1032 cmd.args[2] = ((priv->cfg.xtal / 1000) >> 0) & 0xff;
1033 cmd.args[0x03] = buf[0]; 1033 cmd.args[3] = buf[0];
1034 cmd.args[0x04] = buf[1]; 1034 cmd.args[4] = buf[1];
1035 cmd.args[0x05] = priv->cfg.pll_multiplier; 1035 cmd.args[5] = priv->cfg.pll_multiplier;
1036 cmd.args[0x06] = priv->cfg.spec_inv; 1036 cmd.args[6] = priv->cfg.spec_inv;
1037 cmd.args[0x07] = 0x00; 1037 cmd.args[7] = 0x00;
1038 cmd.len = 0x08; 1038 cmd.len = 8;
1039 ret = tda10071_cmd_execute(priv, &cmd); 1039 ret = tda10071_cmd_execute(priv, &cmd);
1040 if (ret) 1040 if (ret)
1041 goto error; 1041 goto error;
1042 1042
1043 cmd.args[0x00] = CMD_TUNER_INIT; 1043 cmd.args[0] = CMD_TUNER_INIT;
1044 cmd.args[0x01] = 0x00; 1044 cmd.args[1] = 0x00;
1045 cmd.args[0x02] = 0x00; 1045 cmd.args[2] = 0x00;
1046 cmd.args[0x03] = 0x00; 1046 cmd.args[3] = 0x00;
1047 cmd.args[0x04] = 0x00; 1047 cmd.args[4] = 0x00;
1048 cmd.args[0x05] = 0x14; 1048 cmd.args[5] = 0x14;
1049 cmd.args[0x06] = 0x00; 1049 cmd.args[6] = 0x00;
1050 cmd.args[0x07] = 0x03; 1050 cmd.args[7] = 0x03;
1051 cmd.args[0x08] = 0x02; 1051 cmd.args[8] = 0x02;
1052 cmd.args[0x09] = 0x02; 1052 cmd.args[9] = 0x02;
1053 cmd.args[0x0a] = 0x00; 1053 cmd.args[10] = 0x00;
1054 cmd.args[0x0b] = 0x00; 1054 cmd.args[11] = 0x00;
1055 cmd.args[0x0c] = 0x00; 1055 cmd.args[12] = 0x00;
1056 cmd.args[0x0d] = 0x00; 1056 cmd.args[13] = 0x00;
1057 cmd.args[0x0e] = 0x00; 1057 cmd.args[14] = 0x00;
1058 cmd.len = 0x0f; 1058 cmd.len = 15;
1059 ret = tda10071_cmd_execute(priv, &cmd); 1059 ret = tda10071_cmd_execute(priv, &cmd);
1060 if (ret) 1060 if (ret)
1061 goto error; 1061 goto error;
1062 1062
1063 cmd.args[0x00] = CMD_MPEG_CONFIG; 1063 cmd.args[0] = CMD_MPEG_CONFIG;
1064 cmd.args[0x01] = 0; 1064 cmd.args[1] = 0;
1065 cmd.args[0x02] = priv->cfg.ts_mode; 1065 cmd.args[2] = priv->cfg.ts_mode;
1066 cmd.args[0x03] = 0x00; 1066 cmd.args[3] = 0x00;
1067 cmd.args[0x04] = 0x04; 1067 cmd.args[4] = 0x04;
1068 cmd.args[0x05] = 0x00; 1068 cmd.args[5] = 0x00;
1069 cmd.len = 0x06; 1069 cmd.len = 6;
1070 ret = tda10071_cmd_execute(priv, &cmd); 1070 ret = tda10071_cmd_execute(priv, &cmd);
1071 if (ret) 1071 if (ret)
1072 goto error; 1072 goto error;
@@ -1075,27 +1075,27 @@ static int tda10071_init(struct dvb_frontend *fe)
1075 if (ret) 1075 if (ret)
1076 goto error; 1076 goto error;
1077 1077
1078 cmd.args[0x00] = CMD_LNB_CONFIG; 1078 cmd.args[0] = CMD_LNB_CONFIG;
1079 cmd.args[0x01] = 0; 1079 cmd.args[1] = 0;
1080 cmd.args[0x02] = 150; 1080 cmd.args[2] = 150;
1081 cmd.args[0x03] = 3; 1081 cmd.args[3] = 3;
1082 cmd.args[0x04] = 22; 1082 cmd.args[4] = 22;
1083 cmd.args[0x05] = 1; 1083 cmd.args[5] = 1;
1084 cmd.args[0x06] = 1; 1084 cmd.args[6] = 1;
1085 cmd.args[0x07] = 30; 1085 cmd.args[7] = 30;
1086 cmd.args[0x08] = 30; 1086 cmd.args[8] = 30;
1087 cmd.args[0x09] = 30; 1087 cmd.args[9] = 30;
1088 cmd.args[0x0a] = 30; 1088 cmd.args[10] = 30;
1089 cmd.len = 0x0b; 1089 cmd.len = 11;
1090 ret = tda10071_cmd_execute(priv, &cmd); 1090 ret = tda10071_cmd_execute(priv, &cmd);
1091 if (ret) 1091 if (ret)
1092 goto error; 1092 goto error;
1093 1093
1094 cmd.args[0x00] = CMD_BER_CONTROL; 1094 cmd.args[0] = CMD_BER_CONTROL;
1095 cmd.args[0x01] = 0; 1095 cmd.args[1] = 0;
1096 cmd.args[0x02] = 14; 1096 cmd.args[2] = 14;
1097 cmd.args[0x03] = 14; 1097 cmd.args[3] = 14;
1098 cmd.len = 0x04; 1098 cmd.len = 4;
1099 ret = tda10071_cmd_execute(priv, &cmd); 1099 ret = tda10071_cmd_execute(priv, &cmd);
1100 if (ret) 1100 if (ret)
1101 goto error; 1101 goto error;
@@ -1132,10 +1132,10 @@ static int tda10071_sleep(struct dvb_frontend *fe)
1132 goto error; 1132 goto error;
1133 } 1133 }
1134 1134
1135 cmd.args[0x00] = CMD_SET_SLEEP_MODE; 1135 cmd.args[0] = CMD_SET_SLEEP_MODE;
1136 cmd.args[0x01] = 0; 1136 cmd.args[1] = 0;
1137 cmd.args[0x02] = 1; 1137 cmd.args[2] = 1;
1138 cmd.len = 0x03; 1138 cmd.len = 3;
1139 ret = tda10071_cmd_execute(priv, &cmd); 1139 ret = tda10071_cmd_execute(priv, &cmd);
1140 if (ret) 1140 if (ret)
1141 goto error; 1141 goto error;