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);
/* gpio ports (IR for example) */
/* 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) {
return -1;
......@@ -194,6 +194,7 @@ static int bttv_bit_getsda(void *data)
return state;
}
static int attach_inform(struct i2c_client *client)
{
struct bttv *btv = (struct bttv*)client->adapter->data;
......@@ -262,7 +263,7 @@ static struct i2c_algo_bit_data bttv_i2c_algo_template = {
};
static struct i2c_adapter bttv_i2c_adap_template = {
.owner = THIS_MODULE,
.owner = THIS_MODULE,
.name = "bt848",
.id = I2C_HW_B_BT848,
.client_register = attach_inform,
......
......@@ -453,7 +453,7 @@ bttv_calc_geo(struct bttv *btv, struct bttv_geometry *geo,
int totalwidth = tvnorm->totalwidth;
int scaledtwidth = tvnorm->scaledtwidth;
if (btv->digital_video) {
if (bttv_tvcards[btv->type].muxsel[btv->input] < 0) {
swidth = 720;
totalwidth = 858;
scaledtwidth = 858;
......@@ -764,15 +764,15 @@ bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf)
case V4L2_FIELD_INTERLACED:
bttv_calc_geo(btv,&buf->geo,buf->vb.width,
buf->vb.height,1,buf->tvnorm);
lines = buf->vb.height >> 1;
ypadding = buf->vb.width;
lines = buf->vb.height >> 1;
ypadding = buf->vb.width;
cpadding = buf->vb.width >> buf->fmt->hshift;
bttv_risc_planar(btv,&buf->top,
buf->vb.dma.sglist,
0,buf->vb.width,ypadding,lines,
uoffset,voffset,
buf->fmt->hshift,
buf->fmt->vshift >> 1,
buf->fmt->vshift,
cpadding);
bttv_risc_planar(btv,&buf->bottom,
buf->vb.dma.sglist,
......@@ -780,7 +780,7 @@ bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf)
uoffset+cpadding,
voffset+cpadding,
buf->fmt->hshift,
buf->fmt->vshift >> 1,
buf->fmt->vshift,
cpadding);
break;
default:
......
......@@ -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)
{
struct bttv_fh *fh = file->private_data;
struct bttv *btv = fh->btv;
if (0 == *count)
*count = vbibufs;
*size = fh->lines * 2 * 2048;
dprintk("setup: lines=%d\n",fh->lines);
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 *btv = fh->btv;
......@@ -90,8 +93,10 @@ static int vbi_buffer_prepare(struct file *file, struct videobuf_buffer *vb)
goto fail;
}
buf->vb.state = STATE_PREPARED;
dprintk("buf prepare %p: top=%p bottom=%p\n",
vb,&buf->top,&buf->bottom);
buf->vb.field = field;
dprintk("buf prepare %p: top=%p bottom=%p field=%s\n",
vb, &buf->top, &buf->bottom,
v4l2_field_names[buf->vb.field]);
return 0;
fail:
......
......@@ -90,6 +90,7 @@
#define BTTV_SENSORAY311 0x49
#define BTTV_RV605 0x4a
#define BTTV_WINDVR 0x4c
#define BTTV_KWORLD 0x4e
#define BTTV_HAUPPAUGEPVR 0x50
#define BTTV_GVBCTV5PCI 0x51
#define BTTV_OSPREY1x0 0x52
......@@ -104,6 +105,9 @@
#define BTTV_OSPREY540 0x5b
#define BTTV_OSPREY2000 0x5c
#define BTTV_IDS_EAGLE 0x5d
#define BTTV_PINNACLESAT 0x5e
#define BTTV_FORMAC_PROTV 0x5f
#define BTTV_EURESYS_PICOLO 0x61
/* i2c address list */
#define I2C_TSA5522 0xc2
......@@ -132,6 +136,10 @@
#define WINVIEW_PT2254_DATA 0x20
#define WINVIEW_PT2254_STROBE 0x80
/* digital_mode */
#define DIGITAL_MODE_VIDEO 1
#define DIGITAL_MODE_CAMERA 2
struct bttv;
struct tvcard
......@@ -141,6 +149,7 @@ struct tvcard
int audio_inputs;
int tuner;
int svhs;
int digital_mode; // DIGITAL_MODE_CAMERA or DIGITAL_MODE_VIDEO
u32 gpiomask;
u32 muxsel[16];
u32 audiomux[6]; /* Tuner, Radio, external, internal, mute, stereo */
......@@ -191,7 +200,8 @@ extern int bttv_handle_chipset(struct bttv *btv);
for possible values see lines below beginning with #define BTTV_UNKNOWN
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);
/* obsolete, use bttv_get_cardinfo instead */
......
......@@ -24,7 +24,7 @@
#ifndef _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/wait.h>
......@@ -55,7 +55,7 @@
#define RESOURCE_OVERLAY 1
#define RESOURCE_VIDEO 2
#define RESOURCE_VBI 3
#define RESOURCE_VBI 4
#define RAW_LINES 640
#define RAW_BPL 1024
......@@ -136,7 +136,10 @@ struct bttv_fh {
/* video capture */
struct videobuf_queue cap;
struct bttv_buffer buf;
/* struct bttv_buffer buf; */
const struct bttv_format *fmt;
int width;
int height;
/* current settings */
const struct bttv_format *ovfmt;
......@@ -255,7 +258,7 @@ struct bttv {
/* card configuration info */
unsigned int nr; /* dev nr (for printk("bttv%d: ..."); */
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 tuner_type; /* tuner chip type */
struct bttv_pll_info pll;
......@@ -291,7 +294,6 @@ struct bttv {
int tvnorm,hue,contrast,bright,saturation;
struct video_buffer fbuf;
int field_count;
int digital_video;
/* various options */
int opt_combfilter;
......@@ -334,7 +336,7 @@ struct bttv {
struct timer_list timeout;
int errors;
int user;
int users;
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