These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / media / dvb-frontends / tda1004x.c
index a2631be..c6abeb4 100644 (file)
@@ -650,7 +650,7 @@ static int tda10046_init(struct dvb_frontend* fe)
 
        if (tda10046_fwupload(fe)) {
                printk("tda1004x: firmware upload failed\n");
-                       return -EIO;
+               return -EIO;
        }
 
        // tda setup
@@ -903,9 +903,18 @@ static int tda1004x_get_fe(struct dvb_frontend *fe)
 {
        struct dtv_frontend_properties *fe_params = &fe->dtv_property_cache;
        struct tda1004x_state* state = fe->demodulator_priv;
+       int status;
 
        dprintk("%s\n", __func__);
 
+       status = tda1004x_read_byte(state, TDA1004X_STATUS_CD);
+       if (status == -1)
+               return -EIO;
+
+       /* Only update the properties cache if device is locked */
+       if (!(status & 8))
+               return 0;
+
        // inversion status
        fe_params->inversion = INVERSION_OFF;
        if (tda1004x_read_byte(state, TDA1004X_CONFC1) & 0x20)
@@ -1005,7 +1014,8 @@ static int tda1004x_get_fe(struct dvb_frontend *fe)
        return 0;
 }
 
-static int tda1004x_read_status(struct dvb_frontend* fe, fe_status_t * fe_status)
+static int tda1004x_read_status(struct dvb_frontend *fe,
+                               enum fe_status *fe_status)
 {
        struct tda1004x_state* state = fe->demodulator_priv;
        int status;