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