Commit afd1a0c9 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab Committed by Linus Torvalds

[PATCH] V4L/DVB: (3086c) Whitespaces cleanups part 3

Clean up whitespaces at v4l/dvb files
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 808824b5
...@@ -174,8 +174,8 @@ void saa7146_pgtable_free(struct pci_dev *pci, struct saa7146_pgtable *pt) ...@@ -174,8 +174,8 @@ void saa7146_pgtable_free(struct pci_dev *pci, struct saa7146_pgtable *pt)
int saa7146_pgtable_alloc(struct pci_dev *pci, struct saa7146_pgtable *pt) int saa7146_pgtable_alloc(struct pci_dev *pci, struct saa7146_pgtable *pt)
{ {
u32 *cpu; u32 *cpu;
dma_addr_t dma_addr; dma_addr_t dma_addr;
cpu = pci_alloc_consistent(pci, PAGE_SIZE, &dma_addr); cpu = pci_alloc_consistent(pci, PAGE_SIZE, &dma_addr);
if (NULL == cpu) { if (NULL == cpu) {
...@@ -405,7 +405,7 @@ static int saa7146_init_one(struct pci_dev *pci, const struct pci_device_id *ent ...@@ -405,7 +405,7 @@ static int saa7146_init_one(struct pci_dev *pci, const struct pci_device_id *ent
pci_set_drvdata(pci, dev); pci_set_drvdata(pci, dev);
init_MUTEX(&dev->lock); init_MUTEX(&dev->lock);
spin_lock_init(&dev->int_slock); spin_lock_init(&dev->int_slock);
spin_lock_init(&dev->slock); spin_lock_init(&dev->slock);
......
#include <media/saa7146_vv.h> #include <media/saa7146_vv.h>
#define BOARD_CAN_DO_VBI(dev) (dev->revision != 0 && dev->vv_data->vbi_minor != -1) #define BOARD_CAN_DO_VBI(dev) (dev->revision != 0 && dev->vv_data->vbi_minor != -1)
/****************************************************************************/ /****************************************************************************/
/* resource management functions, shamelessly stolen from saa7134 driver */ /* resource management functions, shamelessly stolen from saa7134 driver */
...@@ -102,9 +102,9 @@ void saa7146_buffer_finish(struct saa7146_dev *dev, ...@@ -102,9 +102,9 @@ void saa7146_buffer_finish(struct saa7146_dev *dev,
/* finish current buffer */ /* finish current buffer */
if (NULL == q->curr) { if (NULL == q->curr) {
DEB_D(("aiii. no current buffer\n")); DEB_D(("aiii. no current buffer\n"));
return; return;
} }
q->curr->vb.state = state; q->curr->vb.state = state;
do_gettimeofday(&q->curr->vb.ts); do_gettimeofday(&q->curr->vb.ts);
wake_up(&q->curr->vb.done); wake_up(&q->curr->vb.done);
...@@ -143,13 +143,13 @@ void saa7146_buffer_next(struct saa7146_dev *dev, ...@@ -143,13 +143,13 @@ void saa7146_buffer_next(struct saa7146_dev *dev,
// fixme: fix this for vflip != 0 // fixme: fix this for vflip != 0
saa7146_write(dev, PROT_ADDR1, 0); saa7146_write(dev, PROT_ADDR1, 0);
saa7146_write(dev, MC2, (MASK_02|MASK_18)); saa7146_write(dev, MC2, (MASK_02|MASK_18));
/* write the address of the rps-program */ /* write the address of the rps-program */
saa7146_write(dev, RPS_ADDR0, dev->d_rps0.dma_handle); saa7146_write(dev, RPS_ADDR0, dev->d_rps0.dma_handle);
/* turn on rps */ /* turn on rps */
saa7146_write(dev, MC1, (MASK_12 | MASK_28)); saa7146_write(dev, MC1, (MASK_12 | MASK_28));
/* /*
printk("vdma%d.base_even: 0x%08x\n", 1,saa7146_read(dev,BASE_EVEN1)); printk("vdma%d.base_even: 0x%08x\n", 1,saa7146_read(dev,BASE_EVEN1));
printk("vdma%d.base_odd: 0x%08x\n", 1,saa7146_read(dev,BASE_ODD1)); printk("vdma%d.base_odd: 0x%08x\n", 1,saa7146_read(dev,BASE_ODD1));
...@@ -246,7 +246,7 @@ static int fops_open(struct inode *inode, struct file *file) ...@@ -246,7 +246,7 @@ static int fops_open(struct inode *inode, struct file *file)
goto out; goto out;
} }
memset(fh,0,sizeof(*fh)); memset(fh,0,sizeof(*fh));
file->private_data = fh; file->private_data = fh;
fh->dev = dev; fh->dev = dev;
fh->type = type; fh->type = type;
...@@ -275,7 +275,7 @@ static int fops_open(struct inode *inode, struct file *file) ...@@ -275,7 +275,7 @@ static int fops_open(struct inode *inode, struct file *file)
file->private_data = NULL; file->private_data = NULL;
} }
up(&saa7146_devices_lock); up(&saa7146_devices_lock);
return result; return result;
} }
static int fops_release(struct inode *inode, struct file *file) static int fops_release(struct inode *inode, struct file *file)
...@@ -405,7 +405,7 @@ static struct file_operations video_fops = ...@@ -405,7 +405,7 @@ static struct file_operations video_fops =
static void vv_callback(struct saa7146_dev *dev, unsigned long status) static void vv_callback(struct saa7146_dev *dev, unsigned long status)
{ {
u32 isr = status; u32 isr = status;
DEB_INT(("dev:%p, isr:0x%08x\n",dev,(u32)status)); DEB_INT(("dev:%p, isr:0x%08x\n",dev,(u32)status));
if (0 != (isr & (MASK_27))) { if (0 != (isr & (MASK_27))) {
...@@ -454,11 +454,11 @@ int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv) ...@@ -454,11 +454,11 @@ int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv)
handle different devices that might need different handle different devices that might need different
configuration data) */ configuration data) */
dev->ext_vv_data = ext_vv; dev->ext_vv_data = ext_vv;
vv->video_minor = -1; vv->video_minor = -1;
vv->vbi_minor = -1; vv->vbi_minor = -1;
vv->d_clipping.cpu_addr = pci_alloc_consistent(dev->pci, SAA7146_CLIPPING_MEM, &vv->d_clipping.dma_handle); vv->d_clipping.cpu_addr = pci_alloc_consistent(dev->pci, SAA7146_CLIPPING_MEM, &vv->d_clipping.dma_handle);
if( NULL == vv->d_clipping.cpu_addr ) { if( NULL == vv->d_clipping.cpu_addr ) {
ERR(("out of memory. aborting.\n")); ERR(("out of memory. aborting.\n"));
kfree(vv); kfree(vv);
...@@ -468,7 +468,7 @@ int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv) ...@@ -468,7 +468,7 @@ int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv)
saa7146_video_uops.init(dev,vv); saa7146_video_uops.init(dev,vv);
saa7146_vbi_uops.init(dev,vv); saa7146_vbi_uops.init(dev,vv);
dev->vv_data = vv; dev->vv_data = vv;
dev->vv_callback = &vv_callback; dev->vv_callback = &vv_callback;
...@@ -480,12 +480,12 @@ int saa7146_vv_release(struct saa7146_dev* dev) ...@@ -480,12 +480,12 @@ int saa7146_vv_release(struct saa7146_dev* dev)
struct saa7146_vv *vv = dev->vv_data; struct saa7146_vv *vv = dev->vv_data;
DEB_EE(("dev:%p\n",dev)); DEB_EE(("dev:%p\n",dev));
pci_free_consistent(dev->pci, SAA7146_RPS_MEM, vv->d_clipping.cpu_addr, vv->d_clipping.dma_handle); pci_free_consistent(dev->pci, SAA7146_RPS_MEM, vv->d_clipping.cpu_addr, vv->d_clipping.dma_handle);
kfree(vv); kfree(vv);
dev->vv_data = NULL; dev->vv_data = NULL;
dev->vv_callback = NULL; dev->vv_callback = NULL;
return 0; return 0;
} }
...@@ -498,7 +498,7 @@ int saa7146_register_device(struct video_device **vid, struct saa7146_dev* dev, ...@@ -498,7 +498,7 @@ int saa7146_register_device(struct video_device **vid, struct saa7146_dev* dev,
DEB_EE(("dev:%p, name:'%s', type:%d\n",dev,name,type)); DEB_EE(("dev:%p, name:'%s', type:%d\n",dev,name,type));
// released by vfd->release // released by vfd->release
vfd = video_device_alloc(); vfd = video_device_alloc();
if (vfd == NULL) if (vfd == NULL)
return -ENOMEM; return -ENOMEM;
...@@ -530,7 +530,7 @@ int saa7146_register_device(struct video_device **vid, struct saa7146_dev* dev, ...@@ -530,7 +530,7 @@ int saa7146_register_device(struct video_device **vid, struct saa7146_dev* dev,
int saa7146_unregister_device(struct video_device **vid, struct saa7146_dev* dev) int saa7146_unregister_device(struct video_device **vid, struct saa7146_dev* dev)
{ {
struct saa7146_vv *vv = dev->vv_data; struct saa7146_vv *vv = dev->vv_data;
DEB_EE(("dev:%p\n",dev)); DEB_EE(("dev:%p\n",dev));
if( VFL_TYPE_GRABBER == (*vid)->type ) { if( VFL_TYPE_GRABBER == (*vid)->type ) {
......
...@@ -276,8 +276,8 @@ int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg *msgs, in ...@@ -276,8 +276,8 @@ int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg *msgs, in
int i = 0, count = 0; int i = 0, count = 0;
u32* buffer = dev->d_i2c.cpu_addr; u32* buffer = dev->d_i2c.cpu_addr;
int err = 0; int err = 0;
int address_err = 0; int address_err = 0;
int short_delay = 0; int short_delay = 0;
if (down_interruptible (&dev->i2c_lock)) if (down_interruptible (&dev->i2c_lock))
return -ERESTARTSYS; return -ERESTARTSYS;
...@@ -325,7 +325,7 @@ int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg *msgs, in ...@@ -325,7 +325,7 @@ int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg *msgs, in
if( 0 != (SAA7146_USE_I2C_IRQ & dev->ext->flags)) { if( 0 != (SAA7146_USE_I2C_IRQ & dev->ext->flags)) {
goto out; goto out;
} }
address_err++; address_err++;
} }
DEB_I2C(("error while sending message(s). starting again.\n")); DEB_I2C(("error while sending message(s). starting again.\n"));
break; break;
...@@ -336,14 +336,14 @@ int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg *msgs, in ...@@ -336,14 +336,14 @@ int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg *msgs, in
break; break;
} }
/* delay a bit before retrying */ /* delay a bit before retrying */
msleep(10); msleep(10);
} while (err != num && retries--); } while (err != num && retries--);
/* if every retry had an address error, exit right away */ /* if every retry had an address error, exit right away */
if (address_err == retries) { if (address_err == retries) {
goto out; goto out;
} }
/* if any things had to be read, get the results */ /* if any things had to be read, get the results */
......
...@@ -6,8 +6,8 @@ static int vbi_workaround(struct saa7146_dev *dev) ...@@ -6,8 +6,8 @@ static int vbi_workaround(struct saa7146_dev *dev)
{ {
struct saa7146_vv *vv = dev->vv_data; struct saa7146_vv *vv = dev->vv_data;
u32 *cpu; u32 *cpu;
dma_addr_t dma_addr; dma_addr_t dma_addr;
int count = 0; int count = 0;
int i; int i;
......
...@@ -150,23 +150,23 @@ static int try_win(struct saa7146_dev *dev, struct v4l2_window *win) ...@@ -150,23 +150,23 @@ static int try_win(struct saa7146_dev *dev, struct v4l2_window *win)
maxh = vv->standard->v_max_out; maxh = vv->standard->v_max_out;
if (V4L2_FIELD_ANY == field) { if (V4L2_FIELD_ANY == field) {
field = (win->w.height > maxh/2) field = (win->w.height > maxh/2)
? V4L2_FIELD_INTERLACED ? V4L2_FIELD_INTERLACED
: V4L2_FIELD_TOP; : V4L2_FIELD_TOP;
} }
switch (field) { switch (field) {
case V4L2_FIELD_TOP: case V4L2_FIELD_TOP:
case V4L2_FIELD_BOTTOM: case V4L2_FIELD_BOTTOM:
case V4L2_FIELD_ALTERNATE: case V4L2_FIELD_ALTERNATE:
maxh = maxh / 2; maxh = maxh / 2;
break; break;
case V4L2_FIELD_INTERLACED: case V4L2_FIELD_INTERLACED:
break; break;
default: { default: {
DEB_D(("no known field mode '%d'.\n",field)); DEB_D(("no known field mode '%d'.\n",field));
return -EINVAL; return -EINVAL;
}
} }
}
win->field = field; win->field = field;
if (win->w.width > maxw) if (win->w.width > maxw)
...@@ -887,7 +887,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int ...@@ -887,7 +887,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
DEB_EE(("VIDIOC_QUERYCAP\n")); DEB_EE(("VIDIOC_QUERYCAP\n"));
strcpy(cap->driver, "saa7146 v4l2"); strcpy(cap->driver, "saa7146 v4l2");
strlcpy(cap->card, dev->ext->name, sizeof(cap->card)); strlcpy(cap->card, dev->ext->name, sizeof(cap->card));
sprintf(cap->bus_info,"PCI:%s", pci_name(dev->pci)); sprintf(cap->bus_info,"PCI:%s", pci_name(dev->pci));
cap->version = SAA7146_VERSION_CODE; cap->version = SAA7146_VERSION_CODE;
...@@ -1011,19 +1011,19 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int ...@@ -1011,19 +1011,19 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
err = set_control(fh,arg); err = set_control(fh,arg);
return err; return err;
} }
case VIDIOC_G_PARM: case VIDIOC_G_PARM:
{ {
struct v4l2_streamparm *parm = arg; struct v4l2_streamparm *parm = arg;
if( parm->type != V4L2_BUF_TYPE_VIDEO_CAPTURE ) { if( parm->type != V4L2_BUF_TYPE_VIDEO_CAPTURE ) {
return -EINVAL; return -EINVAL;
} }
memset(&parm->parm.capture,0,sizeof(struct v4l2_captureparm)); memset(&parm->parm.capture,0,sizeof(struct v4l2_captureparm));
parm->parm.capture.readbuffers = 1; parm->parm.capture.readbuffers = 1;
// fixme: only for PAL! // fixme: only for PAL!
parm->parm.capture.timeperframe.numerator = 1; parm->parm.capture.timeperframe.numerator = 1;
parm->parm.capture.timeperframe.denominator = 25; parm->parm.capture.timeperframe.denominator = 25;
return 0; return 0;
} }
case VIDIOC_G_FMT: case VIDIOC_G_FMT:
{ {
struct v4l2_format *f = arg; struct v4l2_format *f = arg;
...@@ -1383,7 +1383,7 @@ static struct videobuf_queue_ops video_qops = { ...@@ -1383,7 +1383,7 @@ static struct videobuf_queue_ops video_qops = {
static void video_init(struct saa7146_dev *dev, struct saa7146_vv *vv) static void video_init(struct saa7146_dev *dev, struct saa7146_vv *vv)
{ {
INIT_LIST_HEAD(&vv->video_q.queue); INIT_LIST_HEAD(&vv->video_q.queue);
init_timer(&vv->video_q.timeout); init_timer(&vv->video_q.timeout);
vv->video_q.timeout.function = saa7146_buffer_timeout; vv->video_q.timeout.function = saa7146_buffer_timeout;
......
...@@ -86,25 +86,25 @@ enum dmx_success { ...@@ -86,25 +86,25 @@ enum dmx_success {
enum dmx_ts_pes enum dmx_ts_pes
{ /* also send packets to decoder (if it exists) */ { /* also send packets to decoder (if it exists) */
DMX_TS_PES_AUDIO0, DMX_TS_PES_AUDIO0,
DMX_TS_PES_VIDEO0, DMX_TS_PES_VIDEO0,
DMX_TS_PES_TELETEXT0, DMX_TS_PES_TELETEXT0,
DMX_TS_PES_SUBTITLE0, DMX_TS_PES_SUBTITLE0,
DMX_TS_PES_PCR0, DMX_TS_PES_PCR0,
DMX_TS_PES_AUDIO1, DMX_TS_PES_AUDIO1,
DMX_TS_PES_VIDEO1, DMX_TS_PES_VIDEO1,
DMX_TS_PES_TELETEXT1, DMX_TS_PES_TELETEXT1,
DMX_TS_PES_SUBTITLE1, DMX_TS_PES_SUBTITLE1,
DMX_TS_PES_PCR1, DMX_TS_PES_PCR1,
DMX_TS_PES_AUDIO2, DMX_TS_PES_AUDIO2,
DMX_TS_PES_VIDEO2, DMX_TS_PES_VIDEO2,
DMX_TS_PES_TELETEXT2, DMX_TS_PES_TELETEXT2,
DMX_TS_PES_SUBTITLE2, DMX_TS_PES_SUBTITLE2,
DMX_TS_PES_PCR2, DMX_TS_PES_PCR2,
DMX_TS_PES_AUDIO3, DMX_TS_PES_AUDIO3,
DMX_TS_PES_VIDEO3, DMX_TS_PES_VIDEO3,
DMX_TS_PES_TELETEXT3, DMX_TS_PES_TELETEXT3,
DMX_TS_PES_SUBTITLE3, DMX_TS_PES_SUBTITLE3,
...@@ -121,17 +121,17 @@ enum dmx_ts_pes ...@@ -121,17 +121,17 @@ enum dmx_ts_pes
struct dmx_ts_feed { struct dmx_ts_feed {
int is_filtering; /* Set to non-zero when filtering in progress */ int is_filtering; /* Set to non-zero when filtering in progress */
struct dmx_demux *parent; /* Back-pointer */ struct dmx_demux *parent; /* Back-pointer */
void *priv; /* Pointer to private data of the API client */ void *priv; /* Pointer to private data of the API client */
int (*set) (struct dmx_ts_feed *feed, int (*set) (struct dmx_ts_feed *feed,
u16 pid, u16 pid,
int type, int type,
enum dmx_ts_pes pes_type, enum dmx_ts_pes pes_type,
size_t circular_buffer_size, size_t circular_buffer_size,
struct timespec timeout); struct timespec timeout);
int (*start_filtering) (struct dmx_ts_feed* feed); int (*start_filtering) (struct dmx_ts_feed* feed);
int (*stop_filtering) (struct dmx_ts_feed* feed); int (*stop_filtering) (struct dmx_ts_feed* feed);
}; };
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
...@@ -139,35 +139,35 @@ struct dmx_ts_feed { ...@@ -139,35 +139,35 @@ struct dmx_ts_feed {
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
struct dmx_section_filter { struct dmx_section_filter {
u8 filter_value [DMX_MAX_FILTER_SIZE]; u8 filter_value [DMX_MAX_FILTER_SIZE];
u8 filter_mask [DMX_MAX_FILTER_SIZE]; u8 filter_mask [DMX_MAX_FILTER_SIZE];
u8 filter_mode [DMX_MAX_FILTER_SIZE]; u8 filter_mode [DMX_MAX_FILTER_SIZE];
struct dmx_section_feed* parent; /* Back-pointer */ struct dmx_section_feed* parent; /* Back-pointer */
void* priv; /* Pointer to private data of the API client */ void* priv; /* Pointer to private data of the API client */
}; };
struct dmx_section_feed { struct dmx_section_feed {
int is_filtering; /* Set to non-zero when filtering in progress */ int is_filtering; /* Set to non-zero when filtering in progress */
struct dmx_demux* parent; /* Back-pointer */ struct dmx_demux* parent; /* Back-pointer */
void* priv; /* Pointer to private data of the API client */ void* priv; /* Pointer to private data of the API client */
int check_crc; int check_crc;
u32 crc_val; u32 crc_val;
u8 *secbuf; u8 *secbuf;
u8 secbuf_base[DMX_MAX_SECFEED_SIZE]; u8 secbuf_base[DMX_MAX_SECFEED_SIZE];
u16 secbufp, seclen, tsfeedp; u16 secbufp, seclen, tsfeedp;
int (*set) (struct dmx_section_feed* feed, int (*set) (struct dmx_section_feed* feed,
u16 pid, u16 pid,
size_t circular_buffer_size, size_t circular_buffer_size,
int check_crc); int check_crc);
int (*allocate_filter) (struct dmx_section_feed* feed, int (*allocate_filter) (struct dmx_section_feed* feed,
struct dmx_section_filter** filter); struct dmx_section_filter** filter);
int (*release_filter) (struct dmx_section_feed* feed, int (*release_filter) (struct dmx_section_feed* feed,
struct dmx_section_filter* filter); struct dmx_section_filter* filter);
int (*start_filtering) (struct dmx_section_feed* feed); int (*start_filtering) (struct dmx_section_feed* feed);
int (*stop_filtering) (struct dmx_section_feed* feed); int (*stop_filtering) (struct dmx_section_feed* feed);
}; };
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
...@@ -205,10 +205,10 @@ enum dmx_frontend_source { ...@@ -205,10 +205,10 @@ enum dmx_frontend_source {
}; };
struct dmx_frontend { struct dmx_frontend {
struct list_head connectivity_list; /* List of front-ends that can struct list_head connectivity_list; /* List of front-ends that can
be connected to a particular be connected to a particular
demux */ demux */
enum dmx_frontend_source source; enum dmx_frontend_source source;
}; };
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
...@@ -240,38 +240,38 @@ struct dmx_frontend { ...@@ -240,38 +240,38 @@ struct dmx_frontend {
#define DMX_FE_ENTRY(list) list_entry(list, struct dmx_frontend, connectivity_list) #define DMX_FE_ENTRY(list) list_entry(list, struct dmx_frontend, connectivity_list)
struct dmx_demux { struct dmx_demux {
u32 capabilities; /* Bitfield of capability flags */ u32 capabilities; /* Bitfield of capability flags */
struct dmx_frontend* frontend; /* Front-end connected to the demux */ struct dmx_frontend* frontend; /* Front-end connected to the demux */
void* priv; /* Pointer to private data of the API client */ void* priv; /* Pointer to private data of the API client */
int (*open) (struct dmx_demux* demux); int (*open) (struct dmx_demux* demux);
int (*close) (struct dmx_demux* demux); int (*close) (struct dmx_demux* demux);
int (*write) (struct dmx_demux* demux, const char* buf, size_t count); int (*write) (struct dmx_demux* demux, const char* buf, size_t count);
int (*allocate_ts_feed) (struct dmx_demux* demux, int (*allocate_ts_feed) (struct dmx_demux* demux,
struct dmx_ts_feed** feed, struct dmx_ts_feed** feed,
dmx_ts_cb callback); dmx_ts_cb callback);
int (*release_ts_feed) (struct dmx_demux* demux, int (*release_ts_feed) (struct dmx_demux* demux,
struct dmx_ts_feed* feed); struct dmx_ts_feed* feed);
int (*allocate_section_feed) (struct dmx_demux* demux, int (*allocate_section_feed) (struct dmx_demux* demux,
struct dmx_section_feed** feed, struct dmx_section_feed** feed,
dmx_section_cb callback); dmx_section_cb callback);
int (*release_section_feed) (struct dmx_demux* demux, int (*release_section_feed) (struct dmx_demux* demux,
struct dmx_section_feed* feed); struct dmx_section_feed* feed);
int (*add_frontend) (struct dmx_demux* demux, int (*add_frontend) (struct dmx_demux* demux,
struct dmx_frontend* frontend); struct dmx_frontend* frontend);
int (*remove_frontend) (struct dmx_demux* demux, int (*remove_frontend) (struct dmx_demux* demux,
struct dmx_frontend* frontend); struct dmx_frontend* frontend);
struct list_head* (*get_frontends) (struct dmx_demux* demux); struct list_head* (*get_frontends) (struct dmx_demux* demux);
int (*connect_frontend) (struct dmx_demux* demux, int (*connect_frontend) (struct dmx_demux* demux,
struct dmx_frontend* frontend); struct dmx_frontend* frontend);
int (*disconnect_frontend) (struct dmx_demux* demux); int (*disconnect_frontend) (struct dmx_demux* demux);
int (*get_pes_pids) (struct dmx_demux* demux, u16 *pids); int (*get_pes_pids) (struct dmx_demux* demux, u16 *pids);
int (*get_caps) (struct dmx_demux* demux, struct dmx_caps *caps); int (*get_caps) (struct dmx_demux* demux, struct dmx_caps *caps);
int (*set_source) (struct dmx_demux* demux, const dmx_source_t *src); int (*set_source) (struct dmx_demux* demux, const dmx_source_t *src);
int (*get_stc) (struct dmx_demux* demux, unsigned int num, int (*get_stc) (struct dmx_demux* demux, unsigned int num,
u64 *stc, unsigned int *base); u64 *stc, unsigned int *base);
}; };
......
...@@ -947,7 +947,7 @@ static int dvb_demux_do_ioctl(struct inode *inode, struct file *file, ...@@ -947,7 +947,7 @@ static int dvb_demux_do_ioctl(struct inode *inode, struct file *file,
case DMX_GET_STC: case DMX_GET_STC:
if (!dmxdev->demux->get_stc) { if (!dmxdev->demux->get_stc) {
ret=-EINVAL; ret=-EINVAL;
break; break;
} }
ret = dmxdev->demux->get_stc(dmxdev->demux, ret = dmxdev->demux->get_stc(dmxdev->demux,
......
...@@ -53,51 +53,51 @@ enum dmxdev_state { ...@@ -53,51 +53,51 @@ enum dmxdev_state {
}; };
struct dmxdev_buffer { struct dmxdev_buffer {
u8 *data; u8 *data;
int size; int size;
int pread; int pread;
int pwrite; int pwrite;
wait_queue_head_t queue; wait_queue_head_t queue;
int error; int error;
}; };
struct dmxdev_filter { struct dmxdev_filter {
struct dvb_device *dvbdev; struct dvb_device *dvbdev;
union { union {
struct dmx_section_filter *sec; struct dmx_section_filter *sec;
} filter; } filter;
union { union {
struct dmx_ts_feed *ts; struct dmx_ts_feed *ts;
struct dmx_section_feed *sec; struct dmx_section_feed *sec;
} feed; } feed;
union { union {
struct dmx_sct_filter_params sec; struct dmx_sct_filter_params sec;
struct dmx_pes_filter_params pes; struct dmx_pes_filter_params pes;
} params; } params;
int type; int type;
enum dmxdev_state state; enum dmxdev_state state;
struct dmxdev *dev; struct dmxdev *dev;
struct dmxdev_buffer buffer; struct dmxdev_buffer buffer;
struct semaphore mutex; struct semaphore mutex;
/* only for sections */ /* only for sections */
struct timer_list timer; struct timer_list timer;
int todo; int todo;
u8 secheader[3]; u8 secheader[3];
u16 pid; u16 pid;
}; };
struct dmxdev_dvr { struct dmxdev_dvr {
int state; int state;
struct dmxdev *dev; struct dmxdev *dev;
struct dmxdev_buffer buffer; struct dmxdev_buffer buffer;
}; };
...@@ -105,16 +105,16 @@ struct dmxdev { ...@@ -105,16 +105,16 @@ struct dmxdev {
struct dvb_device *dvbdev; struct dvb_device *dvbdev;
struct dvb_device *dvr_dvbdev; struct dvb_device *dvr_dvbdev;
struct dmxdev_filter *filter; struct dmxdev_filter *filter;
struct dmxdev_dvr *dvr; struct dmxdev_dvr *dvr;
struct dmx_demux *demux; struct dmx_demux *demux;
int filternum; int filternum;
int capabilities; int capabilities;
#define DMXDEV_CAP_DUPLEX 1 #define DMXDEV_CAP_DUPLEX 1
struct dmx_frontend *dvr_orig_fe; struct dmx_frontend *dvr_orig_fe;
struct dmxdev_buffer dvr_buffer; struct dmxdev_buffer dvr_buffer;
#define DVR_BUFFER_SIZE (10*188*1024) #define DVR_BUFFER_SIZE (10*188*1024)
struct semaphore mutex; struct semaphore mutex;
......
...@@ -498,7 +498,7 @@ static int dvb_ca_en50221_parse_attributes(struct dvb_ca_private *ca, int slot) ...@@ -498,7 +498,7 @@ static int dvb_ca_en50221_parse_attributes(struct dvb_ca_private *ca, int slot)
/* process the CFTABLE_ENTRY tuples, and any after those */ /* process the CFTABLE_ENTRY tuples, and any after those */
while ((!end_chain) && (address < 0x1000)) { while ((!end_chain) && (address < 0x1000)) {
if ((status = dvb_ca_en50221_read_tuple(ca, slot, &address, &tupleType, if ((status = dvb_ca_en50221_read_tuple(ca, slot, &address, &tupleType,
&tupleLength, tuple)) < 0) &tupleLength, tuple)) < 0)
return status; return status;
switch (tupleType) { switch (tupleType) {
case 0x1B: // CISTPL_CFTABLE_ENTRY case 0x1B: // CISTPL_CFTABLE_ENTRY
......
This diff is collapsed.
...@@ -29,8 +29,8 @@ typedef int (dvb_filter_pes2ts_cb_t) (void *, unsigned char *); ...@@ -29,8 +29,8 @@ typedef int (dvb_filter_pes2ts_cb_t) (void *, unsigned char *);
struct dvb_filter_pes2ts { struct dvb_filter_pes2ts {
unsigned char buf[188]; unsigned char buf[188];
unsigned char cc; unsigned char cc;
dvb_filter_pes2ts_cb_t *cb; dvb_filter_pes2ts_cb_t *cb;
void *priv; void *priv;
}; };
...@@ -162,7 +162,7 @@ struct dvb_video_info { ...@@ -162,7 +162,7 @@ struct dvb_video_info {
u32 bit_rate; u32 bit_rate;
u32 comp_bit_rate; u32 comp_bit_rate;
u32 vbv_buffer_size; u32 vbv_buffer_size;
s16 vbv_delay; s16 vbv_delay;
u32 CSPF; u32 CSPF;
u32 off; u32 off;
}; };
...@@ -173,60 +173,60 @@ struct dvb_video_info { ...@@ -173,60 +173,60 @@ struct dvb_video_info {
#define VIDEO_FRAME_PICTURE 0x03 #define VIDEO_FRAME_PICTURE 0x03
struct mpg_picture { struct mpg_picture {
int channel; int channel;
struct dvb_video_info vinfo; struct dvb_video_info vinfo;
u32 *sequence_gop_header; u32 *sequence_gop_header;
u32 *picture_header; u32 *picture_header;
s32 time_code; s32 time_code;
int low_delay; int low_delay;
int closed_gop; int closed_gop;
int broken_link; int broken_link;
int sequence_header_flag; int sequence_header_flag;
int gop_flag; int gop_flag;
int sequence_end_flag; int sequence_end_flag;
u8 profile_and_level; u8 profile_and_level;
s32 picture_coding_parameter; s32 picture_coding_parameter;
u32 matrix[32]; u32 matrix[32];
s8 matrix_change_flag; s8 matrix_change_flag;
u8 picture_header_parameter; u8 picture_header_parameter;
/* bit 0 - 2: bwd f code /* bit 0 - 2: bwd f code
bit 3 : fpb vector bit 3 : fpb vector
bit 4 - 6: fwd f code bit 4 - 6: fwd f code
bit 7 : fpf vector */ bit 7 : fpf vector */
int mpeg1_flag; int mpeg1_flag;
int progressive_sequence; int progressive_sequence;
int sequence_display_extension_flag; int sequence_display_extension_flag;
u32 sequence_header_data; u32 sequence_header_data;
s16 last_frame_centre_horizontal_offset; s16 last_frame_centre_horizontal_offset;
s16 last_frame_centre_vertical_offset; s16 last_frame_centre_vertical_offset;
u32 pts[2]; /* [0] 1st field, [1] 2nd field */ u32 pts[2]; /* [0] 1st field, [1] 2nd field */
int top_field_first; int top_field_first;
int repeat_first_field; int repeat_first_field;
int progressive_frame; int progressive_frame;
int bank; int bank;
int forward_bank; int forward_bank;
int backward_bank; int backward_bank;
int compress; int compress;
s16 frame_centre_horizontal_offset[OFF_SIZE]; s16 frame_centre_horizontal_offset[OFF_SIZE];
/* [0-2] 1st field, [3] 2nd field */ /* [0-2] 1st field, [3] 2nd field */
s16 frame_centre_vertical_offset[OFF_SIZE]; s16 frame_centre_vertical_offset[OFF_SIZE];
/* [0-2] 1st field, [3] 2nd field */ /* [0-2] 1st field, [3] 2nd field */
s16 temporal_reference[2]; s16 temporal_reference[2];
/* [0] 1st field, [1] 2nd field */ /* [0] 1st field, [1] 2nd field */
s8 picture_coding_type[2]; s8 picture_coding_type[2];
/* [0] 1st field, [1] 2nd field */ /* [0] 1st field, [1] 2nd field */
s8 picture_structure[2]; s8 picture_structure[2];
/* [0] 1st field, [1] 2nd field */ /* [0] 1st field, [1] 2nd field */
s8 picture_display_extension_flag[2]; s8 picture_display_extension_flag[2];
/* [0] 1st field, [1] 2nd field */ /* [0] 1st field, [1] 2nd field */
/* picture_display_extenion() 0:no 1:exit*/ /* picture_display_extenion() 0:no 1:exit*/
s8 pts_flag[2]; s8 pts_flag[2];
/* [0] 1st field, [1] 2nd field */ /* [0] 1st field, [1] 2nd field */
}; };
struct dvb_audio_info { struct dvb_audio_info {
......
...@@ -372,10 +372,10 @@ static int dvb_frontend_thread(void *data) ...@@ -372,10 +372,10 @@ static int dvb_frontend_thread(void *data)
snprintf (name, sizeof(name), "kdvb-fe-%i", fe->dvb->num); snprintf (name, sizeof(name), "kdvb-fe-%i", fe->dvb->num);
lock_kernel(); lock_kernel();
daemonize(name); daemonize(name);
sigfillset(&current->blocked); sigfillset(&current->blocked);
unlock_kernel(); unlock_kernel();
fepriv->status = 0; fepriv->status = 0;
dvb_frontend_init(fe); dvb_frontend_init(fe);
......
...@@ -41,10 +41,10 @@ ...@@ -41,10 +41,10 @@
#include "dvbdev.h" #include "dvbdev.h"
struct dvb_frontend_tune_settings { struct dvb_frontend_tune_settings {
int min_delay_ms; int min_delay_ms;
int step_size; int step_size;
int max_drift; int max_drift;
struct dvb_frontend_parameters parameters; struct dvb_frontend_parameters parameters;
}; };
struct dvb_frontend; struct dvb_frontend;
......
...@@ -713,7 +713,7 @@ static int dvb_net_ts_callback(const u8 *buffer1, size_t buffer1_len, ...@@ -713,7 +713,7 @@ static int dvb_net_ts_callback(const u8 *buffer1, size_t buffer1_len,
if (buffer1_len > 32768) if (buffer1_len > 32768)
printk(KERN_WARNING "length > 32k: %zu.\n", buffer1_len); printk(KERN_WARNING "length > 32k: %zu.\n", buffer1_len);
/* printk("TS callback: %u bytes, %u TS cells @ %p.\n", /* printk("TS callback: %u bytes, %u TS cells @ %p.\n",
buffer1_len, buffer1_len / TS_SZ, buffer1); */ buffer1_len, buffer1_len / TS_SZ, buffer1); */
dvb_net_ule(dev, buffer1, buffer1_len); dvb_net_ule(dev, buffer1, buffer1_len);
return 0; return 0;
} }
...@@ -721,8 +721,8 @@ static int dvb_net_ts_callback(const u8 *buffer1, size_t buffer1_len, ...@@ -721,8 +721,8 @@ static int dvb_net_ts_callback(const u8 *buffer1, size_t buffer1_len,
static void dvb_net_sec(struct net_device *dev, u8 *pkt, int pkt_len) static void dvb_net_sec(struct net_device *dev, u8 *pkt, int pkt_len)
{ {
u8 *eth; u8 *eth;
struct sk_buff *skb; struct sk_buff *skb;
struct net_device_stats *stats = &(((struct dvb_net_priv *) dev->priv)->stats); struct net_device_stats *stats = &(((struct dvb_net_priv *) dev->priv)->stats);
int snap = 0; int snap = 0;
...@@ -754,7 +754,7 @@ static void dvb_net_sec(struct net_device *dev, u8 *pkt, int pkt_len) ...@@ -754,7 +754,7 @@ static void dvb_net_sec(struct net_device *dev, u8 *pkt, int pkt_len)
return; return;
} }
snap = 8; snap = 8;
} }
if (pkt[7]) { if (pkt[7]) {
/* FIXME: assemble datagram from multiple sections */ /* FIXME: assemble datagram from multiple sections */
stats->rx_errors++; stats->rx_errors++;
...@@ -778,14 +778,14 @@ static void dvb_net_sec(struct net_device *dev, u8 *pkt, int pkt_len) ...@@ -778,14 +778,14 @@ static void dvb_net_sec(struct net_device *dev, u8 *pkt, int pkt_len)
memcpy(eth + 14, pkt + 12 + snap, pkt_len - 12 - 4 - snap); memcpy(eth + 14, pkt + 12 + snap, pkt_len - 12 - 4 - snap);
/* create ethernet header: */ /* create ethernet header: */
eth[0]=pkt[0x0b]; eth[0]=pkt[0x0b];
eth[1]=pkt[0x0a]; eth[1]=pkt[0x0a];
eth[2]=pkt[0x09]; eth[2]=pkt[0x09];
eth[3]=pkt[0x08]; eth[3]=pkt[0x08];
eth[4]=pkt[0x04]; eth[4]=pkt[0x04];
eth[5]=pkt[0x03]; eth[5]=pkt[0x03];
eth[6]=eth[7]=eth[8]=eth[9]=eth[10]=eth[11]=0; eth[6]=eth[7]=eth[8]=eth[9]=eth[10]=eth[11]=0;
if (snap) { if (snap) {
eth[12] = pkt[18]; eth[12] = pkt[18];
...@@ -807,7 +807,7 @@ static void dvb_net_sec(struct net_device *dev, u8 *pkt, int pkt_len) ...@@ -807,7 +807,7 @@ static void dvb_net_sec(struct net_device *dev, u8 *pkt, int pkt_len)
stats->rx_packets++; stats->rx_packets++;
stats->rx_bytes+=skb->len; stats->rx_bytes+=skb->len;
netif_rx(skb); netif_rx(skb);
} }
static int dvb_net_sec_callback(const u8 *buffer1, size_t buffer1_len, static int dvb_net_sec_callback(const u8 *buffer1, size_t buffer1_len,
...@@ -815,7 +815,7 @@ static int dvb_net_sec_callback(const u8 *buffer1, size_t buffer1_len, ...@@ -815,7 +815,7 @@ static int dvb_net_sec_callback(const u8 *buffer1, size_t buffer1_len,
struct dmx_section_filter *filter, struct dmx_section_filter *filter,
enum dmx_success success) enum dmx_success success)
{ {
struct net_device *dev = filter->priv; struct net_device *dev = filter->priv;
/** /**
* we rely on the DVB API definition where exactly one complete * we rely on the DVB API definition where exactly one complete
...@@ -885,8 +885,8 @@ static int dvb_net_feed_start(struct net_device *dev) ...@@ -885,8 +885,8 @@ static int dvb_net_feed_start(struct net_device *dev)
{ {
int ret = 0, i; int ret = 0, i;
struct dvb_net_priv *priv = dev->priv; struct dvb_net_priv *priv = dev->priv;
struct dmx_demux *demux = priv->demux; struct dmx_demux *demux = priv->demux;
unsigned char *mac = (unsigned char *) dev->dev_addr; unsigned char *mac = (unsigned char *) dev->dev_addr;
dprintk("%s: rx_mode %i\n", __FUNCTION__, priv->rx_mode); dprintk("%s: rx_mode %i\n", __FUNCTION__, priv->rx_mode);
down(&priv->mutex); down(&priv->mutex);
...@@ -1129,12 +1129,12 @@ static int dvb_net_stop(struct net_device *dev) ...@@ -1129,12 +1129,12 @@ static int dvb_net_stop(struct net_device *dev)
struct dvb_net_priv *priv = dev->priv; struct dvb_net_priv *priv = dev->priv;
priv->in_use--; priv->in_use--;
return dvb_net_feed_stop(dev); return dvb_net_feed_stop(dev);
} }
static struct net_device_stats * dvb_net_get_stats(struct net_device *dev) static struct net_device_stats * dvb_net_get_stats(struct net_device *dev)
{ {
return &((struct dvb_net_priv*) dev->priv)->stats; return &((struct dvb_net_priv*) dev->priv)->stats;
} }
static void dvb_net_setup(struct net_device *dev) static void dvb_net_setup(struct net_device *dev)
...@@ -1360,10 +1360,10 @@ static struct file_operations dvb_net_fops = { ...@@ -1360,10 +1360,10 @@ static struct file_operations dvb_net_fops = {
}; };
static struct dvb_device dvbdev_net = { static struct dvb_device dvbdev_net = {
.priv = NULL, .priv = NULL,
.users = 1, .users = 1,
.writers = 1, .writers = 1,
.fops = &dvb_net_fops, .fops = &dvb_net_fops,
}; };
......
...@@ -42,216 +42,216 @@ ...@@ -42,216 +42,216 @@
void dvb_ringbuffer_init(struct dvb_ringbuffer *rbuf, void *data, size_t len) void dvb_ringbuffer_init(struct dvb_ringbuffer *rbuf, void *data, size_t len)
{ {
rbuf->pread=rbuf->pwrite=0; rbuf->pread=rbuf->pwrite=0;
rbuf->data=data; rbuf->data=data;
rbuf->size=len; rbuf->size=len;
init_waitqueue_head(&rbuf->queue); init_waitqueue_head(&rbuf->queue);
spin_lock_init(&(rbuf->lock)); spin_lock_init(&(rbuf->lock));
} }
int dvb_ringbuffer_empty(struct dvb_ringbuffer *rbuf) int dvb_ringbuffer_empty(struct dvb_ringbuffer *rbuf)
{ {
return (rbuf->pread==rbuf->pwrite); return (rbuf->pread==rbuf->pwrite);
} }
ssize_t dvb_ringbuffer_free(struct dvb_ringbuffer *rbuf) ssize_t dvb_ringbuffer_free(struct dvb_ringbuffer *rbuf)
{ {
ssize_t free; ssize_t free;
free = rbuf->pread - rbuf->pwrite; free = rbuf->pread - rbuf->pwrite;
if (free <= 0) if (free <= 0)
free += rbuf->size; free += rbuf->size;
return free-1; return free-1;
} }
ssize_t dvb_ringbuffer_avail(struct dvb_ringbuffer *rbuf) ssize_t dvb_ringbuffer_avail(struct dvb_ringbuffer *rbuf)
{ {
ssize_t avail; ssize_t avail;
avail = rbuf->pwrite - rbuf->pread; avail = rbuf->pwrite - rbuf->pread;
if (avail < 0) if (avail < 0)
avail += rbuf->size; avail += rbuf->size;
return avail; return avail;
} }
void dvb_ringbuffer_flush(struct dvb_ringbuffer *rbuf) void dvb_ringbuffer_flush(struct dvb_ringbuffer *rbuf)
{ {
rbuf->pread = rbuf->pwrite; rbuf->pread = rbuf->pwrite;
} }
void dvb_ringbuffer_flush_spinlock_wakeup(struct dvb_ringbuffer *rbuf) void dvb_ringbuffer_flush_spinlock_wakeup(struct dvb_ringbuffer *rbuf)
{ {
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&rbuf->lock, flags); spin_lock_irqsave(&rbuf->lock, flags);
dvb_ringbuffer_flush(rbuf); dvb_ringbuffer_flush(rbuf);
spin_unlock_irqrestore(&rbuf->lock, flags); spin_unlock_irqrestore(&rbuf->lock, flags);
wake_up(&rbuf->queue); wake_up(&rbuf->queue);
} }
ssize_t dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf, u8 *buf, size_t len, int usermem) ssize_t dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf, u8 *buf, size_t len, int usermem)
{ {
size_t todo = len; size_t todo = len;
size_t split; size_t split;
split = (rbuf->pread + len > rbuf->size) ? rbuf->size - rbuf->pread : 0; split = (rbuf->pread + len > rbuf->size) ? rbuf->size - rbuf->pread : 0;
if (split > 0) { if (split > 0) {
if (!usermem) if (!usermem)
memcpy(buf, rbuf->data+rbuf->pread, split); memcpy(buf, rbuf->data+rbuf->pread, split);
else else
if (copy_to_user(buf, rbuf->data+rbuf->pread, split)) if (copy_to_user(buf, rbuf->data+rbuf->pread, split))
return -EFAULT; return -EFAULT;
buf += split; buf += split;
todo -= split; todo -= split;
rbuf->pread = 0; rbuf->pread = 0;
} }
if (!usermem) if (!usermem)
memcpy(buf, rbuf->data+rbuf->pread, todo); memcpy(buf, rbuf->data+rbuf->pread, todo);
else else
if (copy_to_user(buf, rbuf->data+rbuf->pread, todo)) if (copy_to_user(buf, rbuf->data+rbuf->pread, todo))
return -EFAULT; return -EFAULT;
rbuf->pread = (rbuf->pread + todo) % rbuf->size; rbuf->pread = (rbuf->pread + todo) % rbuf->size;
return len; return len;
} }
ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf, size_t len) ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf, size_t len)
{ {
size_t todo = len; size_t todo = len;
size_t split; size_t split;
split = (rbuf->pwrite + len > rbuf->size) ? rbuf->size - rbuf->pwrite : 0; split = (rbuf->pwrite + len > rbuf->size) ? rbuf->size - rbuf->pwrite : 0;
if (split > 0) { if (split > 0) {
memcpy(rbuf->data+rbuf->pwrite, buf, split); memcpy(rbuf->data+rbuf->pwrite, buf, split);
buf += split; buf += split;
todo -= split; todo -= split;
rbuf->pwrite = 0; rbuf->pwrite = 0;
} }
memcpy(rbuf->data+rbuf->pwrite, buf, todo); memcpy(rbuf->data+rbuf->pwrite, buf, todo);
rbuf->pwrite = (rbuf->pwrite + todo) % rbuf->size; rbuf->pwrite = (rbuf->pwrite + todo) % rbuf->size;
return len; return len;
} }
ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf, size_t len) ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf, size_t len)
{ {
int status; int status;
ssize_t oldpwrite = rbuf->pwrite; ssize_t oldpwrite = rbuf->pwrite;
DVB_RINGBUFFER_WRITE_BYTE(rbuf, len >> 8); DVB_RINGBUFFER_WRITE_BYTE(rbuf, len >> 8);
DVB_RINGBUFFER_WRITE_BYTE(rbuf, len & 0xff); DVB_RINGBUFFER_WRITE_BYTE(rbuf, len & 0xff);
DVB_RINGBUFFER_WRITE_BYTE(rbuf, PKT_READY); DVB_RINGBUFFER_WRITE_BYTE(rbuf, PKT_READY);
status = dvb_ringbuffer_write(rbuf, buf, len); status = dvb_ringbuffer_write(rbuf, buf, len);
if (status < 0) rbuf->pwrite = oldpwrite; if (status < 0) rbuf->pwrite = oldpwrite;
return status; return status;
} }
ssize_t dvb_ringbuffer_pkt_read(struct dvb_ringbuffer *rbuf, size_t idx, ssize_t dvb_ringbuffer_pkt_read(struct dvb_ringbuffer *rbuf, size_t idx,
int offset, u8* buf, size_t len, int usermem) int offset, u8* buf, size_t len, int usermem)
{ {
size_t todo; size_t todo;
size_t split; size_t split;
size_t pktlen; size_t pktlen;
pktlen = rbuf->data[idx] << 8; pktlen = rbuf->data[idx] << 8;
pktlen |= rbuf->data[(idx + 1) % rbuf->size]; pktlen |= rbuf->data[(idx + 1) % rbuf->size];
if (offset > pktlen) return -EINVAL; if (offset > pktlen) return -EINVAL;
if ((offset + len) > pktlen) len = pktlen - offset; if ((offset + len) > pktlen) len = pktlen - offset;
idx = (idx + DVB_RINGBUFFER_PKTHDRSIZE + offset) % rbuf->size; idx = (idx + DVB_RINGBUFFER_PKTHDRSIZE + offset) % rbuf->size;
todo = len; todo = len;
split = ((idx + len) > rbuf->size) ? rbuf->size - idx : 0; split = ((idx + len) > rbuf->size) ? rbuf->size - idx : 0;
if (split > 0) { if (split > 0) {
if (!usermem) if (!usermem)
memcpy(buf, rbuf->data+idx, split); memcpy(buf, rbuf->data+idx, split);
else else
if (copy_to_user(buf, rbuf->data+idx, split)) if (copy_to_user(buf, rbuf->data+idx, split))
return -EFAULT; return -EFAULT;
buf += split; buf += split;
todo -= split; todo -= split;
idx = 0; idx = 0;
} }
if (!usermem) if (!usermem)
memcpy(buf, rbuf->data+idx, todo); memcpy(buf, rbuf->data+idx, todo);
else else
if (copy_to_user(buf, rbuf->data+idx, todo)) if (copy_to_user(buf, rbuf->data+idx, todo))
return -EFAULT; return -EFAULT;
return len; return len;
} }
void dvb_ringbuffer_pkt_dispose(struct dvb_ringbuffer *rbuf, size_t idx) void dvb_ringbuffer_pkt_dispose(struct dvb_ringbuffer *rbuf, size_t idx)
{ {
size_t pktlen; size_t pktlen;
rbuf->data[(idx + 2) % rbuf->size] = PKT_DISPOSED; rbuf->data[(idx + 2) % rbuf->size] = PKT_DISPOSED;
// clean up disposed packets // clean up disposed packets
while(dvb_ringbuffer_avail(rbuf) > DVB_RINGBUFFER_PKTHDRSIZE) { while(dvb_ringbuffer_avail(rbuf) > DVB_RINGBUFFER_PKTHDRSIZE) {
if (DVB_RINGBUFFER_PEEK(rbuf, 2) == PKT_DISPOSED) { if (DVB_RINGBUFFER_PEEK(rbuf, 2) == PKT_DISPOSED) {
pktlen = DVB_RINGBUFFER_PEEK(rbuf, 0) << 8; pktlen = DVB_RINGBUFFER_PEEK(rbuf, 0) << 8;
pktlen |= DVB_RINGBUFFER_PEEK(rbuf, 1); pktlen |= DVB_RINGBUFFER_PEEK(rbuf, 1);
DVB_RINGBUFFER_SKIP(rbuf, pktlen + DVB_RINGBUFFER_PKTHDRSIZE); DVB_RINGBUFFER_SKIP(rbuf, pktlen + DVB_RINGBUFFER_PKTHDRSIZE);
} else { } else {
// first packet is not disposed, so we stop cleaning now // first packet is not disposed, so we stop cleaning now
break; break;
} }
} }
} }
ssize_t dvb_ringbuffer_pkt_next(struct dvb_ringbuffer *rbuf, size_t idx, size_t* pktlen) ssize_t dvb_ringbuffer_pkt_next(struct dvb_ringbuffer *rbuf, size_t idx, size_t* pktlen)
{ {
int consumed; int consumed;
int curpktlen; int curpktlen;
int curpktstatus; int curpktstatus;
if (idx == -1) { if (idx == -1) {
idx = rbuf->pread; idx = rbuf->pread;
} else { } else {
curpktlen = rbuf->data[idx] << 8; curpktlen = rbuf->data[idx] << 8;
curpktlen |= rbuf->data[(idx + 1) % rbuf->size]; curpktlen |= rbuf->data[(idx + 1) % rbuf->size];
idx = (idx + curpktlen + DVB_RINGBUFFER_PKTHDRSIZE) % rbuf->size; idx = (idx + curpktlen + DVB_RINGBUFFER_PKTHDRSIZE) % rbuf->size;
} }
consumed = (idx - rbuf->pread) % rbuf->size; consumed = (idx - rbuf->pread) % rbuf->size;
while((dvb_ringbuffer_avail(rbuf) - consumed) > DVB_RINGBUFFER_PKTHDRSIZE) { while((dvb_ringbuffer_avail(rbuf) - consumed) > DVB_RINGBUFFER_PKTHDRSIZE) {
curpktlen = rbuf->data[idx] << 8; curpktlen = rbuf->data[idx] << 8;
curpktlen |= rbuf->data[(idx + 1) % rbuf->size]; curpktlen |= rbuf->data[(idx + 1) % rbuf->size];
curpktstatus = rbuf->data[(idx + 2) % rbuf->size]; curpktstatus = rbuf->data[(idx + 2) % rbuf->size];
if (curpktstatus == PKT_READY) { if (curpktstatus == PKT_READY) {
*pktlen = curpktlen; *pktlen = curpktlen;
return idx; return idx;
} }
consumed += curpktlen + DVB_RINGBUFFER_PKTHDRSIZE; consumed += curpktlen + DVB_RINGBUFFER_PKTHDRSIZE;
idx = (idx + curpktlen + DVB_RINGBUFFER_PKTHDRSIZE) % rbuf->size; idx = (idx + curpktlen + DVB_RINGBUFFER_PKTHDRSIZE) % rbuf->size;
} }
// no packets available // no packets available
return -1; return -1;
} }
......
...@@ -31,13 +31,13 @@ ...@@ -31,13 +31,13 @@
#include <linux/wait.h> #include <linux/wait.h>
struct dvb_ringbuffer { struct dvb_ringbuffer {
u8 *data; u8 *data;
ssize_t size; ssize_t size;
ssize_t pread; ssize_t pread;
ssize_t pwrite; ssize_t pwrite;
wait_queue_head_t queue; wait_queue_head_t queue;
spinlock_t lock; spinlock_t lock;
}; };
#define DVB_RINGBUFFER_PKTHDRSIZE 3 #define DVB_RINGBUFFER_PKTHDRSIZE 3
...@@ -106,7 +106,7 @@ extern void dvb_ringbuffer_flush_spinlock_wakeup(struct dvb_ringbuffer *rbuf); ...@@ -106,7 +106,7 @@ extern void dvb_ringbuffer_flush_spinlock_wakeup(struct dvb_ringbuffer *rbuf);
** returns number of bytes transferred or -EFAULT ** returns number of bytes transferred or -EFAULT
*/ */
extern ssize_t dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf, u8 *buf, extern ssize_t dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf, u8 *buf,
size_t len, int usermem); size_t len, int usermem);
/* write routines & macros */ /* write routines & macros */
...@@ -121,7 +121,7 @@ extern ssize_t dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf, u8 *buf, ...@@ -121,7 +121,7 @@ extern ssize_t dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf, u8 *buf,
** returns number of bytes transferred or -EFAULT ** returns number of bytes transferred or -EFAULT
*/ */
extern ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf, extern ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf,
size_t len); size_t len);
/** /**
...@@ -133,7 +133,7 @@ extern ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf, ...@@ -133,7 +133,7 @@ extern ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf,
* returns Number of bytes written, or -EFAULT, -ENOMEM, -EVINAL. * returns Number of bytes written, or -EFAULT, -ENOMEM, -EVINAL.
*/ */
extern ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf, extern ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf,
size_t len); size_t len);
/** /**
* Read from a packet in the ringbuffer. Note: unlike dvb_ringbuffer_read(), this * Read from a packet in the ringbuffer. Note: unlike dvb_ringbuffer_read(), this
...@@ -149,7 +149,7 @@ extern ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf, ...@@ -149,7 +149,7 @@ extern ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf,
* returns Number of bytes read, or -EFAULT. * returns Number of bytes read, or -EFAULT.
*/ */
extern ssize_t dvb_ringbuffer_pkt_read(struct dvb_ringbuffer *rbuf, size_t idx, extern ssize_t dvb_ringbuffer_pkt_read(struct dvb_ringbuffer *rbuf, size_t idx,
int offset, u8* buf, size_t len, int usermem); int offset, u8* buf, size_t len, int usermem);
/** /**
* Dispose of a packet in the ring buffer. * Dispose of a packet in the ring buffer.
......
...@@ -47,7 +47,7 @@ static LIST_HEAD(dvb_adapter_list); ...@@ -47,7 +47,7 @@ static LIST_HEAD(dvb_adapter_list);
static DECLARE_MUTEX(dvbdev_register_lock); static DECLARE_MUTEX(dvbdev_register_lock);
static const char * const dnames[] = { static const char * const dnames[] = {
"video", "audio", "sec", "frontend", "demux", "dvr", "ca", "video", "audio", "sec", "frontend", "demux", "dvr", "ca",
"net", "osd" "net", "osd"
}; };
...@@ -90,15 +90,15 @@ static int dvb_device_open(struct inode *inode, struct file *file) ...@@ -90,15 +90,15 @@ static int dvb_device_open(struct inode *inode, struct file *file)
file->private_data = dvbdev; file->private_data = dvbdev;
old_fops = file->f_op; old_fops = file->f_op;
file->f_op = fops_get(dvbdev->fops); file->f_op = fops_get(dvbdev->fops);
if(file->f_op->open) if(file->f_op->open)
err = file->f_op->open(inode,file); err = file->f_op->open(inode,file);
if (err) { if (err) {
fops_put(file->f_op); fops_put(file->f_op);
file->f_op = fops_get(old_fops); file->f_op = fops_get(old_fops);
} }
fops_put(old_fops); fops_put(old_fops);
return err; return err;
} }
return -ENODEV; return -ENODEV;
} }
...@@ -117,21 +117,21 @@ static struct cdev dvb_device_cdev = { ...@@ -117,21 +117,21 @@ static struct cdev dvb_device_cdev = {
int dvb_generic_open(struct inode *inode, struct file *file) int dvb_generic_open(struct inode *inode, struct file *file)
{ {
struct dvb_device *dvbdev = file->private_data; struct dvb_device *dvbdev = file->private_data;
if (!dvbdev) if (!dvbdev)
return -ENODEV; return -ENODEV;
if (!dvbdev->users) if (!dvbdev->users)
return -EBUSY; return -EBUSY;
if ((file->f_flags & O_ACCMODE) == O_RDONLY) { if ((file->f_flags & O_ACCMODE) == O_RDONLY) {
if (!dvbdev->readers) if (!dvbdev->readers)
return -EBUSY; return -EBUSY;
dvbdev->readers--; dvbdev->readers--;
} else { } else {
if (!dvbdev->writers) if (!dvbdev->writers)
return -EBUSY; return -EBUSY;
dvbdev->writers--; dvbdev->writers--;
} }
...@@ -143,10 +143,10 @@ EXPORT_SYMBOL(dvb_generic_open); ...@@ -143,10 +143,10 @@ EXPORT_SYMBOL(dvb_generic_open);
int dvb_generic_release(struct inode *inode, struct file *file) int dvb_generic_release(struct inode *inode, struct file *file)
{ {
struct dvb_device *dvbdev = file->private_data; struct dvb_device *dvbdev = file->private_data;
if (!dvbdev) if (!dvbdev)
return -ENODEV; return -ENODEV;
if ((file->f_flags & O_ACCMODE) == O_RDONLY) { if ((file->f_flags & O_ACCMODE) == O_RDONLY) {
dvbdev->readers++; dvbdev->readers++;
...@@ -163,10 +163,10 @@ EXPORT_SYMBOL(dvb_generic_release); ...@@ -163,10 +163,10 @@ EXPORT_SYMBOL(dvb_generic_release);
int dvb_generic_ioctl(struct inode *inode, struct file *file, int dvb_generic_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg) unsigned int cmd, unsigned long arg)
{ {
struct dvb_device *dvbdev = file->private_data; struct dvb_device *dvbdev = file->private_data;
if (!dvbdev) if (!dvbdev)
return -ENODEV; return -ENODEV;
if (!dvbdev->kernel_ioctl) if (!dvbdev->kernel_ioctl)
return -EINVAL; return -EINVAL;
...@@ -334,63 +334,63 @@ EXPORT_SYMBOL(dvb_unregister_adapter); ...@@ -334,63 +334,63 @@ EXPORT_SYMBOL(dvb_unregister_adapter);
to the v4l "videodev.o" module, which is unnecessary for some to the v4l "videodev.o" module, which is unnecessary for some
cards (ie. the budget dvb-cards don't need the v4l module...) */ cards (ie. the budget dvb-cards don't need the v4l module...) */
int dvb_usercopy(struct inode *inode, struct file *file, int dvb_usercopy(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg, unsigned int cmd, unsigned long arg,
int (*func)(struct inode *inode, struct file *file, int (*func)(struct inode *inode, struct file *file,
unsigned int cmd, void *arg)) unsigned int cmd, void *arg))
{ {
char sbuf[128]; char sbuf[128];
void *mbuf = NULL; void *mbuf = NULL;
void *parg = NULL; void *parg = NULL;
int err = -EINVAL; int err = -EINVAL;
/* Copy arguments into temp kernel buffer */ /* Copy arguments into temp kernel buffer */
switch (_IOC_DIR(cmd)) { switch (_IOC_DIR(cmd)) {
case _IOC_NONE: case _IOC_NONE:
/* /*
* For this command, the pointer is actually an integer * For this command, the pointer is actually an integer
* argument. * argument.
*/ */
parg = (void *) arg; parg = (void *) arg;
break; break;
case _IOC_READ: /* some v4l ioctls are marked wrong ... */ case _IOC_READ: /* some v4l ioctls are marked wrong ... */
case _IOC_WRITE: case _IOC_WRITE:
case (_IOC_WRITE | _IOC_READ): case (_IOC_WRITE | _IOC_READ):
if (_IOC_SIZE(cmd) <= sizeof(sbuf)) { if (_IOC_SIZE(cmd) <= sizeof(sbuf)) {
parg = sbuf; parg = sbuf;
} else { } else {
/* too big to allocate from stack */ /* too big to allocate from stack */
mbuf = kmalloc(_IOC_SIZE(cmd),GFP_KERNEL); mbuf = kmalloc(_IOC_SIZE(cmd),GFP_KERNEL);
if (NULL == mbuf) if (NULL == mbuf)
return -ENOMEM; return -ENOMEM;
parg = mbuf; parg = mbuf;
} }
err = -EFAULT; err = -EFAULT;
if (copy_from_user(parg, (void __user *)arg, _IOC_SIZE(cmd))) if (copy_from_user(parg, (void __user *)arg, _IOC_SIZE(cmd)))
goto out; goto out;
break; break;
} }
/* call driver */ /* call driver */
if ((err = func(inode, file, cmd, parg)) == -ENOIOCTLCMD) if ((err = func(inode, file, cmd, parg)) == -ENOIOCTLCMD)
err = -EINVAL; err = -EINVAL;
if (err < 0) if (err < 0)
goto out; goto out;
/* Copy results into user buffer */ /* Copy results into user buffer */
switch (_IOC_DIR(cmd)) switch (_IOC_DIR(cmd))
{ {
case _IOC_READ: case _IOC_READ:
case (_IOC_WRITE | _IOC_READ): case (_IOC_WRITE | _IOC_READ):
if (copy_to_user((void __user *)arg, parg, _IOC_SIZE(cmd))) if (copy_to_user((void __user *)arg, parg, _IOC_SIZE(cmd)))
err = -EFAULT; err = -EFAULT;
break; break;
} }
out: out:
kfree(mbuf); kfree(mbuf);
return err; return err;
} }
static int __init init_dvbdev(void) static int __init init_dvbdev(void)
...@@ -427,10 +427,10 @@ static int __init init_dvbdev(void) ...@@ -427,10 +427,10 @@ static int __init init_dvbdev(void)
static void __exit exit_dvbdev(void) static void __exit exit_dvbdev(void)
{ {
devfs_remove("dvb"); devfs_remove("dvb");
class_destroy(dvb_class); class_destroy(dvb_class);
cdev_del(&dvb_device_cdev); cdev_del(&dvb_device_cdev);
unregister_chrdev_region(MKDEV(DVB_MAJOR, 0), MAX_DVB_MINORS); unregister_chrdev_region(MKDEV(DVB_MAJOR, 0), MAX_DVB_MINORS);
} }
module_init(init_dvbdev); module_init(init_dvbdev);
......
...@@ -68,8 +68,8 @@ struct dvb_device { ...@@ -68,8 +68,8 @@ struct dvb_device {
int writers; int writers;
int users; int users;
/* don't really need those !? -- FIXME: use video_usercopy */ /* don't really need those !? -- FIXME: use video_usercopy */
int (*kernel_ioctl)(struct inode *inode, struct file *file, int (*kernel_ioctl)(struct inode *inode, struct file *file,
unsigned int cmd, void *arg); unsigned int cmd, void *arg);
void *priv; void *priv;
...@@ -97,7 +97,7 @@ we simply define out own dvb_usercopy(), which will hopefully become ...@@ -97,7 +97,7 @@ we simply define out own dvb_usercopy(), which will hopefully become
generic_usercopy() someday... */ generic_usercopy() someday... */
extern int dvb_usercopy(struct inode *inode, struct file *file, extern int dvb_usercopy(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg, unsigned int cmd, unsigned long arg,
int (*func)(struct inode *inode, struct file *file, int (*func)(struct inode *inode, struct file *file,
unsigned int cmd, void *arg)); unsigned int cmd, void *arg));
......
...@@ -231,18 +231,18 @@ bt832_command(struct i2c_client *client, unsigned int cmd, void *arg) ...@@ -231,18 +231,18 @@ bt832_command(struct i2c_client *client, unsigned int cmd, void *arg)
static struct i2c_driver driver = { static struct i2c_driver driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "i2c bt832 driver", .name = "i2c bt832 driver",
.id = -1, /* FIXME */ .id = -1, /* FIXME */
.flags = I2C_DF_NOTIFY, .flags = I2C_DF_NOTIFY,
.attach_adapter = bt832_probe, .attach_adapter = bt832_probe,
.detach_client = bt832_detach, .detach_client = bt832_detach,
.command = bt832_command, .command = bt832_command,
}; };
static struct i2c_client client_template = static struct i2c_client client_template =
{ {
.name = "bt832", .name = "bt832",
.flags = I2C_CLIENT_ALLOW_USE, .flags = I2C_CLIENT_ALLOW_USE,
.driver = &driver, .driver = &driver,
}; };
......
...@@ -727,71 +727,71 @@ void free_btres(struct bttv *btv, struct bttv_fh *fh, int bits) ...@@ -727,71 +727,71 @@ void free_btres(struct bttv *btv, struct bttv_fh *fh, int bits)
static void set_pll_freq(struct bttv *btv, unsigned int fin, unsigned int fout) static void set_pll_freq(struct bttv *btv, unsigned int fin, unsigned int fout)
{ {
unsigned char fl, fh, fi; unsigned char fl, fh, fi;
/* prevent overflows */ /* prevent overflows */
fin/=4; fin/=4;
fout/=4; fout/=4;
fout*=12; fout*=12;
fi=fout/fin; fi=fout/fin;
fout=(fout%fin)*256; fout=(fout%fin)*256;
fh=fout/fin; fh=fout/fin;
fout=(fout%fin)*256; fout=(fout%fin)*256;
fl=fout/fin; fl=fout/fin;
btwrite(fl, BT848_PLL_F_LO); btwrite(fl, BT848_PLL_F_LO);
btwrite(fh, BT848_PLL_F_HI); btwrite(fh, BT848_PLL_F_HI);
btwrite(fi|BT848_PLL_X, BT848_PLL_XCI); btwrite(fi|BT848_PLL_X, BT848_PLL_XCI);
} }
static void set_pll(struct bttv *btv) static void set_pll(struct bttv *btv)
{ {
int i; int i;
if (!btv->pll.pll_crystal) if (!btv->pll.pll_crystal)
return; return;
if (btv->pll.pll_ofreq == btv->pll.pll_current) { if (btv->pll.pll_ofreq == btv->pll.pll_current) {
dprintk("bttv%d: PLL: no change required\n",btv->c.nr); dprintk("bttv%d: PLL: no change required\n",btv->c.nr);
return; return;
} }
if (btv->pll.pll_ifreq == btv->pll.pll_ofreq) { if (btv->pll.pll_ifreq == btv->pll.pll_ofreq) {
/* no PLL needed */ /* no PLL needed */
if (btv->pll.pll_current == 0) if (btv->pll.pll_current == 0)
return; return;
bttv_printk(KERN_INFO "bttv%d: PLL can sleep, using XTAL (%d).\n", bttv_printk(KERN_INFO "bttv%d: PLL can sleep, using XTAL (%d).\n",
btv->c.nr,btv->pll.pll_ifreq); btv->c.nr,btv->pll.pll_ifreq);
btwrite(0x00,BT848_TGCTRL); btwrite(0x00,BT848_TGCTRL);
btwrite(0x00,BT848_PLL_XCI); btwrite(0x00,BT848_PLL_XCI);
btv->pll.pll_current = 0; btv->pll.pll_current = 0;
return; return;
} }
bttv_printk(KERN_INFO "bttv%d: PLL: %d => %d ",btv->c.nr, bttv_printk(KERN_INFO "bttv%d: PLL: %d => %d ",btv->c.nr,
btv->pll.pll_ifreq, btv->pll.pll_ofreq); btv->pll.pll_ifreq, btv->pll.pll_ofreq);
set_pll_freq(btv, btv->pll.pll_ifreq, btv->pll.pll_ofreq); set_pll_freq(btv, btv->pll.pll_ifreq, btv->pll.pll_ofreq);
for (i=0; i<10; i++) { for (i=0; i<10; i++) {
/* Let other people run while the PLL stabilizes */ /* Let other people run while the PLL stabilizes */
bttv_printk("."); bttv_printk(".");
msleep(10); msleep(10);
if (btread(BT848_DSTATUS) & BT848_DSTATUS_PLOCK) { if (btread(BT848_DSTATUS) & BT848_DSTATUS_PLOCK) {
btwrite(0,BT848_DSTATUS); btwrite(0,BT848_DSTATUS);
} else { } else {
btwrite(0x08,BT848_TGCTRL); btwrite(0x08,BT848_TGCTRL);
btv->pll.pll_current = btv->pll.pll_ofreq; btv->pll.pll_current = btv->pll.pll_ofreq;
bttv_printk(" ok\n"); bttv_printk(" ok\n");
return; return;
} }
} }
btv->pll.pll_current = -1; btv->pll.pll_current = -1;
bttv_printk("failed\n"); bttv_printk("failed\n");
return; return;
} }
/* used to switch between the bt848's analog/digital video capture modes */ /* used to switch between the bt848's analog/digital video capture modes */
......
...@@ -296,7 +296,7 @@ static int ir_attach(struct i2c_adapter *adap, int addr, ...@@ -296,7 +296,7 @@ static int ir_attach(struct i2c_adapter *adap, int addr,
IR_KEYTAB_TYPE *ir_codes = NULL; IR_KEYTAB_TYPE *ir_codes = NULL;
char *name; char *name;
int ir_type; int ir_type;
struct IR_i2c *ir; struct IR_i2c *ir;
struct input_dev *input_dev; struct input_dev *input_dev;
ir = kzalloc(sizeof(struct IR_i2c), GFP_KERNEL); ir = kzalloc(sizeof(struct IR_i2c), GFP_KERNEL);
...@@ -304,7 +304,7 @@ static int ir_attach(struct i2c_adapter *adap, int addr, ...@@ -304,7 +304,7 @@ static int ir_attach(struct i2c_adapter *adap, int addr,
if (!ir || !input_dev) { if (!ir || !input_dev) {
kfree(ir); kfree(ir);
input_free_device(input_dev); input_free_device(input_dev);
return -ENOMEM; return -ENOMEM;
} }
ir->c = client_template; ir->c = client_template;
......
...@@ -1559,11 +1559,11 @@ static void msp_wake_thread(struct i2c_client *client); ...@@ -1559,11 +1559,11 @@ static void msp_wake_thread(struct i2c_client *client);
static struct i2c_driver driver = { static struct i2c_driver driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "msp3400", .name = "msp3400",
.id = I2C_DRIVERID_MSP3400, .id = I2C_DRIVERID_MSP3400,
.flags = I2C_DF_NOTIFY, .flags = I2C_DF_NOTIFY,
.attach_adapter = msp_probe, .attach_adapter = msp_probe,
.detach_client = msp_detach, .detach_client = msp_detach,
.command = msp_command, .command = msp_command,
.driver = { .driver = {
.suspend = msp_suspend, .suspend = msp_suspend,
.resume = msp_resume, .resume = msp_resume,
...@@ -1574,7 +1574,7 @@ static struct i2c_client client_template = ...@@ -1574,7 +1574,7 @@ static struct i2c_client client_template =
{ {
.name = "(unset)", .name = "(unset)",
.flags = I2C_CLIENT_ALLOW_USE, .flags = I2C_CLIENT_ALLOW_USE,
.driver = &driver, .driver = &driver,
}; };
static int msp_attach(struct i2c_adapter *adap, int addr, int kind) static int msp_attach(struct i2c_adapter *adap, int addr, int kind)
......
...@@ -523,7 +523,7 @@ static int saa6752hs_attach(struct i2c_adapter *adap, int addr, int kind) ...@@ -523,7 +523,7 @@ static int saa6752hs_attach(struct i2c_adapter *adap, int addr, int kind)
h->standard = 0; h->standard = 0;
i2c_set_clientdata(&h->client, h); i2c_set_clientdata(&h->client, h);
i2c_attach_client(&h->client); i2c_attach_client(&h->client);
return 0; return 0;
} }
...@@ -597,19 +597,19 @@ saa6752hs_command(struct i2c_client *client, unsigned int cmd, void *arg) ...@@ -597,19 +597,19 @@ saa6752hs_command(struct i2c_client *client, unsigned int cmd, void *arg)
static struct i2c_driver driver = { static struct i2c_driver driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "i2c saa6752hs MPEG encoder", .name = "i2c saa6752hs MPEG encoder",
.id = I2C_DRIVERID_SAA6752HS, .id = I2C_DRIVERID_SAA6752HS,
.flags = I2C_DF_NOTIFY, .flags = I2C_DF_NOTIFY,
.attach_adapter = saa6752hs_probe, .attach_adapter = saa6752hs_probe,
.detach_client = saa6752hs_detach, .detach_client = saa6752hs_detach,
.command = saa6752hs_command, .command = saa6752hs_command,
}; };
static struct i2c_client client_template = static struct i2c_client client_template =
{ {
.name = "saa6752hs", .name = "saa6752hs",
.flags = I2C_CLIENT_ALLOW_USE, .flags = I2C_CLIENT_ALLOW_USE,
.driver = &driver, .driver = &driver,
}; };
static int __init saa6752hs_init_module(void) static int __init saa6752hs_init_module(void)
......
...@@ -59,7 +59,7 @@ module_param_array(index, int, NULL, 0444); ...@@ -59,7 +59,7 @@ module_param_array(index, int, NULL, 0444);
MODULE_PARM_DESC(index, "Index value for SAA7134 capture interface(s)."); MODULE_PARM_DESC(index, "Index value for SAA7134 capture interface(s).");
#define dprintk(fmt, arg...) if (debug) \ #define dprintk(fmt, arg...) if (debug) \
printk(KERN_DEBUG "%s/alsa: " fmt, dev->name , ## arg) printk(KERN_DEBUG "%s/alsa: " fmt, dev->name , ## arg)
/* /*
* Main chip structure * Main chip structure
...@@ -208,8 +208,8 @@ static void saa7134_irq_alsa_done(struct saa7134_dev *dev, ...@@ -208,8 +208,8 @@ static void saa7134_irq_alsa_done(struct saa7134_dev *dev,
static irqreturn_t saa7134_alsa_irq(int irq, void *dev_id, struct pt_regs *regs) static irqreturn_t saa7134_alsa_irq(int irq, void *dev_id, struct pt_regs *regs)
{ {
struct saa7134_dmasound *dmasound = dev_id; struct saa7134_dmasound *dmasound = dev_id;
struct saa7134_dev *dev = dmasound->priv_data; struct saa7134_dev *dev = dmasound->priv_data;
unsigned long report, status; unsigned long report, status;
int loop, handled = 0; int loop, handled = 0;
...@@ -985,7 +985,7 @@ static int saa7134_alsa_init(void) ...@@ -985,7 +985,7 @@ static int saa7134_alsa_init(void)
struct saa7134_dev *dev = NULL; struct saa7134_dev *dev = NULL;
struct list_head *list; struct list_head *list;
printk(KERN_INFO "saa7134 ALSA driver for DMA sound loaded\n"); printk(KERN_INFO "saa7134 ALSA driver for DMA sound loaded\n");
list_for_each(list,&saa7134_devlist) { list_for_each(list,&saa7134_devlist) {
dev = list_entry(list, struct saa7134_dev, devlist); dev = list_entry(list, struct saa7134_dev, devlist);
......
...@@ -782,36 +782,36 @@ struct file_operations saa7134_mixer_fops = { ...@@ -782,36 +782,36 @@ struct file_operations saa7134_mixer_fops = {
static irqreturn_t saa7134_oss_irq(int irq, void *dev_id, struct pt_regs *regs) static irqreturn_t saa7134_oss_irq(int irq, void *dev_id, struct pt_regs *regs)
{ {
struct saa7134_dmasound *dmasound = dev_id; struct saa7134_dmasound *dmasound = dev_id;
struct saa7134_dev *dev = dmasound->priv_data; struct saa7134_dev *dev = dmasound->priv_data;
unsigned long report, status; unsigned long report, status;
int loop, handled = 0; int loop, handled = 0;
for (loop = 0; loop < 10; loop++) { for (loop = 0; loop < 10; loop++) {
report = saa_readl(SAA7134_IRQ_REPORT); report = saa_readl(SAA7134_IRQ_REPORT);
status = saa_readl(SAA7134_IRQ_STATUS); status = saa_readl(SAA7134_IRQ_STATUS);
if (report & SAA7134_IRQ_REPORT_DONE_RA3) { if (report & SAA7134_IRQ_REPORT_DONE_RA3) {
handled = 1; handled = 1;
saa_writel(SAA7134_IRQ_REPORT,report); saa_writel(SAA7134_IRQ_REPORT,report);
saa7134_irq_oss_done(dev, status); saa7134_irq_oss_done(dev, status);
} else { } else {
goto out; goto out;
} }
} }
if (loop == 10) { if (loop == 10) {
dprintk("error! looping IRQ!"); dprintk("error! looping IRQ!");
} }
out: out:
return IRQ_RETVAL(handled); return IRQ_RETVAL(handled);
} }
int saa7134_oss_init1(struct saa7134_dev *dev) int saa7134_oss_init1(struct saa7134_dev *dev)
{ {
if ((request_irq(dev->pci->irq, saa7134_oss_irq, if ((request_irq(dev->pci->irq, saa7134_oss_irq,
SA_SHIRQ | SA_INTERRUPT, dev->name, SA_SHIRQ | SA_INTERRUPT, dev->name,
(void*) &dev->dmasound)) < 0) (void*) &dev->dmasound)) < 0)
return -1; return -1;
...@@ -905,7 +905,7 @@ static int saa7134_dsp_create(struct saa7134_dev *dev) ...@@ -905,7 +905,7 @@ static int saa7134_dsp_create(struct saa7134_dev *dev)
err = dev->dmasound.minor_dsp = err = dev->dmasound.minor_dsp =
register_sound_dsp(&saa7134_dsp_fops, register_sound_dsp(&saa7134_dsp_fops,
dsp_nr[dev->nr]); dsp_nr[dev->nr]);
if (err < 0) { if (err < 0) {
goto fail; goto fail;
} }
...@@ -923,7 +923,7 @@ static int saa7134_dsp_create(struct saa7134_dev *dev) ...@@ -923,7 +923,7 @@ static int saa7134_dsp_create(struct saa7134_dev *dev)
return 0; return 0;
fail: fail:
unregister_sound_dsp(dev->dmasound.minor_dsp); unregister_sound_dsp(dev->dmasound.minor_dsp);
return 0; return 0;
...@@ -956,49 +956,49 @@ static int oss_device_exit(struct saa7134_dev *dev) ...@@ -956,49 +956,49 @@ static int oss_device_exit(struct saa7134_dev *dev)
static int saa7134_oss_init(void) static int saa7134_oss_init(void)
{ {
struct saa7134_dev *dev = NULL; struct saa7134_dev *dev = NULL;
struct list_head *list; struct list_head *list;
printk(KERN_INFO "saa7134 OSS driver for DMA sound loaded\n"); printk(KERN_INFO "saa7134 OSS driver for DMA sound loaded\n");
list_for_each(list,&saa7134_devlist) { list_for_each(list,&saa7134_devlist) {
dev = list_entry(list, struct saa7134_dev, devlist); dev = list_entry(list, struct saa7134_dev, devlist);
if (dev->dmasound.priv_data == NULL) { if (dev->dmasound.priv_data == NULL) {
oss_device_init(dev); oss_device_init(dev);
} else { } else {
printk(KERN_ERR "saa7134 OSS: DMA sound is being handled by ALSA, ignoring %s\n",dev->name); printk(KERN_ERR "saa7134 OSS: DMA sound is being handled by ALSA, ignoring %s\n",dev->name);
return -EBUSY; return -EBUSY;
} }
} }
if (dev == NULL) if (dev == NULL)
printk(KERN_INFO "saa7134 OSS: no saa7134 cards found\n"); printk(KERN_INFO "saa7134 OSS: no saa7134 cards found\n");
dmasound_init = oss_device_init; dmasound_init = oss_device_init;
dmasound_exit = oss_device_exit; dmasound_exit = oss_device_exit;
return 0; return 0;
} }
static void saa7134_oss_exit(void) static void saa7134_oss_exit(void)
{ {
struct saa7134_dev *dev = NULL; struct saa7134_dev *dev = NULL;
struct list_head *list; struct list_head *list;
list_for_each(list,&saa7134_devlist) { list_for_each(list,&saa7134_devlist) {
dev = list_entry(list, struct saa7134_dev, devlist); dev = list_entry(list, struct saa7134_dev, devlist);
/* Device isn't registered by OSS, probably ALSA's */ /* Device isn't registered by OSS, probably ALSA's */
if (!dev->dmasound.minor_dsp) if (!dev->dmasound.minor_dsp)
continue; continue;
oss_device_exit(dev); oss_device_exit(dev);
} }
printk(KERN_INFO "saa7134 OSS driver for DMA sound unloaded\n"); printk(KERN_INFO "saa7134 OSS driver for DMA sound unloaded\n");
return; return;
} }
module_init(saa7134_oss_init); module_init(saa7134_oss_init);
......
...@@ -819,12 +819,12 @@ static int tda9887_resume(struct device * dev) ...@@ -819,12 +819,12 @@ static int tda9887_resume(struct device * dev)
static struct i2c_driver driver = { static struct i2c_driver driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "i2c tda9887 driver", .name = "i2c tda9887 driver",
.id = -1, /* FIXME */ .id = -1, /* FIXME */
.flags = I2C_DF_NOTIFY, .flags = I2C_DF_NOTIFY,
.attach_adapter = tda9887_probe, .attach_adapter = tda9887_probe,
.detach_client = tda9887_detach, .detach_client = tda9887_detach,
.command = tda9887_command, .command = tda9887_command,
.driver = { .driver = {
.suspend = tda9887_suspend, .suspend = tda9887_suspend,
.resume = tda9887_resume, .resume = tda9887_resume,
...@@ -834,7 +834,7 @@ static struct i2c_client client_template = ...@@ -834,7 +834,7 @@ static struct i2c_client client_template =
{ {
.name = "tda9887", .name = "tda9887",
.flags = I2C_CLIENT_ALLOW_USE, .flags = I2C_CLIENT_ALLOW_USE,
.driver = &driver, .driver = &driver,
}; };
static int __init tda9887_init_module(void) static int __init tda9887_init_module(void)
......
...@@ -1506,18 +1506,18 @@ static int chip_attach(struct i2c_adapter *adap, int addr, int kind) ...@@ -1506,18 +1506,18 @@ static int chip_attach(struct i2c_adapter *adap, int addr, int kind)
return -EIO; return -EIO;
} }
tvaudio_info("%s found @ 0x%x (%s)\n", desc->name, addr<<1, adap->name); tvaudio_info("%s found @ 0x%x (%s)\n", desc->name, addr<<1, adap->name);
if (desc->flags) { if (desc->flags) {
tvaudio_dbg("matches:%s%s%s.\n", tvaudio_dbg("matches:%s%s%s.\n",
(desc->flags & CHIP_HAS_VOLUME) ? " volume" : "", (desc->flags & CHIP_HAS_VOLUME) ? " volume" : "",
(desc->flags & CHIP_HAS_BASSTREBLE) ? " bass/treble" : "", (desc->flags & CHIP_HAS_BASSTREBLE) ? " bass/treble" : "",
(desc->flags & CHIP_HAS_INPUTSEL) ? " audiomux" : ""); (desc->flags & CHIP_HAS_INPUTSEL) ? " audiomux" : "");
} }
/* fill required data structures */ /* fill required data structures */
strcpy(chip->c.name,desc->name); strcpy(chip->c.name,desc->name);
chip->type = desc-chiplist; chip->type = desc-chiplist;
chip->shadow.count = desc->registers+1; chip->shadow.count = desc->registers+1;
chip->prevmode = -1; chip->prevmode = -1;
/* register */ /* register */
i2c_attach_client(&chip->c); i2c_attach_client(&chip->c);
......
...@@ -753,7 +753,7 @@ tveeprom_detect_client(struct i2c_adapter *adapter, ...@@ -753,7 +753,7 @@ tveeprom_detect_client(struct i2c_adapter *adapter,
client->driver = &i2c_driver_tveeprom; client->driver = &i2c_driver_tveeprom;
client->flags = I2C_CLIENT_ALLOW_USE; client->flags = I2C_CLIENT_ALLOW_USE;
snprintf(client->name, sizeof(client->name), "tveeprom"); snprintf(client->name, sizeof(client->name), "tveeprom");
i2c_attach_client(client); i2c_attach_client(client);
return 0; return 0;
} }
......
...@@ -32,39 +32,39 @@ ...@@ -32,39 +32,39 @@
typedef enum { typedef enum {
AUDIO_SOURCE_DEMUX, /* Select the demux as the main source */ AUDIO_SOURCE_DEMUX, /* Select the demux as the main source */
AUDIO_SOURCE_MEMORY /* Select internal memory as the main source */ AUDIO_SOURCE_MEMORY /* Select internal memory as the main source */
} audio_stream_source_t; } audio_stream_source_t;
typedef enum { typedef enum {
AUDIO_STOPPED, /* Device is stopped */ AUDIO_STOPPED, /* Device is stopped */
AUDIO_PLAYING, /* Device is currently playing */ AUDIO_PLAYING, /* Device is currently playing */
AUDIO_PAUSED /* Device is paused */ AUDIO_PAUSED /* Device is paused */
} audio_play_state_t; } audio_play_state_t;
typedef enum { typedef enum {
AUDIO_STEREO, AUDIO_STEREO,
AUDIO_MONO_LEFT, AUDIO_MONO_LEFT,
AUDIO_MONO_RIGHT AUDIO_MONO_RIGHT
} audio_channel_select_t; } audio_channel_select_t;
typedef struct audio_mixer { typedef struct audio_mixer {
unsigned int volume_left; unsigned int volume_left;
unsigned int volume_right; unsigned int volume_right;
// what else do we need? bass, pass-through, ... // what else do we need? bass, pass-through, ...
} audio_mixer_t; } audio_mixer_t;
typedef struct audio_status { typedef struct audio_status {
int AV_sync_state; /* sync audio and video? */ int AV_sync_state; /* sync audio and video? */
int mute_state; /* audio is muted */ int mute_state; /* audio is muted */
audio_play_state_t play_state; /* current playback state */ audio_play_state_t play_state; /* current playback state */
audio_stream_source_t stream_source; /* current stream source */ audio_stream_source_t stream_source; /* current stream source */
audio_channel_select_t channel_select; /* currently selected channel */ audio_channel_select_t channel_select; /* currently selected channel */
int bypass_mode; /* pass on audio data to */ int bypass_mode; /* pass on audio data to */
audio_mixer_t mixer_state; /* current mixer state */ audio_mixer_t mixer_state; /* current mixer state */
} audio_status_t; /* separate decoder hardware */ } audio_status_t; /* separate decoder hardware */
...@@ -74,8 +74,8 @@ struct audio_karaoke{ /* if Vocal1 or Vocal2 are non-zero, they get mixed */ ...@@ -74,8 +74,8 @@ struct audio_karaoke{ /* if Vocal1 or Vocal2 are non-zero, they get mixed */
int vocal1; /* into left and right t at 70% each */ int vocal1; /* into left and right t at 70% each */
int vocal2; /* if both, Vocal1 and Vocal2 are non-zero, Vocal1 gets*/ int vocal2; /* if both, Vocal1 and Vocal2 are non-zero, Vocal1 gets*/
int melody; /* mixed into the left channel and */ int melody; /* mixed into the left channel and */
/* Vocal2 into the right channel at 100% each. */ /* Vocal2 into the right channel at 100% each. */
/* if Melody is non-zero, the melody channel gets mixed*/ /* if Melody is non-zero, the melody channel gets mixed*/
} audio_karaoke_t; /* into left and right */ } audio_karaoke_t; /* into left and right */
......
...@@ -27,16 +27,16 @@ ...@@ -27,16 +27,16 @@
/* slot interface types and info */ /* slot interface types and info */
typedef struct ca_slot_info { typedef struct ca_slot_info {
int num; /* slot number */ int num; /* slot number */
int type; /* CA interface this slot supports */ int type; /* CA interface this slot supports */
#define CA_CI 1 /* CI high level interface */ #define CA_CI 1 /* CI high level interface */
#define CA_CI_LINK 2 /* CI link layer level interface */ #define CA_CI_LINK 2 /* CI link layer level interface */
#define CA_CI_PHYS 4 /* CI physical layer level interface */ #define CA_CI_PHYS 4 /* CI physical layer level interface */
#define CA_DESCR 8 /* built-in descrambler */ #define CA_DESCR 8 /* built-in descrambler */
#define CA_SC 128 /* simple smart card interface */ #define CA_SC 128 /* simple smart card interface */
unsigned int flags; unsigned int flags;
#define CA_CI_MODULE_PRESENT 1 /* module (or card) inserted */ #define CA_CI_MODULE_PRESENT 1 /* module (or card) inserted */
#define CA_CI_MODULE_READY 2 #define CA_CI_MODULE_READY 2
} ca_slot_info_t; } ca_slot_info_t;
...@@ -45,37 +45,37 @@ typedef struct ca_slot_info { ...@@ -45,37 +45,37 @@ typedef struct ca_slot_info {
/* descrambler types and info */ /* descrambler types and info */
typedef struct ca_descr_info { typedef struct ca_descr_info {
unsigned int num; /* number of available descramblers (keys) */ unsigned int num; /* number of available descramblers (keys) */
unsigned int type; /* type of supported scrambling system */ unsigned int type; /* type of supported scrambling system */
#define CA_ECD 1 #define CA_ECD 1
#define CA_NDS 2 #define CA_NDS 2
#define CA_DSS 4 #define CA_DSS 4
} ca_descr_info_t; } ca_descr_info_t;
typedef struct ca_caps { typedef struct ca_caps {
unsigned int slot_num; /* total number of CA card and module slots */ unsigned int slot_num; /* total number of CA card and module slots */
unsigned int slot_type; /* OR of all supported types */ unsigned int slot_type; /* OR of all supported types */
unsigned int descr_num; /* total number of descrambler slots (keys) */ unsigned int descr_num; /* total number of descrambler slots (keys) */
unsigned int descr_type; /* OR of all supported types */ unsigned int descr_type; /* OR of all supported types */
} ca_caps_t; } ca_caps_t;
/* a message to/from a CI-CAM */ /* a message to/from a CI-CAM */
typedef struct ca_msg { typedef struct ca_msg {
unsigned int index; unsigned int index;
unsigned int type; unsigned int type;
unsigned int length; unsigned int length;
unsigned char msg[256]; unsigned char msg[256];
} ca_msg_t; } ca_msg_t;
typedef struct ca_descr { typedef struct ca_descr {
unsigned int index; unsigned int index;
unsigned int parity; /* 0 == even, 1 == odd */ unsigned int parity; /* 0 == even, 1 == odd */
unsigned char cw[8]; unsigned char cw[8];
} ca_descr_t; } ca_descr_t;
typedef struct ca_pid { typedef struct ca_pid {
unsigned int pid; unsigned int pid;
int index; /* -1 == disable*/ int index; /* -1 == disable*/
} ca_pid_t; } ca_pid_t;
#define CA_RESET _IO('o', 128) #define CA_RESET _IO('o', 128)
......
/* /*
* dmx.h * dmx.h
* *
* Copyright (C) 2000 Marcus Metzler <marcus@convergence.de> * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
...@@ -38,10 +38,10 @@ typedef enum ...@@ -38,10 +38,10 @@ typedef enum
{ {
DMX_OUT_DECODER, /* Streaming directly to decoder. */ DMX_OUT_DECODER, /* Streaming directly to decoder. */
DMX_OUT_TAP, /* Output going to a memory buffer */ DMX_OUT_TAP, /* Output going to a memory buffer */
/* (to be retrieved via the read command).*/ /* (to be retrieved via the read command).*/
DMX_OUT_TS_TAP /* Output multiplexed into a new TS */ DMX_OUT_TS_TAP /* Output multiplexed into a new TS */
/* (to be retrieved by reading from the */ /* (to be retrieved by reading from the */
/* logical DVR device). */ /* logical DVR device). */
} dmx_output_t; } dmx_output_t;
...@@ -54,25 +54,25 @@ typedef enum ...@@ -54,25 +54,25 @@ typedef enum
typedef enum typedef enum
{ {
DMX_PES_AUDIO0, DMX_PES_AUDIO0,
DMX_PES_VIDEO0, DMX_PES_VIDEO0,
DMX_PES_TELETEXT0, DMX_PES_TELETEXT0,
DMX_PES_SUBTITLE0, DMX_PES_SUBTITLE0,
DMX_PES_PCR0, DMX_PES_PCR0,
DMX_PES_AUDIO1, DMX_PES_AUDIO1,
DMX_PES_VIDEO1, DMX_PES_VIDEO1,
DMX_PES_TELETEXT1, DMX_PES_TELETEXT1,
DMX_PES_SUBTITLE1, DMX_PES_SUBTITLE1,
DMX_PES_PCR1, DMX_PES_PCR1,
DMX_PES_AUDIO2, DMX_PES_AUDIO2,
DMX_PES_VIDEO2, DMX_PES_VIDEO2,
DMX_PES_TELETEXT2, DMX_PES_TELETEXT2,
DMX_PES_SUBTITLE2, DMX_PES_SUBTITLE2,
DMX_PES_PCR2, DMX_PES_PCR2,
DMX_PES_AUDIO3, DMX_PES_AUDIO3,
DMX_PES_VIDEO3, DMX_PES_VIDEO3,
DMX_PES_TELETEXT3, DMX_PES_TELETEXT3,
DMX_PES_SUBTITLE3, DMX_PES_SUBTITLE3,
...@@ -90,8 +90,8 @@ typedef enum ...@@ -90,8 +90,8 @@ typedef enum
typedef enum typedef enum
{ {
DMX_SCRAMBLING_EV, DMX_SCRAMBLING_EV,
DMX_FRONTEND_EV DMX_FRONTEND_EV
} dmx_event_t; } dmx_event_t;
......
...@@ -98,43 +98,43 @@ typedef enum { ...@@ -98,43 +98,43 @@ typedef enum {
} OSD_Command; } OSD_Command;
typedef struct osd_cmd_s { typedef struct osd_cmd_s {
OSD_Command cmd; OSD_Command cmd;
int x0; int x0;
int y0; int y0;
int x1; int x1;
int y1; int y1;
int color; int color;
void __user *data; void __user *data;
} osd_cmd_t; } osd_cmd_t;
/* OSD_OpenRaw: set 'color' to desired window type */ /* OSD_OpenRaw: set 'color' to desired window type */
typedef enum { typedef enum {
OSD_BITMAP1, /* 1 bit bitmap */ OSD_BITMAP1, /* 1 bit bitmap */
OSD_BITMAP2, /* 2 bit bitmap */ OSD_BITMAP2, /* 2 bit bitmap */
OSD_BITMAP4, /* 4 bit bitmap */ OSD_BITMAP4, /* 4 bit bitmap */
OSD_BITMAP8, /* 8 bit bitmap */ OSD_BITMAP8, /* 8 bit bitmap */
OSD_BITMAP1HR, /* 1 Bit bitmap half resolution */ OSD_BITMAP1HR, /* 1 Bit bitmap half resolution */
OSD_BITMAP2HR, /* 2 bit bitmap half resolution */ OSD_BITMAP2HR, /* 2 bit bitmap half resolution */
OSD_BITMAP4HR, /* 4 bit bitmap half resolution */ OSD_BITMAP4HR, /* 4 bit bitmap half resolution */
OSD_BITMAP8HR, /* 8 bit bitmap half resolution */ OSD_BITMAP8HR, /* 8 bit bitmap half resolution */
OSD_YCRCB422, /* 4:2:2 YCRCB Graphic Display */ OSD_YCRCB422, /* 4:2:2 YCRCB Graphic Display */
OSD_YCRCB444, /* 4:4:4 YCRCB Graphic Display */ OSD_YCRCB444, /* 4:4:4 YCRCB Graphic Display */
OSD_YCRCB444HR, /* 4:4:4 YCRCB graphic half resolution */ OSD_YCRCB444HR, /* 4:4:4 YCRCB graphic half resolution */
OSD_VIDEOTSIZE, /* True Size Normal MPEG Video Display */ OSD_VIDEOTSIZE, /* True Size Normal MPEG Video Display */
OSD_VIDEOHSIZE, /* MPEG Video Display Half Resolution */ OSD_VIDEOHSIZE, /* MPEG Video Display Half Resolution */
OSD_VIDEOQSIZE, /* MPEG Video Display Quarter Resolution */ OSD_VIDEOQSIZE, /* MPEG Video Display Quarter Resolution */
OSD_VIDEODSIZE, /* MPEG Video Display Double Resolution */ OSD_VIDEODSIZE, /* MPEG Video Display Double Resolution */
OSD_VIDEOTHSIZE, /* True Size MPEG Video Display Half Resolution */ OSD_VIDEOTHSIZE, /* True Size MPEG Video Display Half Resolution */
OSD_VIDEOTQSIZE, /* True Size MPEG Video Display Quarter Resolution*/ OSD_VIDEOTQSIZE, /* True Size MPEG Video Display Quarter Resolution*/
OSD_VIDEOTDSIZE, /* True Size MPEG Video Display Double Resolution */ OSD_VIDEOTDSIZE, /* True Size MPEG Video Display Double Resolution */
OSD_VIDEONSIZE, /* Full Size MPEG Video Display */ OSD_VIDEONSIZE, /* Full Size MPEG Video Display */
OSD_CURSOR /* Cursor */ OSD_CURSOR /* Cursor */
} osd_raw_window_t; } osd_raw_window_t;
typedef struct osd_cap_s { typedef struct osd_cap_s {
int cmd; int cmd;
#define OSD_CAP_MEMSIZE 1 /* memory size */ #define OSD_CAP_MEMSIZE 1 /* memory size */
long val; long val;
} osd_cap_t; } osd_cap_t;
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
typedef enum { typedef enum {
VIDEO_FORMAT_4_3, /* Select 4:3 format */ VIDEO_FORMAT_4_3, /* Select 4:3 format */
VIDEO_FORMAT_16_9, /* Select 16:9 format. */ VIDEO_FORMAT_16_9, /* Select 16:9 format. */
VIDEO_FORMAT_221_1 /* 2.21:1 */ VIDEO_FORMAT_221_1 /* 2.21:1 */
} video_format_t; } video_format_t;
...@@ -54,7 +54,7 @@ typedef enum { ...@@ -54,7 +54,7 @@ typedef enum {
typedef enum { typedef enum {
VIDEO_PAN_SCAN, /* use pan and scan format */ VIDEO_PAN_SCAN, /* use pan and scan format */
VIDEO_LETTER_BOX, /* use letterbox format */ VIDEO_LETTER_BOX, /* use letterbox format */
VIDEO_CENTER_CUT_OUT /* use center cut out format */ VIDEO_CENTER_CUT_OUT /* use center cut out format */
} video_displayformat_t; } video_displayformat_t;
...@@ -66,7 +66,7 @@ typedef struct { ...@@ -66,7 +66,7 @@ typedef struct {
} video_size_t; } video_size_t;
typedef enum { typedef enum {
VIDEO_SOURCE_DEMUX, /* Select the demux as the main source */ VIDEO_SOURCE_DEMUX, /* Select the demux as the main source */
VIDEO_SOURCE_MEMORY /* If this source is selected, the stream VIDEO_SOURCE_MEMORY /* If this source is selected, the stream
comes from the user through the write comes from the user through the write
system call */ system call */
...@@ -75,35 +75,35 @@ typedef enum { ...@@ -75,35 +75,35 @@ typedef enum {
typedef enum { typedef enum {
VIDEO_STOPPED, /* Video is stopped */ VIDEO_STOPPED, /* Video is stopped */
VIDEO_PLAYING, /* Video is currently playing */ VIDEO_PLAYING, /* Video is currently playing */
VIDEO_FREEZED /* Video is freezed */ VIDEO_FREEZED /* Video is freezed */
} video_play_state_t; } video_play_state_t;
struct video_event { struct video_event {
int32_t type; int32_t type;
#define VIDEO_EVENT_SIZE_CHANGED 1 #define VIDEO_EVENT_SIZE_CHANGED 1
#define VIDEO_EVENT_FRAME_RATE_CHANGED 2 #define VIDEO_EVENT_FRAME_RATE_CHANGED 2
time_t timestamp; time_t timestamp;
union { union {
video_size_t size; video_size_t size;
unsigned int frame_rate; /* in frames per 1000sec */ unsigned int frame_rate; /* in frames per 1000sec */
} u; } u;
}; };
struct video_status { struct video_status {
int video_blank; /* blank video on freeze? */ int video_blank; /* blank video on freeze? */
video_play_state_t play_state; /* current state of playback */ video_play_state_t play_state; /* current state of playback */
video_stream_source_t stream_source; /* current source (demux/memory) */ video_stream_source_t stream_source; /* current source (demux/memory) */
video_format_t video_format; /* current aspect ratio of stream*/ video_format_t video_format; /* current aspect ratio of stream*/
video_displayformat_t display_format;/* selected cropping mode */ video_displayformat_t display_format;/* selected cropping mode */
}; };
struct video_still_picture { struct video_still_picture {
char __user *iFrame; /* pointer to a single iframe in memory */ char __user *iFrame; /* pointer to a single iframe in memory */
int32_t size; int32_t size;
}; };
...@@ -111,19 +111,19 @@ typedef ...@@ -111,19 +111,19 @@ typedef
struct video_highlight { struct video_highlight {
int active; /* 1=show highlight, 0=hide highlight */ int active; /* 1=show highlight, 0=hide highlight */
uint8_t contrast1; /* 7- 4 Pattern pixel contrast */ uint8_t contrast1; /* 7- 4 Pattern pixel contrast */
/* 3- 0 Background pixel contrast */ /* 3- 0 Background pixel contrast */
uint8_t contrast2; /* 7- 4 Emphasis pixel-2 contrast */ uint8_t contrast2; /* 7- 4 Emphasis pixel-2 contrast */
/* 3- 0 Emphasis pixel-1 contrast */ /* 3- 0 Emphasis pixel-1 contrast */
uint8_t color1; /* 7- 4 Pattern pixel color */ uint8_t color1; /* 7- 4 Pattern pixel color */
/* 3- 0 Background pixel color */ /* 3- 0 Background pixel color */
uint8_t color2; /* 7- 4 Emphasis pixel-2 color */ uint8_t color2; /* 7- 4 Emphasis pixel-2 color */
/* 3- 0 Emphasis pixel-1 color */ /* 3- 0 Emphasis pixel-1 color */
uint32_t ypos; /* 23-22 auto action mode */ uint32_t ypos; /* 23-22 auto action mode */
/* 21-12 start y */ /* 21-12 start y */
/* 9- 0 end y */ /* 9- 0 end y */
uint32_t xpos; /* 23-22 button color number */ uint32_t xpos; /* 23-22 button color number */
/* 21-12 start x */ /* 21-12 start x */
/* 9- 0 end x */ /* 9- 0 end x */
} video_highlight_t; } video_highlight_t;
......
...@@ -112,7 +112,7 @@ struct saa7146_dev ...@@ -112,7 +112,7 @@ struct saa7146_dev
/* different device locks */ /* different device locks */
spinlock_t slock; spinlock_t slock;
struct semaphore lock; struct semaphore lock;
unsigned char __iomem *mem; /* pointer to mapped IO memory */ unsigned char __iomem *mem; /* pointer to mapped IO memory */
int revision; /* chip revision; needed for bug-workarounds*/ int revision; /* chip revision; needed for bug-workarounds*/
...@@ -133,7 +133,7 @@ struct saa7146_dev ...@@ -133,7 +133,7 @@ struct saa7146_dev
void (*vv_callback)(struct saa7146_dev *dev, unsigned long status); void (*vv_callback)(struct saa7146_dev *dev, unsigned long status);
/* i2c-stuff */ /* i2c-stuff */
struct semaphore i2c_lock; struct semaphore i2c_lock;
u32 i2c_bitrate; u32 i2c_bitrate;
struct saa7146_dma d_i2c; /* pointer to i2c memory */ struct saa7146_dma d_i2c; /* pointer to i2c memory */
wait_queue_head_t i2c_wq; wait_queue_head_t i2c_wq;
......
...@@ -113,7 +113,7 @@ struct saa7146_vv ...@@ -113,7 +113,7 @@ struct saa7146_vv
/* vbi capture */ /* vbi capture */
struct saa7146_dmaqueue vbi_q; struct saa7146_dmaqueue vbi_q;
/* vbi workaround interrupt queue */ /* vbi workaround interrupt queue */
wait_queue_head_t vbi_wq; wait_queue_head_t vbi_wq;
int vbi_fieldcount; int vbi_fieldcount;
struct saa7146_fh *vbi_streaming; struct saa7146_fh *vbi_streaming;
...@@ -181,10 +181,10 @@ struct saa7146_ext_vv ...@@ -181,10 +181,10 @@ struct saa7146_ext_vv
}; };
struct saa7146_use_ops { struct saa7146_use_ops {
void (*init)(struct saa7146_dev *, struct saa7146_vv *); void (*init)(struct saa7146_dev *, struct saa7146_vv *);
int(*open)(struct saa7146_dev *, struct file *); int(*open)(struct saa7146_dev *, struct file *);
void (*release)(struct saa7146_dev *, struct file *); void (*release)(struct saa7146_dev *, struct file *);
void (*irq_done)(struct saa7146_dev *, unsigned long status); void (*irq_done)(struct saa7146_dev *, unsigned long status);
ssize_t (*read)(struct file *, char __user *, size_t, loff_t *); ssize_t (*read)(struct file *, char __user *, size_t, loff_t *);
}; };
......
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