The patch number 13337 was added via Igor M. Liplianin <[email protected]>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        Linux Media Mailing List <[email protected]>

------

From: Igor M. Liplianin  <[email protected]>
Change str snr scale for stv0900/903 and Netup Dual DVB-S2 card.


Signed-off-by: Igor M. Liplianin <[email protected]>


---

 linux/drivers/media/dvb/frontends/stv0900_core.c |   25 ++++++++++++---
 1 file changed, 21 insertions(+), 4 deletions(-)

diff -r f47b773300c2 -r 2894b1903c1f 
linux/drivers/media/dvb/frontends/stv0900_core.c
--- a/linux/drivers/media/dvb/frontends/stv0900_core.c  Sat Oct 17 14:58:26 
2009 +0300
+++ b/linux/drivers/media/dvb/frontends/stv0900_core.c  Tue Oct 27 20:59:53 
2009 +0300
@@ -603,6 +603,8 @@
                        break;
                }
 
+       dprintk("%s: AGC Gain = 0x%x\n", __func__, agc_gain);
+
                imin = 0;
                imax = lookup->size - 1;
                if (INRANGE(lookup->table[imin].regval, agc_gain, 
lookup->table[imax].regval)) {
@@ -638,7 +640,14 @@
        s32 rflevel = stv0900_get_rf_level(internal, &stv0900_rf,
                                                                state->demod);
 
-       *strength = (rflevel + 100) * (16383 / 105);
+       rflevel = (rflevel + 100) * (65535 / 70);
+       if (rflevel < 0)
+               rflevel = 0;
+
+       if (rflevel > 65535)
+               rflevel = 65535;
+
+       *strength = rflevel;
 
        return 0;
 }
@@ -713,6 +722,8 @@
                }
        }
 
+       dprintk("%s: Quality = %d\n", __func__, c_n);
+
        return c_n;
 }
 
@@ -756,10 +767,16 @@
 
 static int stv0900_read_snr(struct dvb_frontend *fe, u16 *snr)
 {
-       *snr = stv0900_carr_get_quality(fe,
+       s32 snrlcl = stv0900_carr_get_quality(fe,
                        (const struct stv0900_table *)&stv0900_s2_cn);
-       *snr += 30;
-       *snr *= (16383 / 1030);
+       snrlcl = (snrlcl + 30) * 384;
+       if (snrlcl < 0)
+               snrlcl = 0;
+
+       if (snrlcl > 65535)
+               snrlcl = 65535;
+
+       *snr = snrlcl;
 
        return 0;
 }


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/2894b1903c1fc21bc3ae4032e59614dc092dbcc6

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to