I saw this in the windows driver and thought I'd throw it in for completeness, even though it makes no difference. When selecting a video input, if the input is s-video, an additional i2c read/write is done, explicitly setting
VGA_SEL_CH2=0
VGA_SEL_CH3=0
CHROMA_IN_SEL=1
The first two are also automatically set by AFE auto config I believe (because I don't see anywhere where we set them to 0, but they somehow magically flip when input goes to svideo), the third setting is the default and is never changed.

So I don't know why the windows driver does it, but here is a patch that mimics the same behavior. Feel free to discard it if you don't think it will ever make a difference.

Something the windows driver does that we don't that I find odd is:
On input select, it does the standard SOFT_RESET, MICROCTRL off, but then sets the audio path for tuner, and sets the audio PLLs up like it is going to do tuner audio 48Khz. Then the input is changed to what it should actually be, the sample rate is set properly, and then the MICROCTRL is only restarted if going to tuner audio. This is in contrast to the way we do it where we've got the microcontroller going unless we're changing a setting. Is there any merit to either of these operations?
Index: ivtv/driver/cx25840-driver.c
===================================================================
--- ivtv/driver/cx25840-driver.c        (revision 271)
+++ ivtv/driver/cx25840-driver.c        (working copy)
@@ -653,6 +653,9 @@
                        CX25840_SET_CH_3__SOURCE(0x0000);
                        CX25840_SET_CH_SEL_ADC2(0x0000);
                        CX25840_SET_INPUT_MODE(0x0001);
+                       CX25840_SET_VGA_SEL_CH2(0x00);
+                       CX25840_SET_VGA_SEL_CH3(0x00);
+                       CX25840_SET_CHROMA_IN_SEL(0x01);
                        break;
 
                case CX25840_TUNER:

Reply via email to