]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] ts2020: call get_rf_strength from frontend
authorMalcolm Priestley <tvboxspy@gmail.com>
Sun, 6 Jan 2013 11:40:42 +0000 (08:40 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 6 Jan 2013 12:49:38 +0000 (10:49 -0200)
Restore ds3000.c read_signal_strength.
Call tuner get_rf_strength from frontend read_signal_strength.
We are able to do a NULL check and doesn't limit the tuner
attach to the frontend attach area.
At the moment the lmedm04 tuner attach is stuck in frontend
attach area.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb-frontends/ds3000.c
drivers/media/dvb-frontends/m88rs2000.c
drivers/media/dvb-frontends/ts2020.c

index d128f85844e7e19e2ed884acf6d39ad0a2d9b27a..1e344b033277c3ccf362b163aa3069f431327346 100644 (file)
@@ -533,6 +533,15 @@ static int ds3000_read_ber(struct dvb_frontend *fe, u32* ber)
        return 0;
 }
 
+static int ds3000_read_signal_strength(struct dvb_frontend *fe,
+                                               u16 *signal_strength)
+{
+       if (fe->ops.tuner_ops.get_rf_strength)
+               fe->ops.tuner_ops.get_rf_strength(fe, signal_strength);
+
+       return 0;
+}
+
 /* calculate DS3000 snr value in dB */
 static int ds3000_read_snr(struct dvb_frontend *fe, u16 *snr)
 {
@@ -1102,6 +1111,7 @@ static struct dvb_frontend_ops ds3000_ops = {
        .i2c_gate_ctrl = ds3000_i2c_gate_ctrl,
        .read_status = ds3000_read_status,
        .read_ber = ds3000_read_ber,
+       .read_signal_strength = ds3000_read_signal_strength,
        .read_snr = ds3000_read_snr,
        .read_ucblocks = ds3000_read_ucblocks,
        .set_voltage = ds3000_set_voltage,
index 283c90fee374658be4159b81f7d2e908e342603e..4da5272075cb513036cef1c7ada3fd6cf5a0e545 100644 (file)
@@ -446,7 +446,9 @@ static int m88rs2000_read_ber(struct dvb_frontend *fe, u32 *ber)
 static int m88rs2000_read_signal_strength(struct dvb_frontend *fe,
        u16 *strength)
 {
-       *strength = 0;
+       if (fe->ops.tuner_ops.get_rf_strength)
+               fe->ops.tuner_ops.get_rf_strength(fe, strength);
+
        return 0;
 }
 
index f50e237e1464e611ec6a77e4ae66988696ebf2cf..ad7ad857ab2a9effdfc9a087c8c03ec3076db976 100644 (file)
@@ -363,7 +363,6 @@ struct dvb_frontend *ts2020_attach(struct dvb_frontend *fe,
 
        memcpy(&fe->ops.tuner_ops, &ts2020_tuner_ops,
                                sizeof(struct dvb_tuner_ops));
-       fe->ops.read_signal_strength = fe->ops.tuner_ops.get_rf_strength;
 
        return fe;
 }