summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/video/em28xx/em28xx-core.c38
-rw-r--r--linux/drivers/media/video/em28xx/em28xx-video.c10
-rw-r--r--linux/drivers/media/video/tuner-core.c4
-rw-r--r--linux/drivers/usb/media/em2820-core.c38
-rw-r--r--linux/drivers/usb/media/em2820-video.c10
5 files changed, 46 insertions, 54 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx-core.c b/linux/drivers/media/video/em28xx/em28xx-core.c
index 3dd25b41b..1dc2a16d9 100644
--- a/linux/drivers/media/video/em28xx/em28xx-core.c
+++ b/linux/drivers/media/video/em28xx/em28xx-core.c
@@ -438,30 +438,22 @@ int em2820_capture_area_set(struct em2820 *dev, u8 hstart, u8 vstart,
int em2820_scaler_set(struct em2820 *dev, u16 h, u16 v)
{
- u8 buf[2];
- buf[0] = h;
- buf[1] = h >> 8;
- em2820_write_regs(dev, HSCALELOW_REG, (char *)buf, 2);
- buf[0] = v;
- buf[1] = v >> 8;
- em2820_write_regs(dev, VSCALELOW_REG, (char *)buf, 2);
- if(dev->is_em2800){
- /* FIXME */
- /* random ratio scaling and 720x567 doesn't seem to work */
- /* the maximum we can get is 640x480 with disabled scaler */
- /* and norm_maxw set to 640 */
- if(dev->width == 640 && dev->height == 480)
- return em2820_write_regs(dev, COMPR_REG,"\x00",1);
- 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);
+ u8 mode;
+ /* the em2800 scaler only supports scaling down to 50% */
+ if(dev->is_em2800)
+ mode = (v ? 0x20 : 0x00) | (h ? 0x10 : 0x00);
+ else {
+ u8 buf[2];
+ buf[0] = h;
+ buf[1] = h >> 8;
+ em2820_write_regs(dev, HSCALELOW_REG, (char *)buf, 2);
+ buf[0] = v;
+ buf[1] = v >> 8;
+ em2820_write_regs(dev, VSCALELOW_REG, (char *)buf, 2);
+ /* it seems that both H and V scalers must be active to work correctly */
+ mode = (h || v)? 0x30: 0x00;
}
- /* when H and V mixershould be used? */
- /* 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);
+ return em2820_write_reg_bits(dev, COMPR_REG, mode, 0x30);
}
/* FIXME: this only function read values from dev */
diff --git a/linux/drivers/media/video/em28xx/em28xx-video.c b/linux/drivers/media/video/em28xx/em28xx-video.c
index fede664a6..51c34edfb 100644
--- a/linux/drivers/media/video/em28xx/em28xx-video.c
+++ b/linux/drivers/media/video/em28xx/em28xx-video.c
@@ -1437,14 +1437,18 @@ static int em2820_video_do_ioctl(struct inode *inode, struct file *filp,
if (width > maxw)
width = maxw;
- /* FIXME*/
if(dev->is_em2800){
- /* we only know how to scale to 50% */
+ /* the em2800 can only scale down to 50% */
if(height % (maxh / 2))
height=maxh;
if(width % (maxw / 2))
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)
width /= 2;
}
diff --git a/linux/drivers/media/video/tuner-core.c b/linux/drivers/media/video/tuner-core.c
index 92a5e6718..df959b430 100644
--- a/linux/drivers/media/video/tuner-core.c
+++ b/linux/drivers/media/video/tuner-core.c
@@ -1,5 +1,5 @@
/*
- * $Id: tuner-core.c,v 1.79 2005/10/23 20:55:07 hhackmann Exp $
+ * $Id: tuner-core.c,v 1.80 2005/10/23 21:13:48 mrechberger Exp $
*
* i2c tv tuner chip device driver
* core core, i.e. kernel interfaces, registering and so on
@@ -380,7 +380,7 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind)
/* If chip is not tda8290, don't register.
since it can be tda9887*/
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);
return 0;
}
diff --git a/linux/drivers/usb/media/em2820-core.c b/linux/drivers/usb/media/em2820-core.c
index 3dd25b41b..1dc2a16d9 100644
--- a/linux/drivers/usb/media/em2820-core.c
+++ b/linux/drivers/usb/media/em2820-core.c
@@ -438,30 +438,22 @@ int em2820_capture_area_set(struct em2820 *dev, u8 hstart, u8 vstart,
int em2820_scaler_set(struct em2820 *dev, u16 h, u16 v)
{
- u8 buf[2];
- buf[0] = h;
- buf[1] = h >> 8;
- em2820_write_regs(dev, HSCALELOW_REG, (char *)buf, 2);
- buf[0] = v;
- buf[1] = v >> 8;
- em2820_write_regs(dev, VSCALELOW_REG, (char *)buf, 2);
- if(dev->is_em2800){
- /* FIXME */
- /* random ratio scaling and 720x567 doesn't seem to work */
- /* the maximum we can get is 640x480 with disabled scaler */
- /* and norm_maxw set to 640 */
- if(dev->width == 640 && dev->height == 480)
- return em2820_write_regs(dev, COMPR_REG,"\x00",1);
- 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);
+ u8 mode;
+ /* the em2800 scaler only supports scaling down to 50% */
+ if(dev->is_em2800)
+ mode = (v ? 0x20 : 0x00) | (h ? 0x10 : 0x00);
+ else {
+ u8 buf[2];
+ buf[0] = h;
+ buf[1] = h >> 8;
+ em2820_write_regs(dev, HSCALELOW_REG, (char *)buf, 2);
+ buf[0] = v;
+ buf[1] = v >> 8;
+ em2820_write_regs(dev, VSCALELOW_REG, (char *)buf, 2);
+ /* it seems that both H and V scalers must be active to work correctly */
+ mode = (h || v)? 0x30: 0x00;
}
- /* when H and V mixershould be used? */
- /* 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);
+ return em2820_write_reg_bits(dev, COMPR_REG, mode, 0x30);
}
/* FIXME: this only function read values from dev */
diff --git a/linux/drivers/usb/media/em2820-video.c b/linux/drivers/usb/media/em2820-video.c
index fede664a6..51c34edfb 100644
--- a/linux/drivers/usb/media/em2820-video.c
+++ b/linux/drivers/usb/media/em2820-video.c
@@ -1437,14 +1437,18 @@ static int em2820_video_do_ioctl(struct inode *inode, struct file *filp,
if (width > maxw)
width = maxw;
- /* FIXME*/
if(dev->is_em2800){
- /* we only know how to scale to 50% */
+ /* the em2800 can only scale down to 50% */
if(height % (maxh / 2))
height=maxh;
if(width % (maxw / 2))
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)
width /= 2;
}