Kworld 315U and SAA7113?
Attached is an updated diff for the Kworld 315U TV. I believe all the bugs have been worked out. I haven't figured out the remote control stuff and hopefully I will be able to get around to it some time.
The sound issue was because I didn't have the right mplayer config so that is fixed as well.
Other than that, the LED light on the front of the box doesn't shut off after I start and stop the stream. It's probably a GPIO setting that I need to tweak.
And I wanted to say thank you to Douglas and Devin for the tips they provided me.
Thanks,
Franklin Meng
Quoted 56 lines · Franklin Meng
From: Franklin Meng <[email protected]>
Subject: Kworld 315U and SAA7113?
To: [email protected]
Date: Thursday, January 7, 2010, 7:48 PM
After some work I have finally gotten
the analog inputs to work with the Kworld 315U device. I have attached the changes/updates to the em28xx driver.
Note: I still don't have analog sound working yet..I am hoping someone can comment on the changes in saa7115.c. I added a
s_powerroutine to reinitialize the device. The reason I am reinitializing this device is because1. I cannot keep both the LG demod and the SAA powered on at the same time for my device
2. The SAA datasheet seems to suggest that after a reset/power-on the chip needs to be reinitialized.
3. Reinitializing causes the analog inputs to work correctly.
Here's what is says in the SAA7113 datasheet..
....
Status after power-on
control sequenceVPO7 to VPO0, RTCO, RTS0 and RTS1
are held in high-impedance stateafter power-on (reset
sequence) a complete
I2C-bus transmission is
required
...
The above is really suppose to be arranged horizontally in 3 columns. Anyways, the last part describes that "a complete I2C bus transmission is required" This is why I think the chip needs to be reinitialized.Last thing is that the initialization routing uses these defaults:
state->bright = 128;
state->contrast = 64;
state->hue = 0;
state->sat = 64;I was wondering if we should just read the back the values that were initialized by the initialization routine and use those values instead.The reason is because it seems like the different SAA's use slightly different values when initializing.
Quoted 5 lines
Thanks,
Franklin Meng
linux/drivers/media/video/em28xx/em28xx-cards.c +32 -8
@@ -122,13 +122,31 @@ };#endif +/* Kworld 315U +GPIO0 - Enable digital power (lgdt3303) - low to enable +GPIO1 - Enable analog power (saa7113/emp202) - low to enable +GPIO7 - enables something ? +GOP2 - ?? some sort of reset ? +GOP3 - lgdt3303 reset +*/ /* Board - EM2882 Kworld 315U digital */ static struct em28xx_reg_seq em2882_kworld_315u_digital[] = { - {EM28XX_R08_GPIO ,0xff ,0xff ,10 }, {EM28XX_R08_GPIO ,0xfe ,0xff ,10 }, {EM2880_R04_GPO ,0x04 ,0xff ,10 }, {EM2880_R04_GPO ,0x0c ,0xff ,10 }, - {EM28XX_R08_GPIO ,0x7e ,0xff ,10 }, + {-1 ,-1 ,-1 ,-1 }, +}; + +/* Board - EM2882 Kworld 315U analog1 analog tv */ +static struct em28xx_reg_seq em2882_kworld_315u_analog1[] = { + {EM28XX_R08_GPIO ,0xfd ,0xff ,10 }, + {EM28XX_R08_GPIO ,0x7d ,0xff ,10 }, + {-1 ,-1 ,-1 ,-1 }, +}; + +/* Board - EM2882 Kworld 315U analog2 component/svideo */ +static struct em28xx_reg_seq em2882_kworld_315u_analog2[] = { + {EM28XX_R08_GPIO ,0xfd ,0xff ,10 }, {-1 ,-1 ,-1 ,-1 }, };
@@ -140,6 +158,12 @@ { -1, -1, -1, -1}, }; +/* Board - EM2882 Kworld 315U suspend */ +static struct em28xx_reg_seq em2882_kworld_315u_suspend[] = { + {EM28XX_R08_GPIO ,0xff ,0xff ,10 }, + {-1 ,-1 ,-1 ,-1 }, +}; +static struct em28xx_reg_seq kworld_330u_analog[] = { {EM28XX_R08_GPIO ,0x6d , ~EM_GPIO_4 ,10 }, {EM2880_R04_GPO, 0x00, 0xff, 10},
@@ -1314,28 +1338,28 @@ .decoder = EM28XX_SAA711X, .has_dvb = 1, .dvb_gpio = em2882_kworld_315u_digital, + .suspend_gpio = em2882_kworld_315u_suspend, .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE, -/* Analog mode - still not ready */ -/*.input = { { + .input = { { .type = EM28XX_VMUX_TELEVISION, .vmux = SAA7115_COMPOSITE2, .amux = EM28XX_AMUX_VIDEO, -.gpio = em2882_kworld_315u_analog, + .gpio = em2882_kworld_315u_analog1, .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO, }, { .type = EM28XX_VMUX_COMPOSITE1, .vmux = SAA7115_COMPOSITE0, .amux = EM28XX_AMUX_LINE_IN, -.gpio = em2882_kworld_315u_analog1, + .gpio = em2882_kworld_315u_analog2, .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO, }, { .type = EM28XX_VMUX_SVIDEO, .vmux = SAA7115_SVIDEO3, .amux = EM28XX_AMUX_LINE_IN, -.gpio = em2882_kworld_315u_analog1, + .gpio = em2882_kworld_315u_analog2, .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO, -} }, */ + } }, }, [EM2880_BOARD_EMPIRE_DUAL_TV] = { .name = "Empire dual TV",
linux/drivers/media/video/em28xx/em28xx-core.c +1 -0
@@ -1132,6 +1132,7 @@*/ void em28xx_wake_i2c (struct em28xx *dev) { +v4l2_device_call_all (&dev->v4l2_dev,0 , core, s_power,1 );v4l2_device_call_all (&dev->v4l2_dev,0 , core, reset,0 );v4l2_device_call_all (&dev->v4l2_dev,0 , video, s_routing,INPUT (dev->ctl_input)->vmux,0 ,0 );
linux/drivers/media/video/saa7115.c +54 -0
66 lines not on this page · raw message