aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/s5h1409.c
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2007-07-28 19:02:55 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-09 21:03:40 -0400
commit3873dd041465799cfdeb642531c0ade4fb6614e5 (patch)
treea818b9878ebe6ccda2546948a1f44072aec55463 /drivers/media/dvb/frontends/s5h1409.c
parenta45c92756ed60bc89528701ac512e954acd23b9e (diff)
V4L/DVB (5950): whitespace cleanup for mt2131 and s5h1409
- trivial whitespace cleanups - add "c-basic-offset: 8" to enforce tabbing style in emacs Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/frontends/s5h1409.c')
-rw-r--r--drivers/media/dvb/frontends/s5h1409.c48
1 files changed, 31 insertions, 17 deletions
diff --git a/drivers/media/dvb/frontends/s5h1409.c b/drivers/media/dvb/frontends/s5h1409.c
index 25cf78142d94..30e8a705fad4 100644
--- a/drivers/media/dvb/frontends/s5h1409.c
+++ b/drivers/media/dvb/frontends/s5h1409.c
@@ -296,13 +296,14 @@ static int s5h1409_writereg(struct s5h1409_state* state, u8 reg, u16 data)
296 int ret; 296 int ret;
297 u8 buf [] = { reg, data >> 8, data & 0xff }; 297 u8 buf [] = { reg, data >> 8, data & 0xff };
298 298
299 struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = buf, .len = 3 }; 299 struct i2c_msg msg = { .addr = state->config->demod_address,
300 .flags = 0, .buf = buf, .len = 3 };
300 301
301 ret = i2c_transfer(state->i2c, &msg, 1); 302 ret = i2c_transfer(state->i2c, &msg, 1);
302 303
303 if (ret != 1) 304 if (ret != 1)
304 printk("%s: writereg error (reg == 0x%02x, val == 0x%04x, ret == %i)\n", 305 printk("%s: writereg error (reg == 0x%02x, val == 0x%04x, "
305 __FUNCTION__, reg, data, ret); 306 "ret == %i)\n", __FUNCTION__, reg, data, ret);
306 307
307 return (ret != 1) ? -1 : 0; 308 return (ret != 1) ? -1 : 0;
308} 309}
@@ -314,14 +315,15 @@ static u16 s5h1409_readreg(struct s5h1409_state* state, u8 reg)
314 u8 b1 [] = { 0, 0 }; 315 u8 b1 [] = { 0, 0 };
315 316
316 struct i2c_msg msg [] = { 317 struct i2c_msg msg [] = {
317 { .addr = state->config->demod_address, .flags = 0, .buf = b0, .len = 1 }, 318 { .addr = state->config->demod_address, .flags = 0,
318 { .addr = state->config->demod_address, .flags = I2C_M_RD, .buf = b1, .len = 2 } }; 319 .buf = b0, .len = 1 },
320 { .addr = state->config->demod_address, .flags = I2C_M_RD,
321 .buf = b1, .len = 2 } };
319 322
320 ret = i2c_transfer(state->i2c, msg, 2); 323 ret = i2c_transfer(state->i2c, msg, 2);
321 324
322 if (ret != 2) 325 if (ret != 2)
323 printk("%s: readreg error (ret == %i)\n", __FUNCTION__, ret) 326 printk("%s: readreg error (ret == %i)\n", __FUNCTION__, ret);
324 ;
325 return (b1[0] << 8) | b1[1]; 327 return (b1[0] << 8) | b1[1];
326} 328}
327 329
@@ -343,8 +345,7 @@ static int s5h1409_set_if_freq(struct dvb_frontend* fe, int KHz)
343 345
344 dprintk("%s(%d KHz)\n", __FUNCTION__, KHz); 346 dprintk("%s(%d KHz)\n", __FUNCTION__, KHz);
345 347
346 if( (KHz == 44000) || (KHz == 5380) ) 348 if( (KHz == 44000) || (KHz == 5380) ) {
347 {
348 s5h1409_writereg(state, 0x87, 0x01be); 349 s5h1409_writereg(state, 0x87, 0x01be);
349 s5h1409_writereg(state, 0x88, 0x0436); 350 s5h1409_writereg(state, 0x88, 0x0436);
350 s5h1409_writereg(state, 0x89, 0x054d); 351 s5h1409_writereg(state, 0x89, 0x054d);
@@ -368,7 +369,8 @@ static int s5h1409_set_spectralinversion(struct dvb_frontend* fe, int inverted)
368 return s5h1409_writereg(state, 0x1b, 0x0110); /* Normal */ 369 return s5h1409_writereg(state, 0x1b, 0x0110); /* Normal */
369} 370}
370 371
371static int s5h1409_enable_modulation(struct dvb_frontend* fe, fe_modulation_t m) 372static int s5h1409_enable_modulation(struct dvb_frontend* fe,
373 fe_modulation_t m)
372{ 374{
373 struct s5h1409_state* state = fe->demodulator_priv; 375 struct s5h1409_state* state = fe->demodulator_priv;
374 376
@@ -443,7 +445,8 @@ static int s5h1409_register_reset(struct dvb_frontend* fe)
443} 445}
444 446
445/* Talk to the demod, set the FEC, GUARD, QAM settings etc */ 447/* Talk to the demod, set the FEC, GUARD, QAM settings etc */
446static int s5h1409_set_frontend (struct dvb_frontend* fe, struct dvb_frontend_parameters *p) 448static int s5h1409_set_frontend (struct dvb_frontend* fe,
449 struct dvb_frontend_parameters *p)
447{ 450{
448 struct s5h1409_state* state = fe->demodulator_priv; 451 struct s5h1409_state* state = fe->demodulator_priv;
449 452
@@ -521,11 +524,13 @@ static int s5h1409_read_status(struct dvb_frontend* fe, fe_status_t* status)
521 case S5H1409_TUNERLOCKING: 524 case S5H1409_TUNERLOCKING:
522 /* Get the tuner status */ 525 /* Get the tuner status */
523 if (fe->ops.tuner_ops.get_status) { 526 if (fe->ops.tuner_ops.get_status) {
524 if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 1); 527 if (fe->ops.i2c_gate_ctrl)
528 fe->ops.i2c_gate_ctrl(fe, 1);
525 529
526 fe->ops.tuner_ops.get_status(fe, &tuner_status); 530 fe->ops.tuner_ops.get_status(fe, &tuner_status);
527 531
528 if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0); 532 if (fe->ops.i2c_gate_ctrl)
533 fe->ops.i2c_gate_ctrl(fe, 0);
529 } 534 }
530 if (tuner_status) 535 if (tuner_status)
531 *status |= FE_HAS_CARRIER | FE_HAS_SIGNAL; 536 *status |= FE_HAS_CARRIER | FE_HAS_SIGNAL;
@@ -605,7 +610,8 @@ static int s5h1409_read_snr(struct dvb_frontend* fe, u16* snr)
605 return -EINVAL; 610 return -EINVAL;
606} 611}
607 612
608static int s5h1409_read_signal_strength(struct dvb_frontend* fe, u16* signal_strength) 613static int s5h1409_read_signal_strength(struct dvb_frontend* fe,
614 u16* signal_strength)
609{ 615{
610 return s5h1409_read_snr(fe, signal_strength); 616 return s5h1409_read_snr(fe, signal_strength);
611} 617}
@@ -624,7 +630,8 @@ static int s5h1409_read_ber(struct dvb_frontend* fe, u32* ber)
624 return s5h1409_read_ucblocks(fe, ber); 630 return s5h1409_read_ucblocks(fe, ber);
625} 631}
626 632
627static int s5h1409_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) 633static int s5h1409_get_frontend(struct dvb_frontend* fe,
634 struct dvb_frontend_parameters *p)
628{ 635{
629 struct s5h1409_state* state = fe->demodulator_priv; 636 struct s5h1409_state* state = fe->demodulator_priv;
630 637
@@ -634,7 +641,8 @@ static int s5h1409_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
634 return 0; 641 return 0;
635} 642}
636 643
637static int s5h1409_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings *tune) 644static int s5h1409_get_tune_settings(struct dvb_frontend* fe,
645 struct dvb_frontend_tune_settings *tune)
638{ 646{
639 tune->min_delay_ms = 1000; 647 tune->min_delay_ms = 1000;
640 return 0; 648 return 0;
@@ -668,7 +676,8 @@ struct dvb_frontend* s5h1409_attach(const struct s5h1409_config* config,
668 goto error; 676 goto error;
669 677
670 /* create dvb_frontend */ 678 /* create dvb_frontend */
671 memcpy(&state->frontend.ops, &s5h1409_ops, sizeof(struct dvb_frontend_ops)); 679 memcpy(&state->frontend.ops, &s5h1409_ops,
680 sizeof(struct dvb_frontend_ops));
672 state->frontend.demodulator_priv = state; 681 state->frontend.demodulator_priv = state;
673 682
674 /* Note: Leaving the I2C gate open here. */ 683 /* Note: Leaving the I2C gate open here. */
@@ -713,3 +722,8 @@ MODULE_AUTHOR("Steven Toth");
713MODULE_LICENSE("GPL"); 722MODULE_LICENSE("GPL");
714 723
715EXPORT_SYMBOL(s5h1409_attach); 724EXPORT_SYMBOL(s5h1409_attach);
725
726/*
727 * Local variables:
728 * c-basic-offset: 8
729 */