[media] cx88: properly maintain decoder config when using MPEG encoder
authorDevin Heitmueller <dheitmueller@kernellabs.com>
Thu, 14 Jul 2011 15:44:46 +0000 (12:44 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 27 Jul 2011 20:56:00 +0000 (17:56 -0300)
commit243bf1a24d991f57398aa9d24e408ca83abc6135
treebb2b4dd31635df5bf1afb5d55056748dee895ed7
parentaf935746781088f28904601469671d244d2f653b
[media] cx88: properly maintain decoder config when using MPEG encoder

The cx88 driver would force core->input to always be zero when doing the
the request_acquire().  While it wasn't actually changing the input register
in the hardware, the driver makes decision based on the current input.  In
particular, it decides whether to do things like enabling the comb filter
when on a composite input but disabling it on s-video.  So for example, on
the HVR-1300, using the s-video input with the MPEG encoder would end up with
the video decoder core configured as though the input type were composite.

In short, the driver state did not match the hardware state.

This patch does two things:

1.  It forces the input to zero only if actually switching to DVB mode.  This
prevents the input from changing when the blackbird driver opens the device.

2.  Keep track of what the input was set to when switching to DVB, and reset
it back when done.  This eliminates a condition where for example the user
had the analog side of the board set to capture on the s-video input, then
he used DVB for a bit, then the analog input would unexpectedly be set to
the tuner input.

This work was sponsored by Anevia S.A.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Cc: Florent Audebert <florent.audebert@anevia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/cx88/cx88-mpeg.c
drivers/media/video/cx88/cx88.h