linux_dsm_epyc7002/drivers/media/pci
David Howells 0f91c9d6ba [media] TS2020: Calculate tuner gain correctly
The TS2020 and TS2022 tuners take an input from the demodulator indicating the
AGC setting on that component that is then used to influence the tuner's own
gain.  This should be taken into account when calculating the gain and signal
strength.

Further, the existing TS2020 driver miscalculates the signal strength as the
result of its calculations can exceed the storage capacity of the 16-bit word
used to return it to userspace.

To this end:

 (1) Add a callback function (->get_agc_pwm()) in the ts2020_config struct that
     the tuner can call to get the AGC PWM value from the demodulator.

 (2) Modify the TS2020 driver to calculate the gain according to Montage's
     specification with the adjustment that we produce a negative value and
     scale it to 0.001dB units (which is what the DVBv5 API will require):

     (a) Callback to the demodulator to retrieve the AGC PWM value and then
     	 turn that into Vagc for incorporation in the calculations.  If the
     	 callback is unset, assume a Vagc of 0.

     (b) Calculate the tuner gain from a combination of Vagc and the tuner's RF
     	 gain and baseband gain settings.

 (3) Turn this into a percentage signal strength as per Montage's
     specification for return to userspace with the DVBv3 API.

 (4) Provide a function in the M88DS3103 demodulator driver that can be used to
     get the AGC PWM value on behalf of the tuner.

 (5) The ts2020_config.get_agc_pwm function should be set by the code that
     stitches together the drivers for each card.

     For the DVBSky cards that use the M88DS3103 with the TS2020 or the TS2022,
     set the get_agc_pwm function to point to m88ds3103_get_agc_pwm.

I have tested this with a DVBSky S952 card which has an M88DS3103 and a TS2022.

Thanks to Montage for providing access to information about the workings of
these parts.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-06-10 11:10:27 -03:00
..
b2c2 [media] pci: flexcop: Remove redundant pci_set_drvdata 2013-10-17 05:56:55 -03:00
bt8xx [media] dvb: Get rid of typedev usage for enums 2015-06-09 17:47:35 -03:00
cobalt [media] cobalt: fix 64-bit division 2015-06-10 10:01:16 -03:00
cx18 [media] v4l2: replace s_mbus_fmt by set_fmt in bridge drivers 2015-05-01 09:01:16 -03:00
cx88 [media] dvb: Get rid of typedev usage for enums 2015-06-09 17:47:35 -03:00
cx23885 [media] TS2020: Calculate tuner gain correctly 2015-06-10 11:10:27 -03:00
cx25821 [media] cx25821: cx25821-medusa-reg.h: fix 0x0x prefix 2015-05-13 16:43:49 -03:00
ddbridge [media] ddbridge: Do not free_irq() if request_irq() failed 2015-06-09 19:40:33 -03:00
dm1105 [media] dvb: Get rid of typedev usage for enums 2015-06-09 17:47:35 -03:00
dt3155 dt3155: fix CodingStyle issues 2015-05-01 08:30:06 -03:00
ivtv [media] ivtv: fix two smatch warnings 2015-06-05 11:26:36 -03:00
mantis [media] dvb: Get rid of typedev usage for enums 2015-06-09 17:47:35 -03:00
meye [media] meye: embed video_device 2015-04-02 23:35:01 -03:00
ngene [media] dvb: Get rid of typedev usage for enums 2015-06-09 17:47:35 -03:00
pluto2 [media] media_tree: Fix spelling errors 2013-12-09 14:50:50 -02:00
pt1 [media] dvb: Get rid of typedev usage for enums 2015-06-09 17:47:35 -03:00
pt3 [media] dvb: Get rid of typedev usage for enums 2015-06-09 17:47:35 -03:00
saa7134 [media] saa7134: add AverMedia AverTV/505 card support 2015-06-09 18:43:00 -03:00
saa7146 [media] saa7146: embed video_device 2015-04-02 23:29:01 -03:00
saa7164 [media] saa7164: fix sparse warning 2015-05-30 11:22:34 -03:00
smipcie [media] si2157: support selection of IF interface 2015-05-12 13:20:55 -03:00
solo6x10 [media] solo6x10: s/uint8_t/u8/ 2015-01-27 10:03:19 -02:00
sta2x11 [media] sta2x11: use monotonic timestamp 2015-05-18 16:27:29 -03:00
ttpci [media] dvb: Get rid of typedev usage for enums 2015-06-09 17:47:35 -03:00
tw68 [media] tw68: remove unnecessary version.h inclusion 2015-01-27 10:08:49 -02:00
zoran [media] zoran: fix indent 2015-04-30 13:36:44 -03:00
Kconfig [media] cobalt: add new driver 2015-05-20 13:44:01 -03:00
Makefile [media] cobalt: add new driver 2015-05-20 13:44:01 -03:00