]> git.baikalelectronics.ru Git - kernel.git/commit
[media] lmedm04: fix the range for relative measurements
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 23 Jun 2015 15:29:46 +0000 (12:29 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Wed, 24 Jun 2015 11:38:30 +0000 (08:38 -0300)
commitd279b15dd0778d5193187cf3d7a6a25efdca5c63
tree5e5f13336674ad8cd74a5755cb94400480e75a6d
parent745bc17bada17df88802e319be175e2249c7946c
[media] lmedm04: fix the range for relative measurements

Relative measurements are typically between 0 and 0xffff. However,
for some tuners (TUNER_S7395 and TUNER_S0194), the range were from
0 to 0xff00, with means that 100% is never archived.
Also, TUNER_RS2000 uses a more complex math.

So, create a macro that does the conversion using bit operations
and use it for all conversions.

The code is also easier to read with is a bonus.

While here, remove a bogus comment.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/usb/dvb-usb-v2/lmedm04.c