aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/dib0070.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/frontends/dib0070.c')
-rw-r--r--drivers/media/dvb/frontends/dib0070.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/media/dvb/frontends/dib0070.c b/drivers/media/dvb/frontends/dib0070.c
index 481eaa684157..fe895bf7b18f 100644
--- a/drivers/media/dvb/frontends/dib0070.c
+++ b/drivers/media/dvb/frontends/dib0070.c
@@ -434,9 +434,14 @@ static u16 dib0070_p1f_defaults[] =
434 0, 434 0,
435}; 435};
436 436
437static void dib0070_wbd_calibration(struct dib0070_state *state) 437static void dib0070_wbd_calibration(struct dvb_frontend *fe)
438{ 438{
439 u16 wbd_offs; 439 u16 wbd_offs;
440 struct dib0070_state *state = fe->tuner_priv;
441
442 if (state->cfg->sleep)
443 state->cfg->sleep(fe, 0);
444
440 dib0070_write_reg(state, 0x0f, 0x6d81); 445 dib0070_write_reg(state, 0x0f, 0x6d81);
441 dib0070_write_reg(state, 0x20, 0x0040 | 0x0020 | 0x0010 | 0x0008 | 0x0002 | 0x0001); 446 dib0070_write_reg(state, 0x20, 0x0040 | 0x0020 | 0x0010 | 0x0008 | 0x0002 | 0x0001);
442 msleep(9); 447 msleep(9);
@@ -444,6 +449,10 @@ static void dib0070_wbd_calibration(struct dib0070_state *state)
444 dib0070_write_reg(state, 0x20, 0); 449 dib0070_write_reg(state, 0x20, 0);
445 state->wbd_ff_offset = ((wbd_offs * 8 * 18 / 33 + 1) / 2); 450 state->wbd_ff_offset = ((wbd_offs * 8 * 18 / 33 + 1) / 2);
446 dprintk( "WBDStart = %d (Vargen) - FF = %hd", (u32) wbd_offs * 1800/1024, state->wbd_ff_offset); 451 dprintk( "WBDStart = %d (Vargen) - FF = %hd", (u32) wbd_offs * 1800/1024, state->wbd_ff_offset);
452
453 if (state->cfg->sleep)
454 state->cfg->sleep(fe, 1);
455
447} 456}
448 457
449u16 dib0070_wbd_offset(struct dvb_frontend *fe) 458u16 dib0070_wbd_offset(struct dvb_frontend *fe)
@@ -560,7 +569,7 @@ struct dvb_frontend * dib0070_attach(struct dvb_frontend *fe, struct i2c_adapter
560 if (dib0070_reset(state) != 0) 569 if (dib0070_reset(state) != 0)
561 goto free_mem; 570 goto free_mem;
562 571
563 dib0070_wbd_calibration(state); 572 dib0070_wbd_calibration(fe);
564 573
565 printk(KERN_INFO "DiB0070: successfully identified\n"); 574 printk(KERN_INFO "DiB0070: successfully identified\n");
566 memcpy(&fe->ops.tuner_ops, &dib0070_ops, sizeof(struct dvb_tuner_ops)); 575 memcpy(&fe->ops.tuner_ops, &dib0070_ops, sizeof(struct dvb_tuner_ops));