From d0f2036ec4877863739bed422ec66a985e443956 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 15 Dec 2006 17:46:53 -0200 Subject: usbvision memory fixes From: Thierry MERLE - fix decompression buffer allocation not done at first driver open - simplification of USB sbuf allocation (use of usb_buffer_alloc) - replaced vmalloc by vmalloc_32 (for homogeneity) - add of saa7111 (i2cAddr=0x48) detection printout in attach_inform Signed-off-by: Thierry MERLE Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/cx88/cx88-core.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'linux/drivers/media/video/cx88') diff --git a/linux/drivers/media/video/cx88/cx88-core.c b/linux/drivers/media/video/cx88/cx88-core.c index c2e6df733..00080018a 100644 --- a/linux/drivers/media/video/cx88/cx88-core.c +++ b/linux/drivers/media/video/cx88/cx88-core.c @@ -688,24 +688,29 @@ static unsigned int inline norm_vdelay(struct cx88_tvnorm *norm) static unsigned int inline norm_fsc8(struct cx88_tvnorm *norm) { - static const unsigned int ntsc = 28636360; - static const unsigned int pal = 35468950; - static const unsigned int palm = 28604892; - if (norm->id & V4L2_STD_PAL_M) - return palm; + return 28604892; // 3.575611 MHz + + /* Does PAL/N' use the same carrier freq? */ + if (norm->id & (V4L2_STD_PAL_N | V4L2_STD_PAL_Nc)) + return 28656448; // 3.582056 MHz + + if (norm->id & V4L2_STD_NTSC) + return 28636360; // 3.57954545 MHz +/- 10 Hz - return (norm->id & V4L2_STD_625_50) ? pal : ntsc; + /* SECAM have also different sub carrier for chroma. Maybe their + freqs should also be here to improve video quality */ + + return 35468950; // 4.43361875 MHz } static unsigned int inline norm_htotal(struct cx88_tvnorm *norm) { - /* Should always be Line Draw Time / (4*FSC) */ - if (norm->id & V4L2_STD_PAL_M) - return 909; + unsigned int fsc4=norm_fsc8(norm)/2; - return (norm->id & V4L2_STD_625_50) ? 1135 : 910; + /* returns 4*FSC / frames per seconds / vtotal */ + return (norm->id & V4L2_STD_625_50) ? fsc4/25/625 : fsc4*30000/1001/525; } static unsigned int inline norm_vbipack(struct cx88_tvnorm *norm) -- cgit v1.2.3