]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
V4L/DVB (12861): tda18271: add support for additional low-power standby modes
authorMichael Krufky <mkrufky@kernellabs.com>
Sun, 11 May 2008 15:46:52 +0000 (12:46 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 19 Sep 2009 03:13:39 +0000 (00:13 -0300)
By default, the driver enters standby mode with slave tuner output
loop thru enabled and xtal oscillator on.

Not all designs require that slave tuner output loop thru and
xtal oscillator remain active while in standby mode, so two
additional standby modes have been added:

- standby mode with xtal oscillator on (loop thru off)

- total power off

Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/common/tuners/tda18271-fe.c
drivers/media/common/tuners/tda18271-priv.h
drivers/media/common/tuners/tda18271.h

index bc4b004ba7dbed45f3a07ff0ef4d4411fa159737..64b935f91577877251db6a279a1416a352380cc8 100644 (file)
@@ -1017,9 +1017,17 @@ static int tda18271_sleep(struct dvb_frontend *fe)
 
        mutex_lock(&priv->lock);
 
-       /* standby mode w/ slave tuner output
-        * & loop thru & xtal oscillator on */
-       ret = tda18271_set_standby_mode(fe, 1, 0, 0);
+       switch (priv->standby_mode) {
+       case TDA18271_STANDBY_POWER_OFF:
+               ret = tda18271_set_standby_mode(fe, 1, 1, 1);
+               break;
+       case TDA18271_STANDBY_XT_ON:
+               ret = tda18271_set_standby_mode(fe, 1, 1, 0);
+               break;
+       case TDA18271_STANDBY_LT_XT_ON:
+       default:
+               ret = tda18271_set_standby_mode(fe, 1, 0, 0);
+       }
 
        mutex_unlock(&priv->lock);
 
@@ -1199,6 +1207,8 @@ struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe, u8 addr,
                priv->gate = (cfg) ? cfg->gate : TDA18271_GATE_AUTO;
                priv->role = (cfg) ? cfg->role : TDA18271_MASTER;
                priv->config = (cfg) ? cfg->config : 0;
+               priv->standby_mode = (cfg) ?
+                       cfg->standby_mode : TDA18271_STANDBY_LT_XT_ON;
 
                /* tda18271_cal_on_startup == -1 when cal
                 * module option is unset */
index e6a80ad0935688a1ddae48a4e1c4655114fe357b..8c5fabcf5a2974a01fb7fd69e2c61488ed614862 100644 (file)
@@ -108,6 +108,7 @@ struct tda18271_priv {
        enum tda18271_role role;
        enum tda18271_i2c_gate gate;
        enum tda18271_ver id;
+       enum tda18271_standby_mode standby_mode;
 
        unsigned int config; /* interface to saa713x / tda829x */
        unsigned int tm_rfcal;
index 71bac9593f1ea9246b64a3eb178fca0342fe3d83..9ca716f6b1f532c8be6b3b08e7a97a228e49a724 100644 (file)
@@ -67,6 +67,17 @@ enum tda18271_i2c_gate {
        TDA18271_GATE_DIGITAL,
 };
 
+enum tda18271_standby_mode {
+       /* slave tuner output & loop thru & xtal oscillator on */
+       TDA18271_STANDBY_LT_XT_ON = 0,
+
+       /* xtal oscillator on */
+       TDA18271_STANDBY_XT_ON,
+
+       /* power off */
+       TDA18271_STANDBY_POWER_OFF,
+};
+
 struct tda18271_config {
        /* override default if freq / std settings (optional) */
        struct tda18271_std_map *std_map;
@@ -77,6 +88,9 @@ struct tda18271_config {
        /* use i2c gate provided by analog or digital demod */
        enum tda18271_i2c_gate gate;
 
+       /* allow lower power standby modes */
+       enum tda18271_standby_mode standby_mode;
+
        /* force rf tracking filter calibration on startup */
        unsigned int rf_cal_on_startup:1;