]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[media] af9033: init DVBv5 statistics
authorAntti Palosaari <crope@iki.fi>
Sat, 6 Sep 2014 14:24:14 +0000 (11:24 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Sun, 21 Sep 2014 22:50:35 +0000 (19:50 -0300)
We need to init supported stats here in order signal app which
stats are supported.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/dvb-frontends/af9033.c

index be5002af70f74745a83dbc1a8ccbc444562464f4..63a89c1c59ff7454293f24604fecbe562cf3cabe 100644 (file)
@@ -238,6 +238,7 @@ static u32 af9033_div(struct af9033_dev *dev, u32 a, u32 b, u32 x)
 static int af9033_init(struct dvb_frontend *fe)
 {
        struct af9033_dev *dev = fe->demodulator_priv;
+       struct dtv_frontend_properties *c = &fe->dtv_property_cache;
        int ret, i, len;
        const struct reg_val *init;
        u8 buf[4];
@@ -448,6 +449,19 @@ static int af9033_init(struct dvb_frontend *fe)
        }
 
        dev->bandwidth_hz = 0; /* force to program all parameters */
+       /* init stats here in order signal app which stats are supported */
+       c->strength.len = 1;
+       c->strength.stat[0].scale = FE_SCALE_NOT_AVAILABLE;
+       c->cnr.len = 1;
+       c->cnr.stat[0].scale = FE_SCALE_NOT_AVAILABLE;
+       c->block_count.len = 1;
+       c->block_count.stat[0].scale = FE_SCALE_NOT_AVAILABLE;
+       c->block_error.len = 1;
+       c->block_error.stat[0].scale = FE_SCALE_NOT_AVAILABLE;
+       c->post_bit_count.len = 1;
+       c->post_bit_count.stat[0].scale = FE_SCALE_NOT_AVAILABLE;
+       c->post_bit_error.len = 1;
+       c->post_bit_error.stat[0].scale = FE_SCALE_NOT_AVAILABLE;
        /* start statistics polling */
        schedule_delayed_work(&dev->stat_work, msecs_to_jiffies(2000));