提交 bb4c9a74 编写于 作者: M Mauro Carvalho Chehab

V4L/DVB (12732): cx25821: fix bad whitespacing

Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 466a1c15
......@@ -15,7 +15,7 @@ config VIDEO_CX25821
To compile this driver as a module, choose M here: the
module will be called cx25821
config VIDEO_CX25821_ALSA
tristate "Conexant 25821 DMA audio support"
depends on VIDEO_CX25821 && SND && EXPERIMENTAL
......@@ -30,5 +30,5 @@ config VIDEO_CX25821_ALSA
PCI device.
To compile this driver as a module, choose M here: the
module will be called cx25821-alsa.
module will be called cx25821-alsa.
......@@ -72,7 +72,7 @@ struct cx25821_audio_dev {
unsigned long iobase;
spinlock_t reg_lock;
atomic_t count;
atomic_t count;
unsigned int dma_size;
unsigned int period_size;
......
/*
* Driver for the Conexant CX25821 PCIe bridge
*
* Copyright (C) 2009 Conexant Systems Inc.
* Copyright (C) 2009 Conexant Systems Inc.
* Authors <shu.lin@conexant.com>, <hiep.huynh@conexant.com>
* Based on Steven Toth <stoth@linuxtv.org> cx23885 driver
*
......@@ -40,37 +40,37 @@ static void buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb)
dprintk(2, "jmp to stopper (0x%x)\n", buf->risc.jmp[1]);
if (!list_empty(&q->queued)) {
list_add_tail(&buf->vb.queue, &q->queued);
buf->vb.state = VIDEOBUF_QUEUED;
dprintk(2, "[%p/%d] buffer_queue - append to queued\n", buf, buf->vb.i);
list_add_tail(&buf->vb.queue, &q->queued);
buf->vb.state = VIDEOBUF_QUEUED;
dprintk(2, "[%p/%d] buffer_queue - append to queued\n", buf, buf->vb.i);
} else if (list_empty(&q->active)) {
list_add_tail(&buf->vb.queue, &q->active);
cx25821_start_video_dma(dev, q, buf, &dev->sram_channels[SRAM_CH11]);
buf->vb.state = VIDEOBUF_ACTIVE;
buf->count = q->count++;
mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT);
dprintk(2, "[%p/%d] buffer_queue - first active, buf cnt = %d, q->count = %d\n",
buf, buf->vb. i, buf->count, q->count);
list_add_tail(&buf->vb.queue, &q->active);
cx25821_start_video_dma(dev, q, buf, &dev->sram_channels[SRAM_CH11]);
buf->vb.state = VIDEOBUF_ACTIVE;
buf->count = q->count++;
mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT);
dprintk(2, "[%p/%d] buffer_queue - first active, buf cnt = %d, q->count = %d\n",
buf, buf->vb. i, buf->count, q->count);
} else {
prev = list_entry(q->active.prev, struct cx25821_buffer, vb.queue);
if (prev->vb.width == buf->vb.width &&
prev->vb.height == buf->vb.height &&
prev->fmt == buf->fmt) {
list_add_tail(&buf->vb.queue, &q->active);
buf->vb.state = VIDEOBUF_ACTIVE;
buf->count = q->count++;
prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma);
/* 64 bit bits 63-32 */
prev->risc.jmp[2] = cpu_to_le32(0);
dprintk(2, "[%p/%d] buffer_queue - append to active, buf->count=%d\n", buf, buf->vb.i, buf->count);
} else {
list_add_tail(&buf->vb.queue, &q->queued);
buf->vb.state = VIDEOBUF_QUEUED;
dprintk(2, "[%p/%d] buffer_queue - first queued\n", buf, buf->vb.i);
}
prev = list_entry(q->active.prev, struct cx25821_buffer, vb.queue);
if (prev->vb.width == buf->vb.width &&
prev->vb.height == buf->vb.height &&
prev->fmt == buf->fmt) {
list_add_tail(&buf->vb.queue, &q->active);
buf->vb.state = VIDEOBUF_ACTIVE;
buf->count = q->count++;
prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma);
/* 64 bit bits 63-32 */
prev->risc.jmp[2] = cpu_to_le32(0);
dprintk(2, "[%p/%d] buffer_queue - append to active, buf->count=%d\n", buf, buf->vb.i, buf->count);
} else {
list_add_tail(&buf->vb.queue, &q->queued);
buf->vb.state = VIDEOBUF_QUEUED;
dprintk(2, "[%p/%d] buffer_queue - first queued\n", buf, buf->vb.i);
}
}
if (list_empty(&q->active))
......@@ -99,18 +99,18 @@ static int video_open(struct file *file)
lock_kernel();
list_for_each(list, &cx25821_devlist)
{
h = list_entry(list, struct cx25821_dev, devlist);
h = list_entry(list, struct cx25821_dev, devlist);
if (h->video_dev[SRAM_CH11] && h->video_dev[SRAM_CH11]->minor == minor)
{
dev = h;
type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
}
if (h->video_dev[SRAM_CH11] && h->video_dev[SRAM_CH11]->minor == minor)
{
dev = h;
type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
}
}
if (NULL == dev) {
unlock_kernel();
return -ENODEV;
unlock_kernel();
return -ENODEV;
}
printk("open minor=%d type=%s\n", minor, v4l2_type_names[type]);
......@@ -118,8 +118,8 @@ static int video_open(struct file *file)
/* allocate + initialize per filehandle data */
fh = kzalloc(sizeof(*fh), GFP_KERNEL);
if (NULL == fh) {
unlock_kernel();
return -ENOMEM;
unlock_kernel();
return -ENOMEM;
}
file->private_data = fh;
......@@ -128,21 +128,21 @@ static int video_open(struct file *file)
fh->width = 720;
if(dev->tvnorm & V4L2_STD_PAL_BG || dev->tvnorm & V4L2_STD_PAL_DK)
fh->height = 576;
fh->height = 576;
else
fh->height = 480;
fh->height = 480;
dev->channel_opened = 10;
fh->fmt = format_by_fourcc(V4L2_PIX_FMT_YUYV);
v4l2_prio_open(&dev->prio,&fh->prio);
videobuf_queue_sg_init(&fh->vidq, &cx25821_video_qops,
&dev->pci->dev, &dev->slock,
V4L2_BUF_TYPE_VIDEO_CAPTURE,
V4L2_FIELD_INTERLACED,
sizeof(struct cx25821_buffer),
fh);
&dev->pci->dev, &dev->slock,
V4L2_BUF_TYPE_VIDEO_CAPTURE,
V4L2_FIELD_INTERLACED,
sizeof(struct cx25821_buffer),
fh);
dprintk(1, "post videobuf_queue_init()\n");
unlock_kernel();
......@@ -156,15 +156,15 @@ static ssize_t video_read(struct file *file, char __user *data, size_t count, lo
switch (fh->type)
{
case V4L2_BUF_TYPE_VIDEO_CAPTURE:
if (res_locked(fh->dev, RESOURCE_VIDEO11))
return -EBUSY;
case V4L2_BUF_TYPE_VIDEO_CAPTURE:
if (res_locked(fh->dev, RESOURCE_VIDEO11))
return -EBUSY;
return videobuf_read_one(&fh->vidq, data, count, ppos, file->f_flags & O_NONBLOCK);
return videobuf_read_one(&fh->vidq, data, count, ppos, file->f_flags & O_NONBLOCK);
default:
BUG();
return 0;
default:
BUG();
return 0;
}
}
......@@ -174,21 +174,21 @@ static unsigned int video_poll(struct file *file, struct poll_table_struct *wait
struct cx25821_buffer *buf;
if (res_check(fh, RESOURCE_VIDEO11)) {
/* streaming capture */
if (list_empty(&fh->vidq.stream))
return POLLERR;
buf = list_entry(fh->vidq.stream.next,
struct cx25821_buffer, vb.stream);
/* streaming capture */
if (list_empty(&fh->vidq.stream))
return POLLERR;
buf = list_entry(fh->vidq.stream.next,
struct cx25821_buffer, vb.stream);
} else {
/* read() capture */
buf = (struct cx25821_buffer *)fh->vidq.read_buf;
if (NULL == buf)
return POLLERR;
/* read() capture */
buf = (struct cx25821_buffer *)fh->vidq.read_buf;
if (NULL == buf)
return POLLERR;
}
poll_wait(file, &buf->vb.done, wait);
if (buf->vb.state == VIDEOBUF_DONE || buf->vb.state == VIDEOBUF_ERROR)
return POLLIN|POLLRDNORM;
return POLLIN|POLLRDNORM;
return 0;
}
......@@ -199,17 +199,17 @@ static int video_release(struct file *file)
struct cx25821_dev *dev = fh->dev;
//stop the risc engine and fifo
//cx_write(channel11->dma_ctl, 0);
//cx_write(channel11->dma_ctl, 0);
/* stop video capture */
if (res_check(fh, RESOURCE_VIDEO11)) {
videobuf_queue_cancel(&fh->vidq);
res_free(dev, fh, RESOURCE_VIDEO11);
videobuf_queue_cancel(&fh->vidq);
res_free(dev, fh, RESOURCE_VIDEO11);
}
if (fh->vidq.read_buf) {
buffer_release(&fh->vidq, fh->vidq.read_buf);
kfree(fh->vidq.read_buf);
buffer_release(&fh->vidq, fh->vidq.read_buf);
kfree(fh->vidq.read_buf);
}
videobuf_mmap_free(&fh->vidq);
......@@ -230,17 +230,17 @@ static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i)
if (unlikely(fh->type != V4L2_BUF_TYPE_VIDEO_CAPTURE))
{
return -EINVAL;
return -EINVAL;
}
if (unlikely(i != fh->type))
{
return -EINVAL;
return -EINVAL;
}
if (unlikely(!res_get(dev, fh, get_resource(fh, RESOURCE_VIDEO11))))
{
return -EBUSY;
return -EBUSY;
}
return videobuf_streamon(get_queue(fh));
......@@ -253,14 +253,14 @@ static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type i)
int err, res;
if (fh->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;
return -EINVAL;
if (i != fh->type)
return -EINVAL;
return -EINVAL;
res = get_resource(fh, RESOURCE_VIDEO11);
err = videobuf_streamoff(get_queue(fh));
if (err < 0)
return err;
return err;
res_free(dev, fh, res);
return 0;
}
......@@ -272,18 +272,18 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, struct v4l2_forma
struct cx25821_dev *dev = ((struct cx25821_fh *)priv)->dev;
int err;
if (fh)
if (fh)
{
err = v4l2_prio_check(&dev->prio, &fh->prio);
if (0 != err)
return err;
err = v4l2_prio_check(&dev->prio, &fh->prio);
if (0 != err)
return err;
}
dprintk(2, "%s()\n", __func__);
err = vidioc_try_fmt_vid_cap(file, priv, f);
if (0 != err)
return err;
return err;
fh->fmt = format_by_fourcc(f->fmt.pix.pixelformat);
fh->width = f->fmt.pix.width;
fh->height = f->fmt.pix.height;
......@@ -293,30 +293,30 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, struct v4l2_forma
return 0;
}
static long video_ioctl_upstream11(struct file *file, unsigned int cmd, unsigned long arg)
{
static long video_ioctl_upstream11(struct file *file, unsigned int cmd, unsigned long arg)
{
struct cx25821_fh *fh = file->private_data;
struct cx25821_dev *dev = fh->dev;
int command = 0;
struct upstream_user_struct *data_from_user;
data_from_user = (struct upstream_user_struct *)arg;
if( !data_from_user )
{
printk("cx25821 in %s(): Upstream data is INVALID. Returning.\n", __func__);
return 0;
printk("cx25821 in %s(): Upstream data is INVALID. Returning.\n", __func__);
return 0;
}
command = data_from_user->command;
if( command != UPSTREAM_START_AUDIO && command != UPSTREAM_STOP_AUDIO )
{
return 0;
return 0;
}
dev->input_filename = data_from_user->input_filename;
dev->input_audiofilename = data_from_user->input_filename;
dev->vid_stdname = data_from_user->vid_stdname;
......@@ -324,18 +324,18 @@ static long video_ioctl_upstream11(struct file *file, unsigned int cmd, unsigned
dev->channel_select = data_from_user->channel_select;
dev->command = data_from_user->command;
switch(command)
{
case UPSTREAM_START_AUDIO:
cx25821_start_upstream_audio(dev, data_from_user);
break;
case UPSTREAM_STOP_AUDIO:
cx25821_stop_upstream_audio(dev);
break;
{
case UPSTREAM_START_AUDIO:
cx25821_start_upstream_audio(dev, data_from_user);
break;
case UPSTREAM_STOP_AUDIO:
cx25821_stop_upstream_audio(dev);
break;
}
return 0;
}
......@@ -366,11 +366,11 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
struct cx25821_dev *dev = fh->dev;
int err;
if (fh)
if (fh)
{
err = v4l2_prio_check(&dev->prio, &fh->prio);
if (0 != err)
return err;
err = v4l2_prio_check(&dev->prio, &fh->prio);
if (0 != err)
return err;
}
return 0;
}
......@@ -382,7 +382,7 @@ static const struct v4l2_file_operations video_fops = {
.read = video_read,
.poll = video_poll,
.mmap = video_mmap,
.ioctl = video_ioctl_upstream11,
.ioctl = video_ioctl_upstream11,
};
static const struct v4l2_ioctl_ops video_ioctl_ops = {
......
......@@ -30,12 +30,12 @@
#include "cx25821.h"
#include "tuner-xc2028.h"
// board config info
// board config info
struct cx25821_board cx25821_boards[] = {
[UNKNOWN_BOARD] = {
.name = "UNKNOWN/GENERIC",
// Ensure safe default for unknown boards
// Ensure safe default for unknown boards
.clk_freq = 0,
},
......@@ -43,8 +43,8 @@ struct cx25821_board cx25821_boards[] = {
.name = "CX25821",
.portb = CX25821_RAW,
.portc = CX25821_264,
.input[0].type = CX25821_VMUX_COMPOSITE,
},
.input[0].type = CX25821_VMUX_COMPOSITE,
},
};
......@@ -63,7 +63,7 @@ void cx25821_card_setup(struct cx25821_dev *dev)
{
static u8 eeprom[256];
if (dev->i2c_bus[0].i2c_rc == 0)
if (dev->i2c_bus[0].i2c_rc == 0)
{
dev->i2c_bus[0].i2c_client.addr = 0xa0 >> 1;
tveeprom_read(&dev->i2c_bus[0].i2c_client, eeprom, sizeof(eeprom));
......
......@@ -25,17 +25,17 @@
/********************* GPIO stuffs *********************/
void cx25821_set_gpiopin_direction( struct cx25821_dev *dev,
int pin_number,
int pin_logic_value)
int pin_number,
int pin_logic_value)
{
int bit = pin_number;
u32 gpio_oe_reg = GPIO_LO_OE;
u32 gpio_register = 0;
u32 value = 0;
// Check for valid pinNumber
if ( pin_number >= 47 )
return;
return;
if ( pin_number > 31 )
......@@ -46,32 +46,32 @@ void cx25821_set_gpiopin_direction( struct cx25821_dev *dev,
// Here we will make sure that the GPIOs 0 and 1 are output. keep the rest as is
gpio_register = cx_read( gpio_oe_reg );
if (pin_logic_value == 1)
{
value = gpio_register | Set_GPIO_Bit(bit) ;
value = gpio_register | Set_GPIO_Bit(bit) ;
}
else
{
value = gpio_register & Clear_GPIO_Bit(bit) ;
value = gpio_register & Clear_GPIO_Bit(bit) ;
}
cx_write( gpio_oe_reg, value );
}
static void cx25821_set_gpiopin_logicvalue( struct cx25821_dev *dev,
int pin_number,
int pin_logic_value)
{
int pin_number,
int pin_logic_value)
{
int bit = pin_number;
u32 gpio_reg = GPIO_LO;
u32 value = 0;
// Check for valid pinNumber
if (pin_number >= 47)
return;
return;
cx25821_set_gpiopin_direction(dev, pin_number, 0); // change to output direction
......@@ -82,15 +82,15 @@ static void cx25821_set_gpiopin_logicvalue( struct cx25821_dev *dev,
}
value = cx_read( gpio_reg );
if (pin_logic_value == 0)
{
value &= Clear_GPIO_Bit(bit);
value &= Clear_GPIO_Bit(bit);
}
else
{
value |= Set_GPIO_Bit(bit);
value |= Set_GPIO_Bit(bit);
}
cx_write( gpio_reg, value);
......@@ -102,15 +102,15 @@ void cx25821_gpio_init(struct cx25821_dev *dev)
{
return;
}
switch (dev->board)
switch (dev->board)
{
case CX25821_BOARD_CONEXANT_ATHENA10:
default:
//set GPIO 5 to select the path for Medusa/Athena
cx25821_set_gpiopin_logicvalue(dev, 5, 1);
case CX25821_BOARD_CONEXANT_ATHENA10:
default:
//set GPIO 5 to select the path for Medusa/Athena
cx25821_set_gpiopin_logicvalue(dev, 5, 1);
mdelay(20);
break;
}
}
......@@ -88,9 +88,9 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap, const struct i2c_msg *msg
dprintk(1, "%s(msg->len=%d)\n", __func__, msg->len);
/* Deal with i2c probe functions with zero payload */
if (msg->len == 0)
if (msg->len == 0)
{
cx_write(bus->reg_addr, msg->addr << 25);
cx_write(bus->reg_addr, msg->addr << 25);
cx_write(bus->reg_ctrl, bus->i2c_period | (1 << 2));
if (!i2c_wait_done(i2c_adap))
......@@ -106,7 +106,7 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap, const struct i2c_msg *msg
/* dev, reg + first byte */
addr = (msg->addr << 25) | msg->buf[0];
wdata = msg->buf[0];
ctrl = bus->i2c_period | (1 << 12) | (1 << 2);
if (msg->len > 1)
......@@ -125,7 +125,7 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap, const struct i2c_msg *msg
if (retval == 0)
goto eio;
if (i2c_debug)
if (i2c_debug)
{
if (!(ctrl & I2C_NOSTOP))
printk(" >\n");
......@@ -152,14 +152,14 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap, const struct i2c_msg *msg
if (retval == 0)
goto eio;
if (i2c_debug)
if (i2c_debug)
{
dprintk(1, " %02x", msg->buf[cnt]);
if (!(ctrl & I2C_NOSTOP))
dprintk(1, " >\n");
}
}
return msg->len;
eio:
......@@ -244,18 +244,18 @@ static int i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num)
dprintk(1, "%s(num = %d)\n", __func__, num);
for (i = 0 ; i < num; i++)
for (i = 0 ; i < num; i++)
{
dprintk(1, "%s(num = %d) addr = 0x%02x len = 0x%x\n",
__func__, num, msgs[i].addr, msgs[i].len);
if (msgs[i].flags & I2C_M_RD)
if (msgs[i].flags & I2C_M_RD)
{
/* read */
retval = i2c_readbytes(i2c_adap, &msgs[i], 0);
}
}
else if (i + 1 < num && (msgs[i + 1].flags & I2C_M_RD) &&
msgs[i].addr == msgs[i + 1].addr)
msgs[i].addr == msgs[i + 1].addr)
{
/* write then read from same address */
retval = i2c_sendbytes(i2c_adap, &msgs[i], msgs[i + 1].len);
......@@ -264,13 +264,13 @@ static int i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num)
goto err;
i++;
retval = i2c_readbytes(i2c_adap, &msgs[i], 1);
}
else
}
else
{
/* write */
retval = i2c_sendbytes(i2c_adap, &msgs[i], 0);
}
if (retval < 0)
goto err;
}
......@@ -283,9 +283,9 @@ static int i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num)
static u32 cx25821_functionality(struct i2c_adapter *adap)
{
return I2C_FUNC_SMBUS_EMUL |
return I2C_FUNC_SMBUS_EMUL |
I2C_FUNC_I2C |
I2C_FUNC_SMBUS_WORD_DATA |
I2C_FUNC_SMBUS_WORD_DATA |
I2C_FUNC_SMBUS_READ_WORD_DATA |
I2C_FUNC_SMBUS_WRITE_WORD_DATA;
}
......@@ -334,7 +334,7 @@ int cx25821_i2c_register(struct cx25821_i2c *bus)
//set up the I2c
bus->i2c_client.addr = (0x88>>1);
return bus->i2c_rc;
}
......@@ -375,19 +375,19 @@ int cx25821_i2c_read(struct cx25821_i2c *bus, u16 reg_addr, int *value)
int v = 0;
u8 addr[2] = {0, 0};
u8 buf[4] = {0,0,0,0};
struct i2c_msg msgs[2]={
{
.addr = client->addr,
.flags = 0,
.len = 2,
.buf = addr,
}, {
.addr = client->addr,
.flags = I2C_M_RD,
.len = 4,
.buf = buf,
}
{
.addr = client->addr,
.flags = 0,
.len = 2,
.buf = addr,
}, {
.addr = client->addr,
.flags = I2C_M_RD,
.len = 4,
.buf = buf,
}
};
......@@ -401,23 +401,23 @@ int cx25821_i2c_read(struct cx25821_i2c *bus, u16 reg_addr, int *value)
v = (buf[3]<<24) | (buf[2]<<16) | (buf[1]<<8) | buf[0];
*value = v;
return v;
return v;
}
int cx25821_i2c_write(struct cx25821_i2c *bus, u16 reg_addr, int value)
{
struct i2c_client *client = &bus->i2c_client;
int retval = 0;
int retval = 0;
u8 buf[6] = {0, 0, 0, 0, 0, 0};
struct i2c_msg msgs[1]={
{
.addr = client->addr,
.flags = 0,
.len = 6,
.buf = buf,
}
{
.addr = client->addr,
.flags = 0,
.len = 6,
.buf = buf,
}
};
......
......@@ -26,7 +26,7 @@
#include "cx25821-medusa-defines.h"
// Color control constants
// Color control constants
#define VIDEO_PROCAMP_MIN 0
#define VIDEO_PROCAMP_MAX 10000
#define UNSIGNED_BYTE_MIN 0
......
......@@ -1481,7 +1481,7 @@
//*****************************************************************************
#define I2C1_ADDR 0x180000 // I2C #1 address
#define FLD_I2C_DADDR 0xfe000000 // RW [31:25] I2C Device Address
// RO [24] reserved
// RO [24] reserved
//*****************************************************************************
#define FLD_I2C_SADDR 0x00FFFFFF // RW [23:0] I2C Sub-address
......@@ -1494,15 +1494,15 @@
#define FLD_I2C_PERIOD 0xFF000000 // RW [31:24]
#define FLD_I2C_SCL_IN 0x00200000 // RW [21]
#define FLD_I2C_SDA_IN 0x00100000 // RW [20]
// RO [19:18] reserved
// RO [19:18] reserved
#define FLD_I2C_SCL_OUT 0x00020000 // RW [17]
#define FLD_I2C_SDA_OUT 0x00010000 // RW [16]
// RO [15] reserved
// RO [15] reserved
#define FLD_I2C_DATA_LEN 0x00007000 // RW [14:12]
#define FLD_I2C_SADDR_INC 0x00000800 // RW [11]
// RO [10:9] reserved
// RO [10:9] reserved
#define FLD_I2C_SADDR_LEN 0x00000300 // RW [9:8]
// RO [7:6] reserved
// RO [7:6] reserved
#define FLD_I2C_SOFT 0x00000020 // RW [5]
#define FLD_I2C_NOSTOP 0x00000010 // RW [4]
#define FLD_I2C_EXTEND 0x00000008 // RW [3]
......@@ -1588,13 +1588,13 @@
//*****************************************************************************
// Motion Detection
#define MD_CH0_GRID_BLOCK_YCNT 0x170014
#define MD_CH1_GRID_BLOCK_YCNT 0x170094
#define MD_CH2_GRID_BLOCK_YCNT 0x170114
#define MD_CH3_GRID_BLOCK_YCNT 0x170194
#define MD_CH4_GRID_BLOCK_YCNT 0x170214
#define MD_CH5_GRID_BLOCK_YCNT 0x170294
#define MD_CH6_GRID_BLOCK_YCNT 0x170314
#define MD_CH0_GRID_BLOCK_YCNT 0x170014
#define MD_CH1_GRID_BLOCK_YCNT 0x170094
#define MD_CH2_GRID_BLOCK_YCNT 0x170114
#define MD_CH3_GRID_BLOCK_YCNT 0x170194
#define MD_CH4_GRID_BLOCK_YCNT 0x170214
#define MD_CH5_GRID_BLOCK_YCNT 0x170294
#define MD_CH6_GRID_BLOCK_YCNT 0x170314
#define MD_CH7_GRID_BLOCK_YCNT 0x170394
#define PIXEL_FRMT_422 4
......
......@@ -71,25 +71,25 @@
#ifdef USE_RISC_NOOP_VIDEO
#define PAL_US_VID_PROG_SIZE ((PAL_FIELD_HEIGHT) * 3 * DWORD_SIZE + RISC_WRITECR_INSTRUCTION_SIZE + \
RISC_SYNC_INSTRUCTION_SIZE + NUM_NO_OPS*DWORD_SIZE)
RISC_SYNC_INSTRUCTION_SIZE + NUM_NO_OPS*DWORD_SIZE)
#define PAL_RISC_BUF_SIZE (2 * PAL_US_VID_PROG_SIZE)
#define PAL_VID_PROG_SIZE ((PAL_FIELD_HEIGHT*2) * 3 * DWORD_SIZE + 2*RISC_SYNC_INSTRUCTION_SIZE + \
RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE + 2*NUM_NO_OPS*DWORD_SIZE)
RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE + 2*NUM_NO_OPS*DWORD_SIZE)
#define ODD_FLD_PAL_PROG_SIZE ((PAL_FIELD_HEIGHT) * 3 * DWORD_SIZE + RISC_SYNC_INSTRUCTION_SIZE + \
RISC_WRITECR_INSTRUCTION_SIZE + NUM_NO_OPS*DWORD_SIZE)
RISC_WRITECR_INSTRUCTION_SIZE + NUM_NO_OPS*DWORD_SIZE)
#define NTSC_US_VID_PROG_SIZE ((NTSC_ODD_FLD_LINES + 1) * 3 * DWORD_SIZE + RISC_WRITECR_INSTRUCTION_SIZE + \
JUMP_INSTRUCTION_SIZE + NUM_NO_OPS*DWORD_SIZE)
JUMP_INSTRUCTION_SIZE + NUM_NO_OPS*DWORD_SIZE)
#define NTSC_RISC_BUF_SIZE (2 * (RISC_SYNC_INSTRUCTION_SIZE + NTSC_US_VID_PROG_SIZE))
#define FRAME1_VID_PROG_SIZE ((NTSC_ODD_FLD_LINES + NTSC_FIELD_HEIGHT) * 3 * DWORD_SIZE + 2*RISC_SYNC_INSTRUCTION_SIZE + \
RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE + 2*NUM_NO_OPS*DWORD_SIZE)
RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE + 2*NUM_NO_OPS*DWORD_SIZE)
#define ODD_FLD_NTSC_PROG_SIZE ((NTSC_ODD_FLD_LINES) * 3 * DWORD_SIZE + RISC_SYNC_INSTRUCTION_SIZE + \
RISC_WRITECR_INSTRUCTION_SIZE + NUM_NO_OPS*DWORD_SIZE)
RISC_WRITECR_INSTRUCTION_SIZE + NUM_NO_OPS*DWORD_SIZE)
#endif
......@@ -97,11 +97,11 @@
#define PAL_US_VID_PROG_SIZE ((PAL_FIELD_HEIGHT + 1) * 3 * DWORD_SIZE + RISC_WRITECR_INSTRUCTION_SIZE )
#define PAL_RISC_BUF_SIZE ( 2 * (RISC_SYNC_INSTRUCTION_SIZE + PAL_US_VID_PROG_SIZE) )
#define PAL_VID_PROG_SIZE ((PAL_FIELD_HEIGHT*2) * 3 * DWORD_SIZE + 2*RISC_SYNC_INSTRUCTION_SIZE + \
RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE )
RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE )
#define ODD_FLD_PAL_PROG_SIZE ((PAL_FIELD_HEIGHT) * 3 * DWORD_SIZE + RISC_SYNC_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE )
#define ODD_FLD_NTSC_PROG_SIZE ((NTSC_ODD_FLD_LINES) * 3 * DWORD_SIZE + RISC_SYNC_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE )
#define NTSC_US_VID_PROG_SIZE ((NTSC_ODD_FLD_LINES + 1) * 3 * DWORD_SIZE + RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE)
#define NTSC_RISC_BUF_SIZE (2 * (RISC_SYNC_INSTRUCTION_SIZE + NTSC_US_VID_PROG_SIZE) )
#define FRAME1_VID_PROG_SIZE ((NTSC_ODD_FLD_LINES + NTSC_FIELD_HEIGHT) * 3 * DWORD_SIZE + 2*RISC_SYNC_INSTRUCTION_SIZE + \
RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE )
RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE )
#endif
......@@ -70,38 +70,38 @@
#ifdef USE_RISC_NOOP_VIDEO
#define PAL_US_VID_PROG_SIZE ((PAL_FIELD_HEIGHT) * 3 * DWORD_SIZE + RISC_WRITECR_INSTRUCTION_SIZE + \
RISC_SYNC_INSTRUCTION_SIZE + NUM_NO_OPS*DWORD_SIZE)
RISC_SYNC_INSTRUCTION_SIZE + NUM_NO_OPS*DWORD_SIZE)
#define PAL_RISC_BUF_SIZE (2 * PAL_US_VID_PROG_SIZE)
#define PAL_VID_PROG_SIZE ((PAL_FIELD_HEIGHT*2) * 3 * DWORD_SIZE + 2*RISC_SYNC_INSTRUCTION_SIZE + \
RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE + 2*NUM_NO_OPS*DWORD_SIZE)
RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE + 2*NUM_NO_OPS*DWORD_SIZE)
#define ODD_FLD_PAL_PROG_SIZE ((PAL_FIELD_HEIGHT) * 3 * DWORD_SIZE + RISC_SYNC_INSTRUCTION_SIZE + \
RISC_WRITECR_INSTRUCTION_SIZE + NUM_NO_OPS*DWORD_SIZE)
RISC_WRITECR_INSTRUCTION_SIZE + NUM_NO_OPS*DWORD_SIZE)
#define ODD_FLD_NTSC_PROG_SIZE ((NTSC_ODD_FLD_LINES) * 3 * DWORD_SIZE + RISC_SYNC_INSTRUCTION_SIZE + \
RISC_WRITECR_INSTRUCTION_SIZE + NUM_NO_OPS*DWORD_SIZE)
RISC_WRITECR_INSTRUCTION_SIZE + NUM_NO_OPS*DWORD_SIZE)
#define NTSC_US_VID_PROG_SIZE ((NTSC_ODD_FLD_LINES + 1) * 3 * DWORD_SIZE + RISC_WRITECR_INSTRUCTION_SIZE + \
JUMP_INSTRUCTION_SIZE + NUM_NO_OPS*DWORD_SIZE)
JUMP_INSTRUCTION_SIZE + NUM_NO_OPS*DWORD_SIZE)
#define NTSC_RISC_BUF_SIZE (2 * (RISC_SYNC_INSTRUCTION_SIZE + NTSC_US_VID_PROG_SIZE))
#define FRAME1_VID_PROG_SIZE ((NTSC_ODD_FLD_LINES + NTSC_FIELD_HEIGHT) * 3 * DWORD_SIZE + 2*RISC_SYNC_INSTRUCTION_SIZE + \
RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE + 2*NUM_NO_OPS*DWORD_SIZE)
RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE + 2*NUM_NO_OPS*DWORD_SIZE)
#endif
#ifndef USE_RISC_NOOP_VIDEO
#define PAL_US_VID_PROG_SIZE ((PAL_FIELD_HEIGHT) * 3 * DWORD_SIZE + RISC_WRITECR_INSTRUCTION_SIZE + \
RISC_SYNC_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE)
RISC_SYNC_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE)
#define PAL_RISC_BUF_SIZE (2 * PAL_US_VID_PROG_SIZE)
#define PAL_VID_PROG_SIZE ((PAL_FIELD_HEIGHT*2) * 3 * DWORD_SIZE + 2*RISC_SYNC_INSTRUCTION_SIZE + \
RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE )
RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE )
#define ODD_FLD_PAL_PROG_SIZE ((PAL_FIELD_HEIGHT) * 3 * DWORD_SIZE + RISC_SYNC_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE )
#define ODD_FLD_NTSC_PROG_SIZE ((NTSC_ODD_FLD_LINES) * 3 * DWORD_SIZE + RISC_SYNC_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE )
......@@ -109,5 +109,5 @@
#define NTSC_US_VID_PROG_SIZE ((NTSC_ODD_FLD_LINES + 1) * 3 * DWORD_SIZE + RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE)
#define NTSC_RISC_BUF_SIZE ( 2 * (RISC_SYNC_INSTRUCTION_SIZE + NTSC_US_VID_PROG_SIZE) )
#define FRAME1_VID_PROG_SIZE ((NTSC_ODD_FLD_LINES + NTSC_FIELD_HEIGHT) * 3 * DWORD_SIZE + 2*RISC_SYNC_INSTRUCTION_SIZE + \
RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE )
RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE )
#endif
/*
* Driver for the Conexant CX25821 PCIe bridge
*
* Copyright (C) 2009 Conexant Systems Inc.
* Copyright (C) 2009 Conexant Systems Inc.
* Authors <shu.lin@conexant.com>, <hiep.huynh@conexant.com>
* Based on Steven Toth <stoth@linuxtv.org> cx23885 driver
*
......@@ -52,7 +52,7 @@
#define dprintk(level, fmt, arg...)\
do { if (VIDEO_DEBUG >= level)\
printk(KERN_DEBUG "%s/0: " fmt, dev->name, ## arg);\
printk(KERN_DEBUG "%s/0: " fmt, dev->name, ## arg);\
} while (0)
......@@ -117,9 +117,9 @@ extern int res_locked(struct cx25821_dev *dev, unsigned int bit);
extern void res_free(struct cx25821_dev *dev, struct cx25821_fh *fh, unsigned int bits);
extern int cx25821_video_mux(struct cx25821_dev *dev, unsigned int input);
extern int cx25821_start_video_dma(struct cx25821_dev *dev,
struct cx25821_dmaqueue *q,
struct cx25821_buffer *buf,
struct sram_channel *channel);
struct cx25821_dmaqueue *q,
struct cx25821_buffer *buf,
struct sram_channel *channel);
extern int cx25821_set_scale(struct cx25821_dev *dev, unsigned int width, unsigned int height, enum v4l2_field field);
extern int cx25821_video_irq(struct cx25821_dev *dev, int chan_num, u32 status);
......
/*
* Driver for the Conexant CX25821 PCIe bridge
*
* Copyright (C) 2009 Conexant Systems Inc.
* Copyright (C) 2009 Conexant Systems Inc.
* Authors <shu.lin@conexant.com>, <hiep.huynh@conexant.com>
* Based on Steven Toth <stoth@linuxtv.org> cx23885 driver
*
......@@ -35,7 +35,7 @@
#include <linux/smp_lock.h>
#include <media/v4l2-common.h>
#include <media/v4l2-device.h>
#include <media/v4l2-device.h>
#include <media/tuner.h>
#include <media/tveeprom.h>
#include <media/videobuf-dma-sg.h>
......@@ -62,7 +62,7 @@
#define FALSE 0
#define LINE_SIZE_D1 1440
// Number of decoders and encoders
// Number of decoders and encoders
#define MAX_DECODERS 8
#define MAX_ENCODERS 2
#define QUAD_DECODERS 4
......@@ -91,7 +91,7 @@
#define UNKNOWN_BOARD 0
#define CX25821_BOARD 1
/* Currently supported by the driver */
/* Currently supported by the driver */
#define CX25821_NORMS (\
V4L2_STD_NTSC_M | V4L2_STD_NTSC_M_JP | V4L2_STD_NTSC_M_KR | \
V4L2_STD_PAL_BG | V4L2_STD_PAL_DK | V4L2_STD_PAL_I | \
......@@ -292,7 +292,7 @@ struct cx25821_dev {
struct cx25821_data timeout_data[MAX_VID_CHANNEL_NUM];
/* Analog Audio Upstream */
int _audio_is_running;
int _audio_is_running;
int _audiopixel_format;
int _is_first_audio_frame;
int _audiofile_status;
......@@ -311,7 +311,7 @@ struct cx25821_dev {
unsigned int _audiodata_buf_size;
__le32 * _audiodata_buf_virt_addr;
dma_addr_t _audiodata_buf_phys_addr;
char *_audiofilename;
char *_audiofilename;
/* V4l */
u32 freq;
......@@ -322,7 +322,7 @@ struct cx25821_dev {
struct cx25821_dmaqueue vidq[MAX_VID_CHANNEL_NUM];
spinlock_t slock;
/* Video Upstream */
int _line_size;
int _prog_cnt;
......@@ -343,8 +343,8 @@ struct cx25821_dev {
unsigned int _data_buf_size;
__le32 * _data_buf_virt_addr;
dma_addr_t _data_buf_phys_addr;
char * _filename;
char * _defaultname;
char * _filename;
char * _defaultname;
int _line_size_ch2;
......@@ -366,8 +366,8 @@ struct cx25821_dev {
unsigned int _data_buf_size_ch2;
__le32 * _data_buf_virt_addr_ch2;
dma_addr_t _data_buf_phys_addr_ch2;
char * _filename_ch2;
char * _defaultname_ch2;
char * _filename_ch2;
char * _defaultname_ch2;
/* MPEG Encoder ONLY settings */
u32 cx23417_mailbox;
......@@ -375,26 +375,26 @@ struct cx25821_dev {
struct video_device *v4l_device;
atomic_t v4l_reader_count;
struct cx25821_tvnorm encodernorm;
u32 upstream_riscbuf_size;
u32 upstream_databuf_size;
u32 upstream_riscbuf_size_ch2;
u32 upstream_databuf_size_ch2;
u32 audio_upstream_riscbuf_size;
u32 audio_upstream_databuf_size;
int _isNTSC;
int _frame_index;
int _audioframe_index;
struct workqueue_struct * _irq_queues;
struct work_struct _irq_work_entry;
struct workqueue_struct * _irq_queues_ch2;
struct work_struct _irq_work_entry_ch2;
struct workqueue_struct * _irq_audio_queues;
struct work_struct _audio_work_entry;
int _isNTSC;
int _frame_index;
int _audioframe_index;
struct workqueue_struct * _irq_queues;
struct work_struct _irq_work_entry;
struct workqueue_struct * _irq_queues_ch2;
struct work_struct _irq_work_entry_ch2;
struct workqueue_struct * _irq_audio_queues;
struct work_struct _audio_work_entry;
char *input_filename;
char *input_filename_ch2;
int _frame_index_ch2;
int _isNTSC_ch2;
int _frame_index_ch2;
int _isNTSC_ch2;
char *vid_stdname_ch2;
int pixel_format_ch2;
int channel_select_ch2;
......@@ -439,7 +439,7 @@ static inline struct cx25821_dev *get_cx25821(struct v4l2_device *v4l2_dev)
#define cx25821_call_all(dev, o, f, args...) \
v4l2_device_call_all(&dev->v4l2_dev, 0, o, f, ##args)
extern struct list_head cx25821_devlist;
extern struct cx25821_board cx25821_boards[];
extern struct cx25821_subid cx25821_subids[];
......@@ -487,16 +487,16 @@ struct sram_channel {
u32 aud_cfg;
u32 fld_aud_fifo_en;
u32 fld_aud_risc_en;
//For Upstream Video
u32 vid_fmt_ctl;
u32 vid_active_ctl1;
u32 vid_active_ctl2;
u32 vid_cdt_size;
u32 vip_ctl;
u32 pix_frmt;
u32 jumponly;
u32 jumponly;
u32 irq_bit;
};
extern struct sram_channel cx25821_sram_channels[];
......@@ -529,9 +529,9 @@ extern int cx25821_i2c_write(struct cx25821_i2c *bus, u16 reg_addr, int value);
extern int cx25821_i2c_unregister(struct cx25821_i2c *bus);
extern void cx25821_gpio_init(struct cx25821_dev *dev);
extern void cx25821_set_gpiopin_direction( struct cx25821_dev *dev,
int pin_number,
int pin_logic_value);
int pin_number,
int pin_logic_value);
extern int medusa_video_init(struct cx25821_dev *dev);
extern int medusa_set_videostandard(struct cx25821_dev *dev);
extern void medusa_set_resolution(struct cx25821_dev *dev, int width, int decoder_select);
......@@ -543,18 +543,18 @@ extern int medusa_set_saturation(struct cx25821_dev *dev, int saturation, int d
extern int cx25821_sram_channel_setup(struct cx25821_dev *dev, struct sram_channel *ch, unsigned int bpl, u32 risc);
extern int cx25821_risc_buffer(struct pci_dev *pci, struct btcx_riscmem *risc,
struct scatterlist *sglist,
unsigned int top_offset,
unsigned int bottom_offset,
unsigned int bpl,
unsigned int padding,
unsigned int lines);
struct scatterlist *sglist,
unsigned int top_offset,
unsigned int bottom_offset,
unsigned int bpl,
unsigned int padding,
unsigned int lines);
extern int cx25821_risc_databuffer_audio(struct pci_dev *pci,
struct btcx_riscmem *risc,
struct scatterlist *sglist,
unsigned int bpl,
unsigned int lines,
unsigned int lpi);
struct btcx_riscmem *risc,
struct scatterlist *sglist,
unsigned int bpl,
unsigned int lines,
unsigned int lpi);
extern void cx25821_free_buffer(struct videobuf_queue *q, struct cx25821_buffer *buf);
extern int cx25821_risc_stopper(struct pci_dev *pci, struct btcx_riscmem *risc,u32 reg, u32 mask, u32 value);
extern void cx25821_sram_channel_dump(struct cx25821_dev *dev, struct sram_channel *ch);
......@@ -565,26 +565,26 @@ extern struct cx25821_dev* cx25821_dev_get(struct pci_dev *pci);
extern void cx25821_print_irqbits(char *name, char *tag, char **strings, int len, u32 bits, u32 mask);
extern void cx25821_dev_unregister(struct cx25821_dev *dev);
extern int cx25821_sram_channel_setup_audio(struct cx25821_dev *dev,
struct sram_channel *ch,
unsigned int bpl, u32 risc);
struct sram_channel *ch,
unsigned int bpl, u32 risc);
extern int cx25821_vidupstream_init_ch1(struct cx25821_dev *dev, int channel_select, int pixel_format);
extern int cx25821_vidupstream_init_ch2(struct cx25821_dev *dev, int channel_select, int pixel_format);
extern int cx25821_audio_upstream_init(struct cx25821_dev *dev, int channel_select);
extern void cx25821_free_mem_upstream_ch1(struct cx25821_dev *dev);
extern void cx25821_free_mem_upstream_ch2(struct cx25821_dev *dev);
extern void cx25821_free_mem_upstream_audio(struct cx25821_dev *dev);
extern void cx25821_start_upstream_video_ch1(struct cx25821_dev *dev, struct upstream_user_struct *up_data);
extern void cx25821_start_upstream_video_ch2(struct cx25821_dev *dev, struct upstream_user_struct *up_data);
extern void cx25821_start_upstream_audio(struct cx25821_dev *dev, struct upstream_user_struct *up_data);
extern void cx25821_stop_upstream_video_ch1(struct cx25821_dev *dev);
extern void cx25821_stop_upstream_video_ch2(struct cx25821_dev *dev);
extern void cx25821_stop_upstream_audio(struct cx25821_dev *dev);
extern void cx25821_free_mem_upstream_ch1(struct cx25821_dev *dev);
extern void cx25821_free_mem_upstream_ch2(struct cx25821_dev *dev);
extern void cx25821_free_mem_upstream_audio(struct cx25821_dev *dev);
extern void cx25821_start_upstream_video_ch1(struct cx25821_dev *dev, struct upstream_user_struct *up_data);
extern void cx25821_start_upstream_video_ch2(struct cx25821_dev *dev, struct upstream_user_struct *up_data);
extern void cx25821_start_upstream_audio(struct cx25821_dev *dev, struct upstream_user_struct *up_data);
extern void cx25821_stop_upstream_video_ch1(struct cx25821_dev *dev);
extern void cx25821_stop_upstream_video_ch2(struct cx25821_dev *dev);
extern void cx25821_stop_upstream_audio(struct cx25821_dev *dev);
extern int cx25821_sram_channel_setup_upstream( struct cx25821_dev *dev, struct sram_channel *ch, unsigned int bpl, u32 risc);
extern void cx25821_set_pixel_format(struct cx25821_dev *dev, int channel, u32 format);
extern void cx25821_videoioctl_unregister(struct cx25821_dev *dev);
extern struct video_device *cx25821_vdev_init(struct cx25821_dev *dev,
struct pci_dev *pci,
struct video_device *template,
char *type);
struct pci_dev *pci,
struct video_device *template,
char *type);
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册