diff options
Diffstat (limited to 'drivers/media/dvb/frontends/l64781.c')
| -rw-r--r-- | drivers/media/dvb/frontends/l64781.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/media/dvb/frontends/l64781.c b/drivers/media/dvb/frontends/l64781.c index 9ac95de9834d..031a1ddc7d11 100644 --- a/drivers/media/dvb/frontends/l64781.c +++ b/drivers/media/dvb/frontends/l64781.c | |||
| @@ -121,7 +121,7 @@ static int reset_and_configure (struct l64781_state* state) | |||
| 121 | 121 | ||
| 122 | static int apply_frontend_param (struct dvb_frontend* fe, struct dvb_frontend_parameters *param) | 122 | static int apply_frontend_param (struct dvb_frontend* fe, struct dvb_frontend_parameters *param) |
| 123 | { | 123 | { |
| 124 | struct l64781_state* state = (struct l64781_state*) fe->demodulator_priv; | 124 | struct l64781_state* state = fe->demodulator_priv; |
| 125 | /* The coderates for FEC_NONE, FEC_4_5 and FEC_FEC_6_7 are arbitrary */ | 125 | /* The coderates for FEC_NONE, FEC_4_5 and FEC_FEC_6_7 are arbitrary */ |
| 126 | static const u8 fec_tab[] = { 7, 0, 1, 2, 9, 3, 10, 4 }; | 126 | static const u8 fec_tab[] = { 7, 0, 1, 2, 9, 3, 10, 4 }; |
| 127 | /* QPSK, QAM_16, QAM_64 */ | 127 | /* QPSK, QAM_16, QAM_64 */ |
| @@ -234,7 +234,7 @@ static int apply_frontend_param (struct dvb_frontend* fe, struct dvb_frontend_pa | |||
| 234 | 234 | ||
| 235 | static int get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters* param) | 235 | static int get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters* param) |
| 236 | { | 236 | { |
| 237 | struct l64781_state* state = (struct l64781_state*) fe->demodulator_priv; | 237 | struct l64781_state* state = fe->demodulator_priv; |
| 238 | int tmp; | 238 | int tmp; |
| 239 | 239 | ||
| 240 | 240 | ||
| @@ -352,7 +352,7 @@ static int get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters* | |||
| 352 | 352 | ||
| 353 | static int l64781_read_status(struct dvb_frontend* fe, fe_status_t* status) | 353 | static int l64781_read_status(struct dvb_frontend* fe, fe_status_t* status) |
| 354 | { | 354 | { |
| 355 | struct l64781_state* state = (struct l64781_state*) fe->demodulator_priv; | 355 | struct l64781_state* state = fe->demodulator_priv; |
| 356 | int sync = l64781_readreg (state, 0x32); | 356 | int sync = l64781_readreg (state, 0x32); |
| 357 | int gain = l64781_readreg (state, 0x0e); | 357 | int gain = l64781_readreg (state, 0x0e); |
| 358 | 358 | ||
| @@ -381,7 +381,7 @@ static int l64781_read_status(struct dvb_frontend* fe, fe_status_t* status) | |||
| 381 | 381 | ||
| 382 | static int l64781_read_ber(struct dvb_frontend* fe, u32* ber) | 382 | static int l64781_read_ber(struct dvb_frontend* fe, u32* ber) |
| 383 | { | 383 | { |
| 384 | struct l64781_state* state = (struct l64781_state*) fe->demodulator_priv; | 384 | struct l64781_state* state = fe->demodulator_priv; |
| 385 | 385 | ||
| 386 | /* XXX FIXME: set up counting period (reg 0x26...0x28) | 386 | /* XXX FIXME: set up counting period (reg 0x26...0x28) |
| 387 | */ | 387 | */ |
| @@ -393,7 +393,7 @@ static int l64781_read_ber(struct dvb_frontend* fe, u32* ber) | |||
| 393 | 393 | ||
| 394 | static int l64781_read_signal_strength(struct dvb_frontend* fe, u16* signal_strength) | 394 | static int l64781_read_signal_strength(struct dvb_frontend* fe, u16* signal_strength) |
| 395 | { | 395 | { |
| 396 | struct l64781_state* state = (struct l64781_state*) fe->demodulator_priv; | 396 | struct l64781_state* state = fe->demodulator_priv; |
| 397 | 397 | ||
| 398 | u8 gain = l64781_readreg (state, 0x0e); | 398 | u8 gain = l64781_readreg (state, 0x0e); |
| 399 | *signal_strength = (gain << 8) | gain; | 399 | *signal_strength = (gain << 8) | gain; |
| @@ -403,7 +403,7 @@ static int l64781_read_signal_strength(struct dvb_frontend* fe, u16* signal_stre | |||
| 403 | 403 | ||
| 404 | static int l64781_read_snr(struct dvb_frontend* fe, u16* snr) | 404 | static int l64781_read_snr(struct dvb_frontend* fe, u16* snr) |
| 405 | { | 405 | { |
| 406 | struct l64781_state* state = (struct l64781_state*) fe->demodulator_priv; | 406 | struct l64781_state* state = fe->demodulator_priv; |
| 407 | 407 | ||
| 408 | u8 avg_quality = 0xff - l64781_readreg (state, 0x33); | 408 | u8 avg_quality = 0xff - l64781_readreg (state, 0x33); |
| 409 | *snr = (avg_quality << 8) | avg_quality; /* not exact, but...*/ | 409 | *snr = (avg_quality << 8) | avg_quality; /* not exact, but...*/ |
| @@ -413,7 +413,7 @@ static int l64781_read_snr(struct dvb_frontend* fe, u16* snr) | |||
| 413 | 413 | ||
| 414 | static int l64781_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | 414 | static int l64781_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) |
| 415 | { | 415 | { |
| 416 | struct l64781_state* state = (struct l64781_state*) fe->demodulator_priv; | 416 | struct l64781_state* state = fe->demodulator_priv; |
| 417 | 417 | ||
| 418 | *ucblocks = l64781_readreg (state, 0x37) | 418 | *ucblocks = l64781_readreg (state, 0x37) |
| 419 | | (l64781_readreg (state, 0x38) << 8); | 419 | | (l64781_readreg (state, 0x38) << 8); |
| @@ -423,7 +423,7 @@ static int l64781_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | |||
| 423 | 423 | ||
| 424 | static int l64781_sleep(struct dvb_frontend* fe) | 424 | static int l64781_sleep(struct dvb_frontend* fe) |
| 425 | { | 425 | { |
| 426 | struct l64781_state* state = (struct l64781_state*) fe->demodulator_priv; | 426 | struct l64781_state* state = fe->demodulator_priv; |
| 427 | 427 | ||
| 428 | /* Power down */ | 428 | /* Power down */ |
| 429 | return l64781_writereg (state, 0x3e, 0x5a); | 429 | return l64781_writereg (state, 0x3e, 0x5a); |
| @@ -431,7 +431,7 @@ static int l64781_sleep(struct dvb_frontend* fe) | |||
| 431 | 431 | ||
| 432 | static int l64781_init(struct dvb_frontend* fe) | 432 | static int l64781_init(struct dvb_frontend* fe) |
| 433 | { | 433 | { |
| 434 | struct l64781_state* state = (struct l64781_state*) fe->demodulator_priv; | 434 | struct l64781_state* state = fe->demodulator_priv; |
| 435 | 435 | ||
| 436 | reset_and_configure (state); | 436 | reset_and_configure (state); |
| 437 | 437 | ||
| @@ -484,7 +484,7 @@ static int l64781_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend | |||
| 484 | 484 | ||
| 485 | static void l64781_release(struct dvb_frontend* fe) | 485 | static void l64781_release(struct dvb_frontend* fe) |
| 486 | { | 486 | { |
| 487 | struct l64781_state* state = (struct l64781_state*) fe->demodulator_priv; | 487 | struct l64781_state* state = fe->demodulator_priv; |
| 488 | kfree(state); | 488 | kfree(state); |
| 489 | } | 489 | } |
| 490 | 490 | ||
| @@ -501,7 +501,7 @@ struct dvb_frontend* l64781_attach(const struct l64781_config* config, | |||
| 501 | { .addr = config->demod_address, .flags = I2C_M_RD, .buf = b1, .len = 1 } }; | 501 | { .addr = config->demod_address, .flags = I2C_M_RD, .buf = b1, .len = 1 } }; |
| 502 | 502 | ||
| 503 | /* allocate memory for the internal state */ | 503 | /* allocate memory for the internal state */ |
| 504 | state = (struct l64781_state*) kmalloc(sizeof(struct l64781_state), GFP_KERNEL); | 504 | state = kmalloc(sizeof(struct l64781_state), GFP_KERNEL); |
| 505 | if (state == NULL) goto error; | 505 | if (state == NULL) goto error; |
| 506 | 506 | ||
| 507 | /* setup the state */ | 507 | /* setup the state */ |
