[media] tda18271: delay IR & RF calibration until init() if delay_cal is set
authorMichael Krufky <mkrufky@linuxtv.org>
Tue, 2 Oct 2012 02:50:37 +0000 (23:50 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 2 Oct 2012 18:16:04 +0000 (15:16 -0300)
if the configuration option 'delay_cal' is set, delay both IR & RF
calibration until init() is called.
both module option 'cal' or configuration option 'rf_cal_on_startup'
will override this delay. it makes no sense to mix 'delay_cal' with
'rf_cal_on_startup' as these options conflict with each other.

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

index de21197ca4b9d7d1e1193baf114fe54b6a50cd0e..ca202da9d4c9f129362a850adabe1fd1427f8536 100644 (file)
@@ -1278,6 +1278,11 @@ struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe, u8 addr,
                if (tda_fail(ret))
                        goto fail;
 
+               /* if delay_cal is set, delay IR & RF calibration until init()
+                * module option 'cal' overrides this delay */
+               if ((cfg->delay_cal) && (!tda18271_need_cal_on_startup(cfg)))
+                       break;
+
                mutex_lock(&priv->lock);
                tda18271_init_regs(fe);
 
index 640bae4e6a5a85c6db5274e9654b1d02f61c419b..89b6c6d93fec75936072b4cdd2a9fd11a376420b 100644 (file)
@@ -105,6 +105,11 @@ struct tda18271_config {
        /* force rf tracking filter calibration on startup */
        unsigned int rf_cal_on_startup:1;
 
+       /* prevent any register access during attach(),
+        * delaying both IR & RF calibration until init()
+        * module option 'cal' overrides this delay */
+       unsigned int delay_cal:1;
+
        /* interface to saa713x / tda829x */
        unsigned int config;
 };