aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/tda1004x.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/frontends/tda1004x.c')
-rw-r--r--drivers/media/dvb/frontends/tda1004x.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/drivers/media/dvb/frontends/tda1004x.c b/drivers/media/dvb/frontends/tda1004x.c
index 8415a8a5247a..49973846373e 100644
--- a/drivers/media/dvb/frontends/tda1004x.c
+++ b/drivers/media/dvb/frontends/tda1004x.c
@@ -131,16 +131,16 @@ static int tda1004x_write_byteI(struct tda1004x_state *state, int reg, int data)
131 u8 buf[] = { reg, data }; 131 u8 buf[] = { reg, data };
132 struct i2c_msg msg = { .flags = 0, .buf = buf, .len = 2 }; 132 struct i2c_msg msg = { .flags = 0, .buf = buf, .len = 2 };
133 133
134 dprintk("%s: reg=0x%x, data=0x%x\n", __FUNCTION__, reg, data); 134 dprintk("%s: reg=0x%x, data=0x%x\n", __func__, reg, data);
135 135
136 msg.addr = state->config->demod_address; 136 msg.addr = state->config->demod_address;
137 ret = i2c_transfer(state->i2c, &msg, 1); 137 ret = i2c_transfer(state->i2c, &msg, 1);
138 138
139 if (ret != 1) 139 if (ret != 1)
140 dprintk("%s: error reg=0x%x, data=0x%x, ret=%i\n", 140 dprintk("%s: error reg=0x%x, data=0x%x, ret=%i\n",
141 __FUNCTION__, reg, data, ret); 141 __func__, reg, data, ret);
142 142
143 dprintk("%s: success reg=0x%x, data=0x%x, ret=%i\n", __FUNCTION__, 143 dprintk("%s: success reg=0x%x, data=0x%x, ret=%i\n", __func__,
144 reg, data, ret); 144 reg, data, ret);
145 return (ret != 1) ? -1 : 0; 145 return (ret != 1) ? -1 : 0;
146} 146}
@@ -153,19 +153,19 @@ static int tda1004x_read_byte(struct tda1004x_state *state, int reg)
153 struct i2c_msg msg[] = {{ .flags = 0, .buf = b0, .len = 1 }, 153 struct i2c_msg msg[] = {{ .flags = 0, .buf = b0, .len = 1 },
154 { .flags = I2C_M_RD, .buf = b1, .len = 1 }}; 154 { .flags = I2C_M_RD, .buf = b1, .len = 1 }};
155 155
156 dprintk("%s: reg=0x%x\n", __FUNCTION__, reg); 156 dprintk("%s: reg=0x%x\n", __func__, reg);
157 157
158 msg[0].addr = state->config->demod_address; 158 msg[0].addr = state->config->demod_address;
159 msg[1].addr = state->config->demod_address; 159 msg[1].addr = state->config->demod_address;
160 ret = i2c_transfer(state->i2c, msg, 2); 160 ret = i2c_transfer(state->i2c, msg, 2);
161 161
162 if (ret != 2) { 162 if (ret != 2) {
163 dprintk("%s: error reg=0x%x, ret=%i\n", __FUNCTION__, reg, 163 dprintk("%s: error reg=0x%x, ret=%i\n", __func__, reg,
164 ret); 164 ret);
165 return -1; 165 return -1;
166 } 166 }
167 167
168 dprintk("%s: success reg=0x%x, data=0x%x, ret=%i\n", __FUNCTION__, 168 dprintk("%s: success reg=0x%x, data=0x%x, ret=%i\n", __func__,
169 reg, b1[0], ret); 169 reg, b1[0], ret);
170 return b1[0]; 170 return b1[0];
171} 171}
@@ -173,7 +173,7 @@ static int tda1004x_read_byte(struct tda1004x_state *state, int reg)
173static int tda1004x_write_mask(struct tda1004x_state *state, int reg, int mask, int data) 173static int tda1004x_write_mask(struct tda1004x_state *state, int reg, int mask, int data)
174{ 174{
175 int val; 175 int val;
176 dprintk("%s: reg=0x%x, mask=0x%x, data=0x%x\n", __FUNCTION__, reg, 176 dprintk("%s: reg=0x%x, mask=0x%x, data=0x%x\n", __func__, reg,
177 mask, data); 177 mask, data);
178 178
179 // read a byte and check 179 // read a byte and check
@@ -194,7 +194,7 @@ static int tda1004x_write_buf(struct tda1004x_state *state, int reg, unsigned ch
194 int i; 194 int i;
195 int result; 195 int result;
196 196
197 dprintk("%s: reg=0x%x, len=0x%x\n", __FUNCTION__, reg, len); 197 dprintk("%s: reg=0x%x, len=0x%x\n", __func__, reg, len);
198 198
199 result = 0; 199 result = 0;
200 for (i = 0; i < len; i++) { 200 for (i = 0; i < len; i++) {
@@ -209,7 +209,7 @@ static int tda1004x_write_buf(struct tda1004x_state *state, int reg, unsigned ch
209static int tda1004x_enable_tuner_i2c(struct tda1004x_state *state) 209static int tda1004x_enable_tuner_i2c(struct tda1004x_state *state)
210{ 210{
211 int result; 211 int result;
212 dprintk("%s\n", __FUNCTION__); 212 dprintk("%s\n", __func__);
213 213
214 result = tda1004x_write_mask(state, TDA1004X_CONFC4, 2, 2); 214 result = tda1004x_write_mask(state, TDA1004X_CONFC4, 2, 2);
215 msleep(20); 215 msleep(20);
@@ -218,7 +218,7 @@ static int tda1004x_enable_tuner_i2c(struct tda1004x_state *state)
218 218
219static int tda1004x_disable_tuner_i2c(struct tda1004x_state *state) 219static int tda1004x_disable_tuner_i2c(struct tda1004x_state *state)
220{ 220{
221 dprintk("%s\n", __FUNCTION__); 221 dprintk("%s\n", __func__);
222 222
223 return tda1004x_write_mask(state, TDA1004X_CONFC4, 2, 0); 223 return tda1004x_write_mask(state, TDA1004X_CONFC4, 2, 0);
224} 224}
@@ -345,7 +345,7 @@ static int tda1004x_do_upload(struct tda1004x_state *state,
345 } 345 }
346 pos += tx_size; 346 pos += tx_size;
347 347
348 dprintk("%s: fw_pos=0x%x\n", __FUNCTION__, pos); 348 dprintk("%s: fw_pos=0x%x\n", __func__, pos);
349 } 349 }
350 // give the DSP a chance to settle 03/10/05 Hac 350 // give the DSP a chance to settle 03/10/05 Hac
351 msleep(100); 351 msleep(100);
@@ -444,10 +444,10 @@ static void tda10046_init_plls(struct dvb_frontend* fe)
444 tda1004x_write_byteI(state, TDA10046H_CONFPLL2, 0x03); // PLL M = 3 444 tda1004x_write_byteI(state, TDA10046H_CONFPLL2, 0x03); // PLL M = 3
445 } 445 }
446 if (state->config->xtal_freq == TDA10046_XTAL_4M ) { 446 if (state->config->xtal_freq == TDA10046_XTAL_4M ) {
447 dprintk("%s: setting up PLLs for a 4 MHz Xtal\n", __FUNCTION__); 447 dprintk("%s: setting up PLLs for a 4 MHz Xtal\n", __func__);
448 tda1004x_write_byteI(state, TDA10046H_CONFPLL3, 0); // PLL P = N = 0 448 tda1004x_write_byteI(state, TDA10046H_CONFPLL3, 0); // PLL P = N = 0
449 } else { 449 } else {
450 dprintk("%s: setting up PLLs for a 16 MHz Xtal\n", __FUNCTION__); 450 dprintk("%s: setting up PLLs for a 16 MHz Xtal\n", __func__);
451 tda1004x_write_byteI(state, TDA10046H_CONFPLL3, 3); // PLL P = 0, N = 3 451 tda1004x_write_byteI(state, TDA10046H_CONFPLL3, 3); // PLL P = 0, N = 3
452 } 452 }
453 if(tda10046_clk53m) 453 if(tda10046_clk53m)
@@ -488,7 +488,7 @@ static int tda10046_fwupload(struct dvb_frontend* fe)
488 if (state->config->xtal_freq == TDA10046_XTAL_4M) { 488 if (state->config->xtal_freq == TDA10046_XTAL_4M) {
489 tda1004x_write_byteI(state, TDA1004X_CONFC4, 0); 489 tda1004x_write_byteI(state, TDA1004X_CONFC4, 0);
490 } else { 490 } else {
491 dprintk("%s: 16MHz Xtal, reducing I2C speed\n", __FUNCTION__); 491 dprintk("%s: 16MHz Xtal, reducing I2C speed\n", __func__);
492 tda1004x_write_byteI(state, TDA1004X_CONFC4, 0x80); 492 tda1004x_write_byteI(state, TDA1004X_CONFC4, 0x80);
493 } 493 }
494 tda1004x_write_mask(state, TDA10046H_CONF_TRISTATE1, 1, 0); 494 tda1004x_write_mask(state, TDA10046H_CONF_TRISTATE1, 1, 0);
@@ -594,7 +594,7 @@ static int tda10045_init(struct dvb_frontend* fe)
594{ 594{
595 struct tda1004x_state* state = fe->demodulator_priv; 595 struct tda1004x_state* state = fe->demodulator_priv;
596 596
597 dprintk("%s\n", __FUNCTION__); 597 dprintk("%s\n", __func__);
598 598
599 if (tda10045_fwupload(fe)) { 599 if (tda10045_fwupload(fe)) {
600 printk("tda1004x: firmware upload failed\n"); 600 printk("tda1004x: firmware upload failed\n");
@@ -624,7 +624,7 @@ static int tda10045_init(struct dvb_frontend* fe)
624static int tda10046_init(struct dvb_frontend* fe) 624static int tda10046_init(struct dvb_frontend* fe)
625{ 625{
626 struct tda1004x_state* state = fe->demodulator_priv; 626 struct tda1004x_state* state = fe->demodulator_priv;
627 dprintk("%s\n", __FUNCTION__); 627 dprintk("%s\n", __func__);
628 628
629 if (tda10046_fwupload(fe)) { 629 if (tda10046_fwupload(fe)) {
630 printk("tda1004x: firmware upload failed\n"); 630 printk("tda1004x: firmware upload failed\n");
@@ -686,7 +686,7 @@ static int tda1004x_set_fe(struct dvb_frontend* fe,
686 int tmp; 686 int tmp;
687 int inversion; 687 int inversion;
688 688
689 dprintk("%s\n", __FUNCTION__); 689 dprintk("%s\n", __func__);
690 690
691 if (state->demod_type == TDA1004X_DEMOD_TDA10046) { 691 if (state->demod_type == TDA1004X_DEMOD_TDA10046) {
692 // setup auto offset 692 // setup auto offset
@@ -881,7 +881,7 @@ static int tda1004x_get_fe(struct dvb_frontend* fe, struct dvb_frontend_paramete
881{ 881{
882 struct tda1004x_state* state = fe->demodulator_priv; 882 struct tda1004x_state* state = fe->demodulator_priv;
883 883
884 dprintk("%s\n", __FUNCTION__); 884 dprintk("%s\n", __func__);
885 885
886 // inversion status 886 // inversion status
887 fe_params->inversion = INVERSION_OFF; 887 fe_params->inversion = INVERSION_OFF;
@@ -989,7 +989,7 @@ static int tda1004x_read_status(struct dvb_frontend* fe, fe_status_t * fe_status
989 int cber; 989 int cber;
990 int vber; 990 int vber;
991 991
992 dprintk("%s\n", __FUNCTION__); 992 dprintk("%s\n", __func__);
993 993
994 // read status 994 // read status
995 status = tda1004x_read_byte(state, TDA1004X_STATUS_CD); 995 status = tda1004x_read_byte(state, TDA1004X_STATUS_CD);
@@ -1048,7 +1048,7 @@ static int tda1004x_read_status(struct dvb_frontend* fe, fe_status_t * fe_status
1048 } 1048 }
1049 1049
1050 // success 1050 // success
1051 dprintk("%s: fe_status=0x%x\n", __FUNCTION__, *fe_status); 1051 dprintk("%s: fe_status=0x%x\n", __func__, *fe_status);
1052 return 0; 1052 return 0;
1053} 1053}
1054 1054
@@ -1058,7 +1058,7 @@ static int tda1004x_read_signal_strength(struct dvb_frontend* fe, u16 * signal)
1058 int tmp; 1058 int tmp;
1059 int reg = 0; 1059 int reg = 0;
1060 1060
1061 dprintk("%s\n", __FUNCTION__); 1061 dprintk("%s\n", __func__);
1062 1062
1063 // determine the register to use 1063 // determine the register to use
1064 switch (state->demod_type) { 1064 switch (state->demod_type) {
@@ -1077,7 +1077,7 @@ static int tda1004x_read_signal_strength(struct dvb_frontend* fe, u16 * signal)
1077 return -EIO; 1077 return -EIO;
1078 1078
1079 *signal = (tmp << 8) | tmp; 1079 *signal = (tmp << 8) | tmp;
1080 dprintk("%s: signal=0x%x\n", __FUNCTION__, *signal); 1080 dprintk("%s: signal=0x%x\n", __func__, *signal);
1081 return 0; 1081 return 0;
1082} 1082}
1083 1083
@@ -1086,7 +1086,7 @@ static int tda1004x_read_snr(struct dvb_frontend* fe, u16 * snr)
1086 struct tda1004x_state* state = fe->demodulator_priv; 1086 struct tda1004x_state* state = fe->demodulator_priv;
1087 int tmp; 1087 int tmp;
1088 1088
1089 dprintk("%s\n", __FUNCTION__); 1089 dprintk("%s\n", __func__);
1090 1090
1091 // read it 1091 // read it
1092 tmp = tda1004x_read_byte(state, TDA1004X_SNR); 1092 tmp = tda1004x_read_byte(state, TDA1004X_SNR);
@@ -1095,7 +1095,7 @@ static int tda1004x_read_snr(struct dvb_frontend* fe, u16 * snr)
1095 tmp = 255 - tmp; 1095 tmp = 255 - tmp;
1096 1096
1097 *snr = ((tmp << 8) | tmp); 1097 *snr = ((tmp << 8) | tmp);
1098 dprintk("%s: snr=0x%x\n", __FUNCTION__, *snr); 1098 dprintk("%s: snr=0x%x\n", __func__, *snr);
1099 return 0; 1099 return 0;
1100} 1100}
1101 1101
@@ -1106,7 +1106,7 @@ static int tda1004x_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
1106 int tmp2; 1106 int tmp2;
1107 int counter; 1107 int counter;
1108 1108
1109 dprintk("%s\n", __FUNCTION__); 1109 dprintk("%s\n", __func__);
1110 1110
1111 // read the UCBLOCKS and reset 1111 // read the UCBLOCKS and reset
1112 counter = 0; 1112 counter = 0;
@@ -1132,7 +1132,7 @@ static int tda1004x_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
1132 else 1132 else
1133 *ucblocks = 0xffffffff; 1133 *ucblocks = 0xffffffff;
1134 1134
1135 dprintk("%s: ucblocks=0x%x\n", __FUNCTION__, *ucblocks); 1135 dprintk("%s: ucblocks=0x%x\n", __func__, *ucblocks);
1136 return 0; 1136 return 0;
1137} 1137}
1138 1138
@@ -1141,7 +1141,7 @@ static int tda1004x_read_ber(struct dvb_frontend* fe, u32* ber)
1141 struct tda1004x_state* state = fe->demodulator_priv; 1141 struct tda1004x_state* state = fe->demodulator_priv;
1142 int tmp; 1142 int tmp;
1143 1143
1144 dprintk("%s\n", __FUNCTION__); 1144 dprintk("%s\n", __func__);
1145 1145
1146 // read it in 1146 // read it in
1147 tmp = tda1004x_read_byte(state, TDA1004X_CBER_LSB); 1147 tmp = tda1004x_read_byte(state, TDA1004X_CBER_LSB);
@@ -1155,7 +1155,7 @@ static int tda1004x_read_ber(struct dvb_frontend* fe, u32* ber)
1155 // The address 0x20 should be read to cope with a TDA10046 bug 1155 // The address 0x20 should be read to cope with a TDA10046 bug
1156 tda1004x_read_byte(state, TDA1004X_CBER_RESET); 1156 tda1004x_read_byte(state, TDA1004X_CBER_RESET);
1157 1157
1158 dprintk("%s: ber=0x%x\n", __FUNCTION__, *ber); 1158 dprintk("%s: ber=0x%x\n", __func__, *ber);
1159 return 0; 1159 return 0;
1160} 1160}
1161 1161