Commit e6cc6e2e authored by Gerd Knorr's avatar Gerd Knorr Committed by Linus Torvalds

[PATCH] bttv driver update.

This updates the bttv driver.  Changes:

 * adaptions to the video-buf changes send in a previous mail.
 * adaptions to recent i2c changes in the kernel.
 * first code bits the pixelview digital camera support (not
   working yet).
 * lots of small fixes/changes for specific TV cards.
parent 3019e9c0
This diff is collapsed.
This diff is collapsed.
...@@ -54,7 +54,7 @@ EXPORT_SYMBOL(bttv_i2c_call); ...@@ -54,7 +54,7 @@ EXPORT_SYMBOL(bttv_i2c_call);
/* gpio ports (IR for example) */ /* gpio ports (IR for example) */
/* see bttv.h for comments */ /* see bttv.h for comments */
int bttv_get_cardinfo(unsigned int card, int *type, int *cardid) int bttv_get_cardinfo(unsigned int card, int *type, unsigned *cardid)
{ {
if (card >= bttv_num) { if (card >= bttv_num) {
return -1; return -1;
...@@ -194,6 +194,7 @@ static int bttv_bit_getsda(void *data) ...@@ -194,6 +194,7 @@ static int bttv_bit_getsda(void *data)
return state; return state;
} }
static int attach_inform(struct i2c_client *client) static int attach_inform(struct i2c_client *client)
{ {
struct bttv *btv = (struct bttv*)client->adapter->data; struct bttv *btv = (struct bttv*)client->adapter->data;
......
...@@ -453,7 +453,7 @@ bttv_calc_geo(struct bttv *btv, struct bttv_geometry *geo, ...@@ -453,7 +453,7 @@ bttv_calc_geo(struct bttv *btv, struct bttv_geometry *geo,
int totalwidth = tvnorm->totalwidth; int totalwidth = tvnorm->totalwidth;
int scaledtwidth = tvnorm->scaledtwidth; int scaledtwidth = tvnorm->scaledtwidth;
if (btv->digital_video) { if (bttv_tvcards[btv->type].muxsel[btv->input] < 0) {
swidth = 720; swidth = 720;
totalwidth = 858; totalwidth = 858;
scaledtwidth = 858; scaledtwidth = 858;
...@@ -772,7 +772,7 @@ bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf) ...@@ -772,7 +772,7 @@ bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf)
0,buf->vb.width,ypadding,lines, 0,buf->vb.width,ypadding,lines,
uoffset,voffset, uoffset,voffset,
buf->fmt->hshift, buf->fmt->hshift,
buf->fmt->vshift >> 1, buf->fmt->vshift,
cpadding); cpadding);
bttv_risc_planar(btv,&buf->bottom, bttv_risc_planar(btv,&buf->bottom,
buf->vb.dma.sglist, buf->vb.dma.sglist,
...@@ -780,7 +780,7 @@ bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf) ...@@ -780,7 +780,7 @@ bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf)
uoffset+cpadding, uoffset+cpadding,
voffset+cpadding, voffset+cpadding,
buf->fmt->hshift, buf->fmt->hshift,
buf->fmt->vshift >> 1, buf->fmt->vshift,
cpadding); cpadding);
break; break;
default: default:
......
...@@ -65,14 +65,17 @@ vbi_buffer_risc(struct bttv *btv, struct bttv_buffer *buf, int lines) ...@@ -65,14 +65,17 @@ vbi_buffer_risc(struct bttv *btv, struct bttv_buffer *buf, int lines)
static int vbi_buffer_setup(struct file *file, int *count, int *size) static int vbi_buffer_setup(struct file *file, int *count, int *size)
{ {
struct bttv_fh *fh = file->private_data; struct bttv_fh *fh = file->private_data;
struct bttv *btv = fh->btv;
if (0 == *count) if (0 == *count)
*count = vbibufs; *count = vbibufs;
*size = fh->lines * 2 * 2048; *size = fh->lines * 2 * 2048;
dprintk("setup: lines=%d\n",fh->lines);
return 0; return 0;
} }
static int vbi_buffer_prepare(struct file *file, struct videobuf_buffer *vb) static int vbi_buffer_prepare(struct file *file, struct videobuf_buffer *vb,
enum v4l2_field field)
{ {
struct bttv_fh *fh = file->private_data; struct bttv_fh *fh = file->private_data;
struct bttv *btv = fh->btv; struct bttv *btv = fh->btv;
...@@ -90,8 +93,10 @@ static int vbi_buffer_prepare(struct file *file, struct videobuf_buffer *vb) ...@@ -90,8 +93,10 @@ static int vbi_buffer_prepare(struct file *file, struct videobuf_buffer *vb)
goto fail; goto fail;
} }
buf->vb.state = STATE_PREPARED; buf->vb.state = STATE_PREPARED;
dprintk("buf prepare %p: top=%p bottom=%p\n", buf->vb.field = field;
vb,&buf->top,&buf->bottom); dprintk("buf prepare %p: top=%p bottom=%p field=%s\n",
vb, &buf->top, &buf->bottom,
v4l2_field_names[buf->vb.field]);
return 0; return 0;
fail: fail:
......
...@@ -90,6 +90,7 @@ ...@@ -90,6 +90,7 @@
#define BTTV_SENSORAY311 0x49 #define BTTV_SENSORAY311 0x49
#define BTTV_RV605 0x4a #define BTTV_RV605 0x4a
#define BTTV_WINDVR 0x4c #define BTTV_WINDVR 0x4c
#define BTTV_KWORLD 0x4e
#define BTTV_HAUPPAUGEPVR 0x50 #define BTTV_HAUPPAUGEPVR 0x50
#define BTTV_GVBCTV5PCI 0x51 #define BTTV_GVBCTV5PCI 0x51
#define BTTV_OSPREY1x0 0x52 #define BTTV_OSPREY1x0 0x52
...@@ -104,6 +105,9 @@ ...@@ -104,6 +105,9 @@
#define BTTV_OSPREY540 0x5b #define BTTV_OSPREY540 0x5b
#define BTTV_OSPREY2000 0x5c #define BTTV_OSPREY2000 0x5c
#define BTTV_IDS_EAGLE 0x5d #define BTTV_IDS_EAGLE 0x5d
#define BTTV_PINNACLESAT 0x5e
#define BTTV_FORMAC_PROTV 0x5f
#define BTTV_EURESYS_PICOLO 0x61
/* i2c address list */ /* i2c address list */
#define I2C_TSA5522 0xc2 #define I2C_TSA5522 0xc2
...@@ -132,6 +136,10 @@ ...@@ -132,6 +136,10 @@
#define WINVIEW_PT2254_DATA 0x20 #define WINVIEW_PT2254_DATA 0x20
#define WINVIEW_PT2254_STROBE 0x80 #define WINVIEW_PT2254_STROBE 0x80
/* digital_mode */
#define DIGITAL_MODE_VIDEO 1
#define DIGITAL_MODE_CAMERA 2
struct bttv; struct bttv;
struct tvcard struct tvcard
...@@ -141,6 +149,7 @@ struct tvcard ...@@ -141,6 +149,7 @@ struct tvcard
int audio_inputs; int audio_inputs;
int tuner; int tuner;
int svhs; int svhs;
int digital_mode; // DIGITAL_MODE_CAMERA or DIGITAL_MODE_VIDEO
u32 gpiomask; u32 gpiomask;
u32 muxsel[16]; u32 muxsel[16];
u32 audiomux[6]; /* Tuner, Radio, external, internal, mute, stereo */ u32 audiomux[6]; /* Tuner, Radio, external, internal, mute, stereo */
...@@ -191,7 +200,8 @@ extern int bttv_handle_chipset(struct bttv *btv); ...@@ -191,7 +200,8 @@ extern int bttv_handle_chipset(struct bttv *btv);
for possible values see lines below beginning with #define BTTV_UNKNOWN for possible values see lines below beginning with #define BTTV_UNKNOWN
returns negative value if error occurred returns negative value if error occurred
*/ */
extern int bttv_get_cardinfo(unsigned int card, int *type, int *cardid); extern int bttv_get_cardinfo(unsigned int card, int *type,
unsigned int *cardid);
extern struct pci_dev* bttv_get_pcidev(unsigned int card); extern struct pci_dev* bttv_get_pcidev(unsigned int card);
/* obsolete, use bttv_get_cardinfo instead */ /* obsolete, use bttv_get_cardinfo instead */
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#ifndef _BTTVP_H_ #ifndef _BTTVP_H_
#define _BTTVP_H_ #define _BTTVP_H_
#define BTTV_VERSION_CODE KERNEL_VERSION(0,9,1) #define BTTV_VERSION_CODE KERNEL_VERSION(0,9,4)
#include <linux/types.h> #include <linux/types.h>
#include <linux/wait.h> #include <linux/wait.h>
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
#define RESOURCE_OVERLAY 1 #define RESOURCE_OVERLAY 1
#define RESOURCE_VIDEO 2 #define RESOURCE_VIDEO 2
#define RESOURCE_VBI 3 #define RESOURCE_VBI 4
#define RAW_LINES 640 #define RAW_LINES 640
#define RAW_BPL 1024 #define RAW_BPL 1024
...@@ -136,7 +136,10 @@ struct bttv_fh { ...@@ -136,7 +136,10 @@ struct bttv_fh {
/* video capture */ /* video capture */
struct videobuf_queue cap; struct videobuf_queue cap;
struct bttv_buffer buf; /* struct bttv_buffer buf; */
const struct bttv_format *fmt;
int width;
int height;
/* current settings */ /* current settings */
const struct bttv_format *ovfmt; const struct bttv_format *ovfmt;
...@@ -255,7 +258,7 @@ struct bttv { ...@@ -255,7 +258,7 @@ struct bttv {
/* card configuration info */ /* card configuration info */
unsigned int nr; /* dev nr (for printk("bttv%d: ..."); */ unsigned int nr; /* dev nr (for printk("bttv%d: ..."); */
char name[8]; /* dev name */ char name[8]; /* dev name */
int cardid; /* pci subsystem id (bt878 based ones) */ unsigned int cardid; /* pci subsystem id (bt878 based ones) */
int type; /* card type (pointer into tvcards[]) */ int type; /* card type (pointer into tvcards[]) */
int tuner_type; /* tuner chip type */ int tuner_type; /* tuner chip type */
struct bttv_pll_info pll; struct bttv_pll_info pll;
...@@ -291,7 +294,6 @@ struct bttv { ...@@ -291,7 +294,6 @@ struct bttv {
int tvnorm,hue,contrast,bright,saturation; int tvnorm,hue,contrast,bright,saturation;
struct video_buffer fbuf; struct video_buffer fbuf;
int field_count; int field_count;
int digital_video;
/* various options */ /* various options */
int opt_combfilter; int opt_combfilter;
...@@ -334,7 +336,7 @@ struct bttv { ...@@ -334,7 +336,7 @@ struct bttv {
struct timer_list timeout; struct timer_list timeout;
int errors; int errors;
int user; int users;
struct bttv_fh init; struct bttv_fh init;
}; };
......
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