Commit 52c02fcd authored by Sascha Sommer's avatar Sascha Sommer Committed by Linus Torvalds

[PATCH] v4l: 850: update em2800 scaler code and comments based on info from empiatech

- Update em2800 scaler code and comments based on info from empiatech
Signed-off-by: default avatarSascha Sommer <saschasommer@freenet.de>
Signed-off-by: default avatarMarkus Rechberger <mrechberger@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 07345f5d
...@@ -430,30 +430,22 @@ int em2820_capture_area_set(struct em2820 *dev, u8 hstart, u8 vstart, ...@@ -430,30 +430,22 @@ int em2820_capture_area_set(struct em2820 *dev, u8 hstart, u8 vstart,
int em2820_scaler_set(struct em2820 *dev, u16 h, u16 v) int em2820_scaler_set(struct em2820 *dev, u16 h, u16 v)
{ {
u8 buf[2]; u8 mode;
buf[0] = h; /* the em2800 scaler only supports scaling down to 50% */
buf[1] = h >> 8; if(dev->is_em2800)
em2820_write_regs(dev, HSCALELOW_REG, (char *)buf, 2); mode = (v ? 0x20 : 0x00) | (h ? 0x10 : 0x00);
buf[0] = v; else {
buf[1] = v >> 8; u8 buf[2];
em2820_write_regs(dev, VSCALELOW_REG, (char *)buf, 2); buf[0] = h;
if(dev->is_em2800){ buf[1] = h >> 8;
/* FIXME */ em2820_write_regs(dev, HSCALELOW_REG, (char *)buf, 2);
/* random ratio scaling and 720x567 doesn't seem to work */ buf[0] = v;
/* the maximum we can get is 640x480 with disabled scaler */ buf[1] = v >> 8;
/* and norm_maxw set to 640 */ em2820_write_regs(dev, VSCALELOW_REG, (char *)buf, 2);
if(dev->width == 640 && dev->height == 480) /* it seems that both H and V scalers must be active to work correctly */
return em2820_write_regs(dev, COMPR_REG,"\x00",1); mode = (h || v)? 0x30: 0x00;
if(dev->height > 288)
return em2820_write_regs(dev, COMPR_REG,"\x10",1);
if(dev->width > 360)
return em2820_write_regs(dev, COMPR_REG,"\x20",1);
} }
/* when H and V mixershould be used? */ return em2820_write_reg_bits(dev, COMPR_REG, mode, 0x30);
/* return em2820_write_reg_bits(dev, COMPR_REG, (h ? 0x20 : 0x00) | (v ? 0x10 : 0x00), 0x30); */
/* it seems that both H and V scalers must be active to work correctly */
return em2820_write_reg_bits(dev, COMPR_REG, h
|| v ? 0x30 : 0x00, 0x30);
} }
/* FIXME: this only function read values from dev */ /* FIXME: this only function read values from dev */
......
...@@ -1308,14 +1308,18 @@ static int em2820_video_do_ioctl(struct inode *inode, struct file *filp, ...@@ -1308,14 +1308,18 @@ static int em2820_video_do_ioctl(struct inode *inode, struct file *filp,
if (width > maxw) if (width > maxw)
width = maxw; width = maxw;
/* FIXME*/
if(dev->is_em2800){ if(dev->is_em2800){
/* we only know how to scale to 50% */ /* the em2800 can only scale down to 50% */
if(height % (maxh / 2)) if(height % (maxh / 2))
height=maxh; height=maxh;
if(width % (maxw / 2)) if(width % (maxw / 2))
width=maxw; width=maxw;
/* larger resoltion don't seem to work either */ /* according to empiatech support */
/* the MaxPacketSize is to small to support */
/* framesizes larger than 640x480 @ 30 fps */
/* or 640x576 @ 25 fps. As this would cut */
/* of a part of the image we prefer */
/* 360x576 or 360x480 for now */
if(width == maxw && height == maxh) if(width == maxw && height == maxh)
width /= 2; width /= 2;
} }
......
...@@ -369,7 +369,7 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind) ...@@ -369,7 +369,7 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind)
/* If chip is not tda8290, don't register. /* If chip is not tda8290, don't register.
since it can be tda9887*/ since it can be tda9887*/
if (tda8290_probe(&t->i2c) != 0) { if (tda8290_probe(&t->i2c) != 0) {
tuner_dbg("chip at addr %x is not a tda8290\n", addr); tuner_dbg("chip at addr %x is not a tda8290\n", addr);
kfree(t); kfree(t);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment