aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/tda18271-common.c
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2008-01-13 15:01:01 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-01-25 16:04:58 -0500
commit518d87399baee908b0353bc0ef7d41c3c46295ec (patch)
tree9d0c2cd42c6b533854616921fbbb18e108ec924c /drivers/media/dvb/frontends/tda18271-common.c
parent6bfa6657246013bf999fecda0874105441f6ecb5 (diff)
V4L/DVB (7027): tda18271: put the device in standby mode during sleep()
Add function, tda18271_set_standby_mode. During sleep, enter standby mode with slave tuner output enabled, loop through on and xtal oscillator on. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/frontends/tda18271-common.c')
-rw-r--r--drivers/media/dvb/frontends/tda18271-common.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/media/dvb/frontends/tda18271-common.c b/drivers/media/dvb/frontends/tda18271-common.c
index d7a335659474..cebb6b90b7e0 100644
--- a/drivers/media/dvb/frontends/tda18271-common.c
+++ b/drivers/media/dvb/frontends/tda18271-common.c
@@ -452,6 +452,42 @@ int tda18271_init_regs(struct dvb_frontend *fe)
452 452
453/*---------------------------------------------------------------------*/ 453/*---------------------------------------------------------------------*/
454 454
455/*
456 * Standby modes, EP3 [7:5]
457 *
458 * | SM || SM_LT || SM_XT || mode description
459 * |=====\\=======\\=======\\===================================
460 * | 0 || 0 || 0 || normal mode
461 * |-----||-------||-------||-----------------------------------
462 * | || || || standby mode w/ slave tuner output
463 * | 1 || 0 || 0 || & loop thru & xtal oscillator on
464 * |-----||-------||-------||-----------------------------------
465 * | 1 || 1 || 0 || standby mode w/ xtal oscillator on
466 * |-----||-------||-------||-----------------------------------
467 * | 1 || 1 || 1 || power off
468 *
469 */
470
471int tda18271_set_standby_mode(struct dvb_frontend *fe,
472 int sm, int sm_lt, int sm_xt)
473{
474 struct tda18271_priv *priv = fe->tuner_priv;
475 unsigned char *regs = priv->tda18271_regs;
476
477 tda_dbg("sm = %d, sm_lt = %d, sm_xt = %d\n", sm, sm_lt, sm_xt);
478
479 regs[R_EP3] &= ~0xe0; /* clear sm, sm_lt, sm_xt */
480 regs[R_EP3] |= sm ? (1 << 7) : 0 |
481 sm_lt ? (1 << 6) : 0 |
482 sm_xt ? (1 << 5) : 0;
483
484 tda18271_write_regs(fe, R_EP3, 1);
485
486 return 0;
487}
488
489/*---------------------------------------------------------------------*/
490
455int tda18271_calc_main_pll(struct dvb_frontend *fe, u32 freq) 491int tda18271_calc_main_pll(struct dvb_frontend *fe, u32 freq)
456{ 492{
457 /* sets main post divider & divider bytes, but does not write them */ 493 /* sets main post divider & divider bytes, but does not write them */