aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/cx22702.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/frontends/cx22702.c')
-rw-r--r--drivers/media/dvb/frontends/cx22702.c69
1 files changed, 34 insertions, 35 deletions
diff --git a/drivers/media/dvb/frontends/cx22702.c b/drivers/media/dvb/frontends/cx22702.c
index 3139558148ba..faba82485086 100644
--- a/drivers/media/dvb/frontends/cx22702.c
+++ b/drivers/media/dvb/frontends/cx22702.c
@@ -146,7 +146,7 @@ static int cx22702_set_inversion(struct cx22702_state *state, int inversion)
146 146
147/* Retrieve the demod settings */ 147/* Retrieve the demod settings */
148static int cx22702_get_tps(struct cx22702_state *state, 148static int cx22702_get_tps(struct cx22702_state *state,
149 struct dvb_ofdm_parameters *p) 149 struct dtv_frontend_properties *p)
150{ 150{
151 u8 val; 151 u8 val;
152 152
@@ -157,27 +157,27 @@ static int cx22702_get_tps(struct cx22702_state *state,
157 val = cx22702_readreg(state, 0x01); 157 val = cx22702_readreg(state, 0x01);
158 switch ((val & 0x18) >> 3) { 158 switch ((val & 0x18) >> 3) {
159 case 0: 159 case 0:
160 p->constellation = QPSK; 160 p->modulation = QPSK;
161 break; 161 break;
162 case 1: 162 case 1:
163 p->constellation = QAM_16; 163 p->modulation = QAM_16;
164 break; 164 break;
165 case 2: 165 case 2:
166 p->constellation = QAM_64; 166 p->modulation = QAM_64;
167 break; 167 break;
168 } 168 }
169 switch (val & 0x07) { 169 switch (val & 0x07) {
170 case 0: 170 case 0:
171 p->hierarchy_information = HIERARCHY_NONE; 171 p->hierarchy = HIERARCHY_NONE;
172 break; 172 break;
173 case 1: 173 case 1:
174 p->hierarchy_information = HIERARCHY_1; 174 p->hierarchy = HIERARCHY_1;
175 break; 175 break;
176 case 2: 176 case 2:
177 p->hierarchy_information = HIERARCHY_2; 177 p->hierarchy = HIERARCHY_2;
178 break; 178 break;
179 case 3: 179 case 3:
180 p->hierarchy_information = HIERARCHY_4; 180 p->hierarchy = HIERARCHY_4;
181 break; 181 break;
182 } 182 }
183 183
@@ -260,14 +260,14 @@ static int cx22702_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
260} 260}
261 261
262/* Talk to the demod, set the FEC, GUARD, QAM settings etc */ 262/* Talk to the demod, set the FEC, GUARD, QAM settings etc */
263static int cx22702_set_tps(struct dvb_frontend *fe, 263static int cx22702_set_tps(struct dvb_frontend *fe)
264 struct dvb_frontend_parameters *p)
265{ 264{
265 struct dtv_frontend_properties *p = &fe->dtv_property_cache;
266 u8 val; 266 u8 val;
267 struct cx22702_state *state = fe->demodulator_priv; 267 struct cx22702_state *state = fe->demodulator_priv;
268 268
269 if (fe->ops.tuner_ops.set_params) { 269 if (fe->ops.tuner_ops.set_params) {
270 fe->ops.tuner_ops.set_params(fe, p); 270 fe->ops.tuner_ops.set_params(fe);
271 if (fe->ops.i2c_gate_ctrl) 271 if (fe->ops.i2c_gate_ctrl)
272 fe->ops.i2c_gate_ctrl(fe, 0); 272 fe->ops.i2c_gate_ctrl(fe, 0);
273 } 273 }
@@ -277,14 +277,14 @@ static int cx22702_set_tps(struct dvb_frontend *fe,
277 277
278 /* set bandwidth */ 278 /* set bandwidth */
279 val = cx22702_readreg(state, 0x0C) & 0xcf; 279 val = cx22702_readreg(state, 0x0C) & 0xcf;
280 switch (p->u.ofdm.bandwidth) { 280 switch (p->bandwidth_hz) {
281 case BANDWIDTH_6_MHZ: 281 case 6000000:
282 val |= 0x20; 282 val |= 0x20;
283 break; 283 break;
284 case BANDWIDTH_7_MHZ: 284 case 7000000:
285 val |= 0x10; 285 val |= 0x10;
286 break; 286 break;
287 case BANDWIDTH_8_MHZ: 287 case 8000000:
288 break; 288 break;
289 default: 289 default:
290 dprintk("%s: invalid bandwidth\n", __func__); 290 dprintk("%s: invalid bandwidth\n", __func__);
@@ -292,15 +292,15 @@ static int cx22702_set_tps(struct dvb_frontend *fe,
292 } 292 }
293 cx22702_writereg(state, 0x0C, val); 293 cx22702_writereg(state, 0x0C, val);
294 294
295 p->u.ofdm.code_rate_LP = FEC_AUTO; /* temp hack as manual not working */ 295 p->code_rate_LP = FEC_AUTO; /* temp hack as manual not working */
296 296
297 /* use auto configuration? */ 297 /* use auto configuration? */
298 if ((p->u.ofdm.hierarchy_information == HIERARCHY_AUTO) || 298 if ((p->hierarchy == HIERARCHY_AUTO) ||
299 (p->u.ofdm.constellation == QAM_AUTO) || 299 (p->modulation == QAM_AUTO) ||
300 (p->u.ofdm.code_rate_HP == FEC_AUTO) || 300 (p->code_rate_HP == FEC_AUTO) ||
301 (p->u.ofdm.code_rate_LP == FEC_AUTO) || 301 (p->code_rate_LP == FEC_AUTO) ||
302 (p->u.ofdm.guard_interval == GUARD_INTERVAL_AUTO) || 302 (p->guard_interval == GUARD_INTERVAL_AUTO) ||
303 (p->u.ofdm.transmission_mode == TRANSMISSION_MODE_AUTO)) { 303 (p->transmission_mode == TRANSMISSION_MODE_AUTO)) {
304 304
305 /* TPS Source - use hardware driven values */ 305 /* TPS Source - use hardware driven values */
306 cx22702_writereg(state, 0x06, 0x10); 306 cx22702_writereg(state, 0x06, 0x10);
@@ -316,7 +316,7 @@ static int cx22702_set_tps(struct dvb_frontend *fe,
316 } 316 }
317 317
318 /* manually programmed values */ 318 /* manually programmed values */
319 switch (p->u.ofdm.constellation) { /* mask 0x18 */ 319 switch (p->modulation) { /* mask 0x18 */
320 case QPSK: 320 case QPSK:
321 val = 0x00; 321 val = 0x00;
322 break; 322 break;
@@ -327,10 +327,10 @@ static int cx22702_set_tps(struct dvb_frontend *fe,
327 val = 0x10; 327 val = 0x10;
328 break; 328 break;
329 default: 329 default:
330 dprintk("%s: invalid constellation\n", __func__); 330 dprintk("%s: invalid modulation\n", __func__);
331 return -EINVAL; 331 return -EINVAL;
332 } 332 }
333 switch (p->u.ofdm.hierarchy_information) { /* mask 0x07 */ 333 switch (p->hierarchy) { /* mask 0x07 */
334 case HIERARCHY_NONE: 334 case HIERARCHY_NONE:
335 break; 335 break;
336 case HIERARCHY_1: 336 case HIERARCHY_1:
@@ -348,7 +348,7 @@ static int cx22702_set_tps(struct dvb_frontend *fe,
348 } 348 }
349 cx22702_writereg(state, 0x06, val); 349 cx22702_writereg(state, 0x06, val);
350 350
351 switch (p->u.ofdm.code_rate_HP) { /* mask 0x38 */ 351 switch (p->code_rate_HP) { /* mask 0x38 */
352 case FEC_NONE: 352 case FEC_NONE:
353 case FEC_1_2: 353 case FEC_1_2:
354 val = 0x00; 354 val = 0x00;
@@ -369,7 +369,7 @@ static int cx22702_set_tps(struct dvb_frontend *fe,
369 dprintk("%s: invalid code_rate_HP\n", __func__); 369 dprintk("%s: invalid code_rate_HP\n", __func__);
370 return -EINVAL; 370 return -EINVAL;
371 } 371 }
372 switch (p->u.ofdm.code_rate_LP) { /* mask 0x07 */ 372 switch (p->code_rate_LP) { /* mask 0x07 */
373 case FEC_NONE: 373 case FEC_NONE:
374 case FEC_1_2: 374 case FEC_1_2:
375 break; 375 break;
@@ -391,7 +391,7 @@ static int cx22702_set_tps(struct dvb_frontend *fe,
391 } 391 }
392 cx22702_writereg(state, 0x07, val); 392 cx22702_writereg(state, 0x07, val);
393 393
394 switch (p->u.ofdm.guard_interval) { /* mask 0x0c */ 394 switch (p->guard_interval) { /* mask 0x0c */
395 case GUARD_INTERVAL_1_32: 395 case GUARD_INTERVAL_1_32:
396 val = 0x00; 396 val = 0x00;
397 break; 397 break;
@@ -408,7 +408,7 @@ static int cx22702_set_tps(struct dvb_frontend *fe,
408 dprintk("%s: invalid guard_interval\n", __func__); 408 dprintk("%s: invalid guard_interval\n", __func__);
409 return -EINVAL; 409 return -EINVAL;
410 } 410 }
411 switch (p->u.ofdm.transmission_mode) { /* mask 0x03 */ 411 switch (p->transmission_mode) { /* mask 0x03 */
412 case TRANSMISSION_MODE_2K: 412 case TRANSMISSION_MODE_2K:
413 break; 413 break;
414 case TRANSMISSION_MODE_8K: 414 case TRANSMISSION_MODE_8K:
@@ -546,15 +546,15 @@ static int cx22702_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
546 return 0; 546 return 0;
547} 547}
548 548
549static int cx22702_get_frontend(struct dvb_frontend *fe, 549static int cx22702_get_frontend(struct dvb_frontend *fe)
550 struct dvb_frontend_parameters *p)
551{ 550{
551 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
552 struct cx22702_state *state = fe->demodulator_priv; 552 struct cx22702_state *state = fe->demodulator_priv;
553 553
554 u8 reg0C = cx22702_readreg(state, 0x0C); 554 u8 reg0C = cx22702_readreg(state, 0x0C);
555 555
556 p->inversion = reg0C & 0x1 ? INVERSION_ON : INVERSION_OFF; 556 c->inversion = reg0C & 0x1 ? INVERSION_ON : INVERSION_OFF;
557 return cx22702_get_tps(state, &p->u.ofdm); 557 return cx22702_get_tps(state, c);
558} 558}
559 559
560static int cx22702_get_tune_settings(struct dvb_frontend *fe, 560static int cx22702_get_tune_settings(struct dvb_frontend *fe,
@@ -603,10 +603,9 @@ error:
603EXPORT_SYMBOL(cx22702_attach); 603EXPORT_SYMBOL(cx22702_attach);
604 604
605static const struct dvb_frontend_ops cx22702_ops = { 605static const struct dvb_frontend_ops cx22702_ops = {
606 606 .delsys = { SYS_DVBT },
607 .info = { 607 .info = {
608 .name = "Conexant CX22702 DVB-T", 608 .name = "Conexant CX22702 DVB-T",
609 .type = FE_OFDM,
610 .frequency_min = 177000000, 609 .frequency_min = 177000000,
611 .frequency_max = 858000000, 610 .frequency_max = 858000000,
612 .frequency_stepsize = 166666, 611 .frequency_stepsize = 166666,