diff options
Diffstat (limited to 'drivers/media/dvb/frontends/stv0299.c')
-rw-r--r-- | drivers/media/dvb/frontends/stv0299.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/media/dvb/frontends/stv0299.c b/drivers/media/dvb/frontends/stv0299.c index a47cd2b32d60..cfa3928bb487 100644 --- a/drivers/media/dvb/frontends/stv0299.c +++ b/drivers/media/dvb/frontends/stv0299.c | |||
@@ -94,7 +94,7 @@ static int stv0299_writeregI (struct stv0299_state* state, u8 reg, u8 data) | |||
94 | 94 | ||
95 | int stv0299_writereg (struct dvb_frontend* fe, u8 reg, u8 data) | 95 | int stv0299_writereg (struct dvb_frontend* fe, u8 reg, u8 data) |
96 | { | 96 | { |
97 | struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; | 97 | struct stv0299_state* state = fe->demodulator_priv; |
98 | 98 | ||
99 | return stv0299_writeregI(state, reg, data); | 99 | return stv0299_writeregI(state, reg, data); |
100 | } | 100 | } |
@@ -219,7 +219,7 @@ static int stv0299_wait_diseqc_idle (struct stv0299_state* state, int timeout) | |||
219 | 219 | ||
220 | static int stv0299_set_symbolrate (struct dvb_frontend* fe, u32 srate) | 220 | static int stv0299_set_symbolrate (struct dvb_frontend* fe, u32 srate) |
221 | { | 221 | { |
222 | struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; | 222 | struct stv0299_state* state = fe->demodulator_priv; |
223 | u64 big = srate; | 223 | u64 big = srate; |
224 | u32 ratio; | 224 | u32 ratio; |
225 | 225 | ||
@@ -270,7 +270,7 @@ static int stv0299_get_symbolrate (struct stv0299_state* state) | |||
270 | static int stv0299_send_diseqc_msg (struct dvb_frontend* fe, | 270 | static int stv0299_send_diseqc_msg (struct dvb_frontend* fe, |
271 | struct dvb_diseqc_master_cmd *m) | 271 | struct dvb_diseqc_master_cmd *m) |
272 | { | 272 | { |
273 | struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; | 273 | struct stv0299_state* state = fe->demodulator_priv; |
274 | u8 val; | 274 | u8 val; |
275 | int i; | 275 | int i; |
276 | 276 | ||
@@ -300,7 +300,7 @@ static int stv0299_send_diseqc_msg (struct dvb_frontend* fe, | |||
300 | 300 | ||
301 | static int stv0299_send_diseqc_burst (struct dvb_frontend* fe, fe_sec_mini_cmd_t burst) | 301 | static int stv0299_send_diseqc_burst (struct dvb_frontend* fe, fe_sec_mini_cmd_t burst) |
302 | { | 302 | { |
303 | struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; | 303 | struct stv0299_state* state = fe->demodulator_priv; |
304 | u8 val; | 304 | u8 val; |
305 | 305 | ||
306 | dprintk ("%s\n", __FUNCTION__); | 306 | dprintk ("%s\n", __FUNCTION__); |
@@ -327,7 +327,7 @@ static int stv0299_send_diseqc_burst (struct dvb_frontend* fe, fe_sec_mini_cmd_t | |||
327 | 327 | ||
328 | static int stv0299_set_tone (struct dvb_frontend* fe, fe_sec_tone_mode_t tone) | 328 | static int stv0299_set_tone (struct dvb_frontend* fe, fe_sec_tone_mode_t tone) |
329 | { | 329 | { |
330 | struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; | 330 | struct stv0299_state* state = fe->demodulator_priv; |
331 | u8 val; | 331 | u8 val; |
332 | 332 | ||
333 | if (stv0299_wait_diseqc_idle (state, 100) < 0) | 333 | if (stv0299_wait_diseqc_idle (state, 100) < 0) |
@@ -349,7 +349,7 @@ static int stv0299_set_tone (struct dvb_frontend* fe, fe_sec_tone_mode_t tone) | |||
349 | 349 | ||
350 | static int stv0299_set_voltage (struct dvb_frontend* fe, fe_sec_voltage_t voltage) | 350 | static int stv0299_set_voltage (struct dvb_frontend* fe, fe_sec_voltage_t voltage) |
351 | { | 351 | { |
352 | struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; | 352 | struct stv0299_state* state = fe->demodulator_priv; |
353 | u8 reg0x08; | 353 | u8 reg0x08; |
354 | u8 reg0x0c; | 354 | u8 reg0x0c; |
355 | 355 | ||
@@ -471,7 +471,7 @@ static int stv0299_send_legacy_dish_cmd (struct dvb_frontend* fe, u32 cmd) | |||
471 | 471 | ||
472 | static int stv0299_init (struct dvb_frontend* fe) | 472 | static int stv0299_init (struct dvb_frontend* fe) |
473 | { | 473 | { |
474 | struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; | 474 | struct stv0299_state* state = fe->demodulator_priv; |
475 | int i; | 475 | int i; |
476 | 476 | ||
477 | dprintk("stv0299: init chip\n"); | 477 | dprintk("stv0299: init chip\n"); |
@@ -490,7 +490,7 @@ static int stv0299_init (struct dvb_frontend* fe) | |||
490 | 490 | ||
491 | static int stv0299_read_status(struct dvb_frontend* fe, fe_status_t* status) | 491 | static int stv0299_read_status(struct dvb_frontend* fe, fe_status_t* status) |
492 | { | 492 | { |
493 | struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; | 493 | struct stv0299_state* state = fe->demodulator_priv; |
494 | 494 | ||
495 | u8 signal = 0xff - stv0299_readreg (state, 0x18); | 495 | u8 signal = 0xff - stv0299_readreg (state, 0x18); |
496 | u8 sync = stv0299_readreg (state, 0x1b); | 496 | u8 sync = stv0299_readreg (state, 0x1b); |
@@ -518,7 +518,7 @@ static int stv0299_read_status(struct dvb_frontend* fe, fe_status_t* status) | |||
518 | 518 | ||
519 | static int stv0299_read_ber(struct dvb_frontend* fe, u32* ber) | 519 | static int stv0299_read_ber(struct dvb_frontend* fe, u32* ber) |
520 | { | 520 | { |
521 | struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; | 521 | struct stv0299_state* state = fe->demodulator_priv; |
522 | 522 | ||
523 | if (state->errmode != STATUS_BER) return 0; | 523 | if (state->errmode != STATUS_BER) return 0; |
524 | *ber = (stv0299_readreg (state, 0x1d) << 8) | stv0299_readreg (state, 0x1e); | 524 | *ber = (stv0299_readreg (state, 0x1d) << 8) | stv0299_readreg (state, 0x1e); |
@@ -528,7 +528,7 @@ static int stv0299_read_ber(struct dvb_frontend* fe, u32* ber) | |||
528 | 528 | ||
529 | static int stv0299_read_signal_strength(struct dvb_frontend* fe, u16* strength) | 529 | static int stv0299_read_signal_strength(struct dvb_frontend* fe, u16* strength) |
530 | { | 530 | { |
531 | struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; | 531 | struct stv0299_state* state = fe->demodulator_priv; |
532 | 532 | ||
533 | s32 signal = 0xffff - ((stv0299_readreg (state, 0x18) << 8) | 533 | s32 signal = 0xffff - ((stv0299_readreg (state, 0x18) << 8) |
534 | | stv0299_readreg (state, 0x19)); | 534 | | stv0299_readreg (state, 0x19)); |
@@ -545,7 +545,7 @@ static int stv0299_read_signal_strength(struct dvb_frontend* fe, u16* strength) | |||
545 | 545 | ||
546 | static int stv0299_read_snr(struct dvb_frontend* fe, u16* snr) | 546 | static int stv0299_read_snr(struct dvb_frontend* fe, u16* snr) |
547 | { | 547 | { |
548 | struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; | 548 | struct stv0299_state* state = fe->demodulator_priv; |
549 | 549 | ||
550 | s32 xsnr = 0xffff - ((stv0299_readreg (state, 0x24) << 8) | 550 | s32 xsnr = 0xffff - ((stv0299_readreg (state, 0x24) << 8) |
551 | | stv0299_readreg (state, 0x25)); | 551 | | stv0299_readreg (state, 0x25)); |
@@ -557,7 +557,7 @@ static int stv0299_read_snr(struct dvb_frontend* fe, u16* snr) | |||
557 | 557 | ||
558 | static int stv0299_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | 558 | static int stv0299_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) |
559 | { | 559 | { |
560 | struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; | 560 | struct stv0299_state* state = fe->demodulator_priv; |
561 | 561 | ||
562 | if (state->errmode != STATUS_UCBLOCKS) *ucblocks = 0; | 562 | if (state->errmode != STATUS_UCBLOCKS) *ucblocks = 0; |
563 | else *ucblocks = (stv0299_readreg (state, 0x1d) << 8) | stv0299_readreg (state, 0x1e); | 563 | else *ucblocks = (stv0299_readreg (state, 0x1d) << 8) | stv0299_readreg (state, 0x1e); |
@@ -567,7 +567,7 @@ static int stv0299_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | |||
567 | 567 | ||
568 | static int stv0299_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters * p) | 568 | static int stv0299_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters * p) |
569 | { | 569 | { |
570 | struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; | 570 | struct stv0299_state* state = fe->demodulator_priv; |
571 | int invval = 0; | 571 | int invval = 0; |
572 | 572 | ||
573 | dprintk ("%s : FE_SET_FRONTEND\n", __FUNCTION__); | 573 | dprintk ("%s : FE_SET_FRONTEND\n", __FUNCTION__); |
@@ -635,7 +635,7 @@ static int stv0299_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par | |||
635 | 635 | ||
636 | static int stv0299_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters * p) | 636 | static int stv0299_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters * p) |
637 | { | 637 | { |
638 | struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; | 638 | struct stv0299_state* state = fe->demodulator_priv; |
639 | s32 derot_freq; | 639 | s32 derot_freq; |
640 | int invval; | 640 | int invval; |
641 | 641 | ||
@@ -660,7 +660,7 @@ static int stv0299_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_par | |||
660 | 660 | ||
661 | static int stv0299_sleep(struct dvb_frontend* fe) | 661 | static int stv0299_sleep(struct dvb_frontend* fe) |
662 | { | 662 | { |
663 | struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; | 663 | struct stv0299_state* state = fe->demodulator_priv; |
664 | 664 | ||
665 | stv0299_writeregI(state, 0x02, 0x80); | 665 | stv0299_writeregI(state, 0x02, 0x80); |
666 | state->initialised = 0; | 666 | state->initialised = 0; |
@@ -670,7 +670,7 @@ static int stv0299_sleep(struct dvb_frontend* fe) | |||
670 | 670 | ||
671 | static int stv0299_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fesettings) | 671 | static int stv0299_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fesettings) |
672 | { | 672 | { |
673 | struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; | 673 | struct stv0299_state* state = fe->demodulator_priv; |
674 | 674 | ||
675 | fesettings->min_delay_ms = state->config->min_delay_ms; | 675 | fesettings->min_delay_ms = state->config->min_delay_ms; |
676 | if (fesettings->parameters.u.qpsk.symbol_rate < 10000000) { | 676 | if (fesettings->parameters.u.qpsk.symbol_rate < 10000000) { |
@@ -685,7 +685,7 @@ static int stv0299_get_tune_settings(struct dvb_frontend* fe, struct dvb_fronten | |||
685 | 685 | ||
686 | static void stv0299_release(struct dvb_frontend* fe) | 686 | static void stv0299_release(struct dvb_frontend* fe) |
687 | { | 687 | { |
688 | struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; | 688 | struct stv0299_state* state = fe->demodulator_priv; |
689 | kfree(state); | 689 | kfree(state); |
690 | } | 690 | } |
691 | 691 | ||
@@ -698,7 +698,7 @@ struct dvb_frontend* stv0299_attach(const struct stv0299_config* config, | |||
698 | int id; | 698 | int id; |
699 | 699 | ||
700 | /* allocate memory for the internal state */ | 700 | /* allocate memory for the internal state */ |
701 | state = (struct stv0299_state*) kmalloc(sizeof(struct stv0299_state), GFP_KERNEL); | 701 | state = kmalloc(sizeof(struct stv0299_state), GFP_KERNEL); |
702 | if (state == NULL) goto error; | 702 | if (state == NULL) goto error; |
703 | 703 | ||
704 | /* setup the state */ | 704 | /* setup the state */ |