Commit 1a9fc855 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

V4L/DVB (12733): cx25821: some CodingStyle fixes

The original driver were generated with some dos editor, and used their
own coding style.

This patch does some automatic CodingStyle fixes, by running dos2unix
and Lindent tools.

More work still needs to be done for it to use upstream CodingStyle.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent bb4c9a74
This diff is collapsed.
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/workqueue.h> #include <linux/workqueue.h>
#define NUM_AUDIO_PROGS 8 #define NUM_AUDIO_PROGS 8
#define NUM_AUDIO_FRAMES 8 #define NUM_AUDIO_FRAMES 8
#define END_OF_FILE 0 #define END_OF_FILE 0
...@@ -33,7 +32,6 @@ ...@@ -33,7 +32,6 @@
#define FIFO_ENABLE 1 #define FIFO_ENABLE 1
#define NUM_NO_OPS 4 #define NUM_NO_OPS 4
#define RISC_READ_INSTRUCTION_SIZE 12 #define RISC_READ_INSTRUCTION_SIZE 12
#define RISC_JUMP_INSTRUCTION_SIZE 12 #define RISC_JUMP_INSTRUCTION_SIZE 12
#define RISC_WRITECR_INSTRUCTION_SIZE 16 #define RISC_WRITECR_INSTRUCTION_SIZE 16
...@@ -41,7 +39,6 @@ ...@@ -41,7 +39,6 @@
#define DWORD_SIZE 4 #define DWORD_SIZE 4
#define AUDIO_SYNC_LINE 4 #define AUDIO_SYNC_LINE 4
#define LINES_PER_AUDIO_BUFFER 15 #define LINES_PER_AUDIO_BUFFER 15
#define AUDIO_LINE_SIZE 128 #define AUDIO_LINE_SIZE 128
#define AUDIO_DATA_BUF_SZ (AUDIO_LINE_SIZE * LINES_PER_AUDIO_BUFFER) #define AUDIO_DATA_BUF_SZ (AUDIO_LINE_SIZE * LINES_PER_AUDIO_BUFFER)
...@@ -52,11 +49,9 @@ ...@@ -52,11 +49,9 @@
#define AUDIO_RISC_DMA_BUF_SIZE ( LINES_PER_AUDIO_BUFFER*RISC_READ_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE + NUM_NO_OPS*DWORD_SIZE + RISC_JUMP_INSTRUCTION_SIZE) #define AUDIO_RISC_DMA_BUF_SIZE ( LINES_PER_AUDIO_BUFFER*RISC_READ_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE + NUM_NO_OPS*DWORD_SIZE + RISC_JUMP_INSTRUCTION_SIZE)
#endif #endif
#ifndef USE_RISC_NOOP_AUDIO #ifndef USE_RISC_NOOP_AUDIO
#define AUDIO_RISC_DMA_BUF_SIZE ( LINES_PER_AUDIO_BUFFER*RISC_READ_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE + RISC_JUMP_INSTRUCTION_SIZE) #define AUDIO_RISC_DMA_BUF_SIZE ( LINES_PER_AUDIO_BUFFER*RISC_READ_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE + RISC_JUMP_INSTRUCTION_SIZE)
#endif #endif
static int _line_size; static int _line_size;
char * _defaultAudioName = "/root/audioGOOD.wav"; char *_defaultAudioName = "/root/audioGOOD.wav";
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#ifndef __CX25821_AUDIO_H__ #ifndef __CX25821_AUDIO_H__
#define __CX25821_AUDIO_H__ #define __CX25821_AUDIO_H__
#define USE_RISC_NOOP 1 #define USE_RISC_NOOP 1
#define LINES_PER_BUFFER 15 #define LINES_PER_BUFFER 15
#define AUDIO_LINE_SIZE 128 #define AUDIO_LINE_SIZE 128
...@@ -45,7 +44,6 @@ ...@@ -45,7 +44,6 @@
(2*LINES_PER_BUFFER*RISC_WRITE_INSTRUCTION_SIZE + RISC_NOOP_INSTRUCTION_SIZE*4) (2*LINES_PER_BUFFER*RISC_WRITE_INSTRUCTION_SIZE + RISC_NOOP_INSTRUCTION_SIZE*4)
#endif #endif
//Sizes of various instructions in bytes. Used when adding instructions. //Sizes of various instructions in bytes. Used when adding instructions.
#define RISC_WRITE_INSTRUCTION_SIZE 12 #define RISC_WRITE_INSTRUCTION_SIZE 12
#define RISC_JUMP_INSTRUCTION_SIZE 12 #define RISC_JUMP_INSTRUCTION_SIZE 12
...@@ -57,4 +55,3 @@ ...@@ -57,4 +55,3 @@
#define MAX_AUDIO_DMA_BUFFER_SIZE (MAX_BUFFER_PROGRAM_SIZE * NUMBER_OF_PROGRAMS + RISC_SYNC_INSTRUCTION_SIZE) #define MAX_AUDIO_DMA_BUFFER_SIZE (MAX_BUFFER_PROGRAM_SIZE * NUMBER_OF_PROGRAMS + RISC_SYNC_INSTRUCTION_SIZE)
#endif #endif
...@@ -23,10 +23,10 @@ ...@@ -23,10 +23,10 @@
#include "cx25821-video.h" #include "cx25821-video.h"
static void buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb) static void buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb)
{ {
struct cx25821_buffer *buf = container_of(vb, struct cx25821_buffer, vb); struct cx25821_buffer *buf =
container_of(vb, struct cx25821_buffer, vb);
struct cx25821_buffer *prev; struct cx25821_buffer *prev;
struct cx25821_fh *fh = vq->priv_data; struct cx25821_fh *fh = vq->priv_data;
struct cx25821_dev *dev = fh->dev; struct cx25821_dev *dev = fh->dev;
...@@ -42,21 +42,25 @@ static void buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb) ...@@ -42,21 +42,25 @@ static void buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb)
if (!list_empty(&q->queued)) { if (!list_empty(&q->queued)) {
list_add_tail(&buf->vb.queue, &q->queued); list_add_tail(&buf->vb.queue, &q->queued);
buf->vb.state = VIDEOBUF_QUEUED; buf->vb.state = VIDEOBUF_QUEUED;
dprintk(2, "[%p/%d] buffer_queue - append to queued\n", buf, buf->vb.i); dprintk(2, "[%p/%d] buffer_queue - append to queued\n", buf,
buf->vb.i);
} else if (list_empty(&q->active)) { } else if (list_empty(&q->active)) {
list_add_tail(&buf->vb.queue, &q->active); list_add_tail(&buf->vb.queue, &q->active);
cx25821_start_video_dma(dev, q, buf, &dev->sram_channels[SRAM_CH11]); cx25821_start_video_dma(dev, q, buf,
&dev->sram_channels[SRAM_CH11]);
buf->vb.state = VIDEOBUF_ACTIVE; buf->vb.state = VIDEOBUF_ACTIVE;
buf->count = q->count++; buf->count = q->count++;
mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT); mod_timer(&q->timeout, jiffies + BUFFER_TIMEOUT);
dprintk(2, "[%p/%d] buffer_queue - first active, buf cnt = %d, q->count = %d\n", dprintk(2,
buf, buf->vb. i, buf->count, q->count); "[%p/%d] buffer_queue - first active, buf cnt = %d, q->count = %d\n",
buf, buf->vb.i, buf->count, q->count);
} else { } else {
prev = list_entry(q->active.prev, struct cx25821_buffer, vb.queue); prev =
if (prev->vb.width == buf->vb.width && list_entry(q->active.prev, struct cx25821_buffer, vb.queue);
prev->vb.height == buf->vb.height && if (prev->vb.width == buf->vb.width
prev->fmt == buf->fmt) { && prev->vb.height == buf->vb.height
&& prev->fmt == buf->fmt) {
list_add_tail(&buf->vb.queue, &q->active); list_add_tail(&buf->vb.queue, &q->active);
buf->vb.state = VIDEOBUF_ACTIVE; buf->vb.state = VIDEOBUF_ACTIVE;
buf->count = q->count++; buf->count = q->count++;
...@@ -64,22 +68,23 @@ static void buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb) ...@@ -64,22 +68,23 @@ static void buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb)
/* 64 bit bits 63-32 */ /* 64 bit bits 63-32 */
prev->risc.jmp[2] = cpu_to_le32(0); 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); dprintk(2,
"[%p/%d] buffer_queue - append to active, buf->count=%d\n",
buf, buf->vb.i, buf->count);
} else { } else {
list_add_tail(&buf->vb.queue, &q->queued); list_add_tail(&buf->vb.queue, &q->queued);
buf->vb.state = VIDEOBUF_QUEUED; buf->vb.state = VIDEOBUF_QUEUED;
dprintk(2, "[%p/%d] buffer_queue - first queued\n", buf, buf->vb.i); dprintk(2, "[%p/%d] buffer_queue - first queued\n", buf,
buf->vb.i);
} }
} }
if (list_empty(&q->active)) if (list_empty(&q->active)) {
{
dprintk(2, "active queue empty!\n"); dprintk(2, "active queue empty!\n");
} }
} }
static struct videobuf_queue_ops cx25821_video_qops = { static struct videobuf_queue_ops cx25821_video_qops = {
.buf_setup = buffer_setup, .buf_setup = buffer_setup,
.buf_prepare = buffer_prepare, .buf_prepare = buffer_prepare,
...@@ -87,7 +92,6 @@ static struct videobuf_queue_ops cx25821_video_qops = { ...@@ -87,7 +92,6 @@ static struct videobuf_queue_ops cx25821_video_qops = {
.buf_release = buffer_release, .buf_release = buffer_release,
}; };
static int video_open(struct file *file) static int video_open(struct file *file)
{ {
int minor = video_devdata(file)->minor; int minor = video_devdata(file)->minor;
...@@ -97,12 +101,11 @@ static int video_open(struct file *file) ...@@ -97,12 +101,11 @@ static int video_open(struct file *file)
enum v4l2_buf_type type = 0; enum v4l2_buf_type type = 0;
lock_kernel(); lock_kernel();
list_for_each(list, &cx25821_devlist) 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) if (h->video_dev[SRAM_CH11]
{ && h->video_dev[SRAM_CH11]->minor == minor) {
dev = h; dev = h;
type = V4L2_BUF_TYPE_VIDEO_CAPTURE; type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
} }
...@@ -127,7 +130,7 @@ static int video_open(struct file *file) ...@@ -127,7 +130,7 @@ static int video_open(struct file *file)
fh->type = type; fh->type = type;
fh->width = 720; fh->width = 720;
if(dev->tvnorm & V4L2_STD_PAL_BG || dev->tvnorm & V4L2_STD_PAL_DK) if (dev->tvnorm & V4L2_STD_PAL_BG || dev->tvnorm & V4L2_STD_PAL_DK)
fh->height = 576; fh->height = 576;
else else
fh->height = 480; fh->height = 480;
...@@ -135,14 +138,13 @@ static int video_open(struct file *file) ...@@ -135,14 +138,13 @@ static int video_open(struct file *file)
dev->channel_opened = 10; dev->channel_opened = 10;
fh->fmt = format_by_fourcc(V4L2_PIX_FMT_YUYV); fh->fmt = format_by_fourcc(V4L2_PIX_FMT_YUYV);
v4l2_prio_open(&dev->prio,&fh->prio); v4l2_prio_open(&dev->prio, &fh->prio);
videobuf_queue_sg_init(&fh->vidq, &cx25821_video_qops, videobuf_queue_sg_init(&fh->vidq, &cx25821_video_qops,
&dev->pci->dev, &dev->slock, &dev->pci->dev, &dev->slock,
V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_BUF_TYPE_VIDEO_CAPTURE,
V4L2_FIELD_INTERLACED, V4L2_FIELD_INTERLACED,
sizeof(struct cx25821_buffer), sizeof(struct cx25821_buffer), fh);
fh);
dprintk(1, "post videobuf_queue_init()\n"); dprintk(1, "post videobuf_queue_init()\n");
unlock_kernel(); unlock_kernel();
...@@ -150,17 +152,18 @@ static int video_open(struct file *file) ...@@ -150,17 +152,18 @@ static int video_open(struct file *file)
return 0; return 0;
} }
static ssize_t video_read(struct file *file, char __user *data, size_t count, loff_t *ppos) static ssize_t video_read(struct file *file, char __user * data, size_t count,
loff_t * ppos)
{ {
struct cx25821_fh *fh = file->private_data; struct cx25821_fh *fh = file->private_data;
switch (fh->type) switch (fh->type) {
{
case V4L2_BUF_TYPE_VIDEO_CAPTURE: case V4L2_BUF_TYPE_VIDEO_CAPTURE:
if (res_locked(fh->dev, RESOURCE_VIDEO11)) if (res_locked(fh->dev, RESOURCE_VIDEO11))
return -EBUSY; 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: default:
BUG(); BUG();
...@@ -168,7 +171,8 @@ static ssize_t video_read(struct file *file, char __user *data, size_t count, lo ...@@ -168,7 +171,8 @@ static ssize_t video_read(struct file *file, char __user *data, size_t count, lo
} }
} }
static unsigned int video_poll(struct file *file, struct poll_table_struct *wait) static unsigned int video_poll(struct file *file,
struct poll_table_struct *wait)
{ {
struct cx25821_fh *fh = file->private_data; struct cx25821_fh *fh = file->private_data;
struct cx25821_buffer *buf; struct cx25821_buffer *buf;
...@@ -188,11 +192,10 @@ static unsigned int video_poll(struct file *file, struct poll_table_struct *wait ...@@ -188,11 +192,10 @@ static unsigned int video_poll(struct file *file, struct poll_table_struct *wait
poll_wait(file, &buf->vb.done, wait); poll_wait(file, &buf->vb.done, wait);
if (buf->vb.state == VIDEOBUF_DONE || buf->vb.state == VIDEOBUF_ERROR) if (buf->vb.state == VIDEOBUF_DONE || buf->vb.state == VIDEOBUF_ERROR)
return POLLIN|POLLRDNORM; return POLLIN | POLLRDNORM;
return 0; return 0;
} }
static int video_release(struct file *file) static int video_release(struct file *file)
{ {
struct cx25821_fh *fh = file->private_data; struct cx25821_fh *fh = file->private_data;
...@@ -214,7 +217,7 @@ static int video_release(struct file *file) ...@@ -214,7 +217,7 @@ static int video_release(struct file *file)
videobuf_mmap_free(&fh->vidq); videobuf_mmap_free(&fh->vidq);
v4l2_prio_close(&dev->prio,&fh->prio); v4l2_prio_close(&dev->prio, &fh->prio);
file->private_data = NULL; file->private_data = NULL;
kfree(fh); kfree(fh);
...@@ -222,24 +225,20 @@ static int video_release(struct file *file) ...@@ -222,24 +225,20 @@ static int video_release(struct file *file)
return 0; return 0;
} }
static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i) static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i)
{ {
struct cx25821_fh *fh = priv; struct cx25821_fh *fh = priv;
struct cx25821_dev *dev = fh->dev; struct cx25821_dev *dev = fh->dev;
if (unlikely(fh->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)) if (unlikely(fh->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)) {
{
return -EINVAL; return -EINVAL;
} }
if (unlikely(i != fh->type)) if (unlikely(i != fh->type)) {
{
return -EINVAL; return -EINVAL;
} }
if (unlikely(!res_get(dev, fh, get_resource(fh, RESOURCE_VIDEO11)))) if (unlikely(!res_get(dev, fh, get_resource(fh, RESOURCE_VIDEO11)))) {
{
return -EBUSY; return -EBUSY;
} }
...@@ -265,15 +264,14 @@ static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type i) ...@@ -265,15 +264,14 @@ static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type i)
return 0; return 0;
} }
static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, struct v4l2_format *f) struct v4l2_format *f)
{ {
struct cx25821_fh *fh = priv; struct cx25821_fh *fh = priv;
struct cx25821_dev *dev = ((struct cx25821_fh *)priv)->dev; struct cx25821_dev *dev = ((struct cx25821_fh *)priv)->dev;
int err; int err;
if (fh) if (fh) {
{
err = v4l2_prio_check(&dev->prio, &fh->prio); err = v4l2_prio_check(&dev->prio, &fh->prio);
if (0 != err) if (0 != err)
return err; return err;
...@@ -288,35 +286,35 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, struct v4l2_forma ...@@ -288,35 +286,35 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, struct v4l2_forma
fh->width = f->fmt.pix.width; fh->width = f->fmt.pix.width;
fh->height = f->fmt.pix.height; fh->height = f->fmt.pix.height;
fh->vidq.field = f->fmt.pix.field; fh->vidq.field = f->fmt.pix.field;
dprintk(2, "%s() width=%d height=%d field=%d\n", __func__, fh->width, fh->height, fh->vidq.field); dprintk(2, "%s() width=%d height=%d field=%d\n", __func__, fh->width,
fh->height, fh->vidq.field);
cx25821_call_all(dev, video, s_fmt, f); cx25821_call_all(dev, video, s_fmt, f);
return 0; 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_fh *fh = file->private_data;
struct cx25821_dev *dev = fh->dev; struct cx25821_dev *dev = fh->dev;
int command = 0; int command = 0;
struct upstream_user_struct *data_from_user; struct upstream_user_struct *data_from_user;
data_from_user = (struct upstream_user_struct *)arg; data_from_user = (struct upstream_user_struct *)arg;
if( !data_from_user ) if (!data_from_user) {
{ printk
printk("cx25821 in %s(): Upstream data is INVALID. Returning.\n", __func__); ("cx25821 in %s(): Upstream data is INVALID. Returning.\n",
__func__);
return 0; return 0;
} }
command = data_from_user->command; command = data_from_user->command;
if( command != UPSTREAM_START_AUDIO && command != UPSTREAM_STOP_AUDIO ) if (command != UPSTREAM_START_AUDIO && command != UPSTREAM_STOP_AUDIO) {
{
return 0; return 0;
} }
dev->input_filename = data_from_user->input_filename; dev->input_filename = data_from_user->input_filename;
dev->input_audiofilename = data_from_user->input_filename; dev->input_audiofilename = data_from_user->input_filename;
dev->vid_stdname = data_from_user->vid_stdname; dev->vid_stdname = data_from_user->vid_stdname;
...@@ -324,9 +322,7 @@ static long video_ioctl_upstream11(struct file *file, unsigned int cmd, unsigned ...@@ -324,9 +322,7 @@ static long video_ioctl_upstream11(struct file *file, unsigned int cmd, unsigned
dev->channel_select = data_from_user->channel_select; dev->channel_select = data_from_user->channel_select;
dev->command = data_from_user->command; dev->command = data_from_user->command;
switch (command) {
switch(command)
{
case UPSTREAM_START_AUDIO: case UPSTREAM_START_AUDIO:
cx25821_start_upstream_audio(dev, data_from_user); cx25821_start_upstream_audio(dev, data_from_user);
break; break;
...@@ -345,7 +341,7 @@ static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *p) ...@@ -345,7 +341,7 @@ static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *p)
return videobuf_dqbuf(get_queue(fh), p, file->f_flags & O_NONBLOCK); return videobuf_dqbuf(get_queue(fh), p, file->f_flags & O_NONBLOCK);
} }
static int vidioc_log_status (struct file *file, void *priv) static int vidioc_log_status(struct file *file, void *priv)
{ {
struct cx25821_dev *dev = ((struct cx25821_fh *)priv)->dev; struct cx25821_dev *dev = ((struct cx25821_fh *)priv)->dev;
char name[32 + 2]; char name[32 + 2];
...@@ -366,14 +362,14 @@ static int vidioc_s_ctrl(struct file *file, void *priv, ...@@ -366,14 +362,14 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
struct cx25821_dev *dev = fh->dev; struct cx25821_dev *dev = fh->dev;
int err; int err;
if (fh) if (fh) {
{
err = v4l2_prio_check(&dev->prio, &fh->prio); err = v4l2_prio_check(&dev->prio, &fh->prio);
if (0 != err) if (0 != err)
return err; return err;
} }
return 0; return 0;
} }
// exported stuff // exported stuff
static const struct v4l2_file_operations video_fops = { static const struct v4l2_file_operations video_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
...@@ -436,6 +432,3 @@ struct video_device cx25821_video_template11 = { ...@@ -436,6 +432,3 @@ struct video_device cx25821_video_template11 = {
.tvnorms = CX25821_NORMS, .tvnorms = CX25821_NORMS,
.current_norm = V4L2_STD_NTSC_M, .current_norm = V4L2_STD_NTSC_M,
}; };
...@@ -50,7 +50,7 @@ struct cx25821_board cx25821_boards[] = { ...@@ -50,7 +50,7 @@ struct cx25821_board cx25821_boards[] = {
const unsigned int cx25821_bcount = ARRAY_SIZE(cx25821_boards); const unsigned int cx25821_bcount = ARRAY_SIZE(cx25821_boards);
struct cx25821_subid cx25821_subids[]={ struct cx25821_subid cx25821_subids[] = {
{ {
.subvendor = 0x14f1, .subvendor = 0x14f1,
.subdevice = 0x0920, .subdevice = 0x0920,
...@@ -58,15 +58,13 @@ struct cx25821_subid cx25821_subids[]={ ...@@ -58,15 +58,13 @@ struct cx25821_subid cx25821_subids[]={
}, },
}; };
void cx25821_card_setup(struct cx25821_dev *dev) void cx25821_card_setup(struct cx25821_dev *dev)
{ {
static u8 eeprom[256]; 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; dev->i2c_bus[0].i2c_client.addr = 0xa0 >> 1;
tveeprom_read(&dev->i2c_bus[0].i2c_client, eeprom, sizeof(eeprom)); tveeprom_read(&dev->i2c_bus[0].i2c_client, eeprom,
sizeof(eeprom));
} }
} }
This diff is collapsed.
...@@ -22,11 +22,9 @@ ...@@ -22,11 +22,9 @@
#include "cx25821.h" #include "cx25821.h"
/********************* GPIO stuffs *********************/ /********************* GPIO stuffs *********************/
void cx25821_set_gpiopin_direction( struct cx25821_dev *dev, void cx25821_set_gpiopin_direction(struct cx25821_dev *dev,
int pin_number, int pin_number, int pin_logic_value)
int pin_logic_value)
{ {
int bit = pin_number; int bit = pin_number;
u32 gpio_oe_reg = GPIO_LO_OE; u32 gpio_oe_reg = GPIO_LO_OE;
...@@ -34,77 +32,61 @@ void cx25821_set_gpiopin_direction( struct cx25821_dev *dev, ...@@ -34,77 +32,61 @@ void cx25821_set_gpiopin_direction( struct cx25821_dev *dev,
u32 value = 0; u32 value = 0;
// Check for valid pinNumber // Check for valid pinNumber
if ( pin_number >= 47 ) if (pin_number >= 47)
return; return;
if (pin_number > 31) {
if ( pin_number > 31 )
{
bit = pin_number - 31; bit = pin_number - 31;
gpio_oe_reg = GPIO_HI_OE; gpio_oe_reg = GPIO_HI_OE;
} }
// Here we will make sure that the GPIOs 0 and 1 are output. keep the rest as is // 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 ); gpio_register = cx_read(gpio_oe_reg);
if (pin_logic_value == 1) 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);
else
{
value = gpio_register & Clear_GPIO_Bit(bit) ;
} }
cx_write( gpio_oe_reg, value ); cx_write(gpio_oe_reg, value);
} }
static void cx25821_set_gpiopin_logicvalue( struct cx25821_dev *dev, static void cx25821_set_gpiopin_logicvalue(struct cx25821_dev *dev,
int pin_number, int pin_number, int pin_logic_value)
int pin_logic_value)
{ {
int bit = pin_number; int bit = pin_number;
u32 gpio_reg = GPIO_LO; u32 gpio_reg = GPIO_LO;
u32 value = 0; u32 value = 0;
// Check for valid pinNumber // Check for valid pinNumber
if (pin_number >= 47) if (pin_number >= 47)
return; return;
cx25821_set_gpiopin_direction(dev, pin_number, 0); // change to output direction cx25821_set_gpiopin_direction(dev, pin_number, 0); // change to output direction
if (pin_number > 31) {
if ( pin_number > 31 )
{
bit = pin_number - 31; bit = pin_number - 31;
gpio_reg = GPIO_HI; gpio_reg = GPIO_HI;
} }
value = cx_read( gpio_reg ); value = cx_read(gpio_reg);
if (pin_logic_value == 0) {
if (pin_logic_value == 0)
{
value &= Clear_GPIO_Bit(bit); value &= Clear_GPIO_Bit(bit);
} } else {
else
{
value |= Set_GPIO_Bit(bit); value |= Set_GPIO_Bit(bit);
} }
cx_write( gpio_reg, value); cx_write(gpio_reg, value);
} }
void cx25821_gpio_init(struct cx25821_dev *dev) void cx25821_gpio_init(struct cx25821_dev *dev)
{ {
if( dev == NULL ) if (dev == NULL) {
{
return; return;
} }
switch (dev->board) switch (dev->board) {
{
case CX25821_BOARD_CONEXANT_ATHENA10: case CX25821_BOARD_CONEXANT_ATHENA10:
default: default:
//set GPIO 5 to select the path for Medusa/Athena //set GPIO 5 to select the path for Medusa/Athena
......
void cx25821_gpio_init(struct athena_dev *dev); void cx25821_gpio_init(struct athena_dev *dev);
...@@ -24,12 +24,11 @@ ...@@ -24,12 +24,11 @@
#include "cx25821.h" #include "cx25821.h"
#include <linux/i2c.h> #include <linux/i2c.h>
static unsigned int i2c_debug; static unsigned int i2c_debug;
module_param(i2c_debug, int, 0644); module_param(i2c_debug, int, 0644);
MODULE_PARM_DESC(i2c_debug, "enable debug messages [i2c]"); MODULE_PARM_DESC(i2c_debug, "enable debug messages [i2c]");
static unsigned int i2c_scan=0; static unsigned int i2c_scan = 0;
module_param(i2c_scan, int, 0444); module_param(i2c_scan, int, 0444);
MODULE_PARM_DESC(i2c_scan, "scan i2c bus at insmod time"); MODULE_PARM_DESC(i2c_scan, "scan i2c bus at insmod time");
...@@ -44,7 +43,6 @@ MODULE_PARM_DESC(i2c_scan, "scan i2c bus at insmod time"); ...@@ -44,7 +43,6 @@ MODULE_PARM_DESC(i2c_scan, "scan i2c bus at insmod time");
#define I2C_EXTEND (1 << 3) #define I2C_EXTEND (1 << 3)
#define I2C_NOSTOP (1 << 4) #define I2C_NOSTOP (1 << 4)
static inline int i2c_slave_did_ack(struct i2c_adapter *i2c_adap) static inline int i2c_slave_did_ack(struct i2c_adapter *i2c_adap)
{ {
struct cx25821_i2c *bus = i2c_adap->algo_data; struct cx25821_i2c *bus = i2c_adap->algo_data;
...@@ -75,7 +73,8 @@ static int i2c_wait_done(struct i2c_adapter *i2c_adap) ...@@ -75,7 +73,8 @@ static int i2c_wait_done(struct i2c_adapter *i2c_adap)
return 1; return 1;
} }
static int i2c_sendbytes(struct i2c_adapter *i2c_adap, const struct i2c_msg *msg, int joined_rlen) static int i2c_sendbytes(struct i2c_adapter *i2c_adap,
const struct i2c_msg *msg, int joined_rlen)
{ {
struct cx25821_i2c *bus = i2c_adap->algo_data; struct cx25821_i2c *bus = i2c_adap->algo_data;
struct cx25821_dev *dev = bus->dev; struct cx25821_dev *dev = bus->dev;
...@@ -83,13 +82,13 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap, const struct i2c_msg *msg ...@@ -83,13 +82,13 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap, const struct i2c_msg *msg
int retval, cnt; int retval, cnt;
if (joined_rlen) if (joined_rlen)
dprintk(1, "%s(msg->wlen=%d, nextmsg->rlen=%d)\n", __func__, msg->len, joined_rlen); dprintk(1, "%s(msg->wlen=%d, nextmsg->rlen=%d)\n", __func__,
msg->len, joined_rlen);
else else
dprintk(1, "%s(msg->len=%d)\n", __func__, msg->len); dprintk(1, "%s(msg->len=%d)\n", __func__, msg->len);
/* Deal with i2c probe functions with zero payload */ /* 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)); cx_write(bus->reg_ctrl, bus->i2c_period | (1 << 2));
...@@ -125,8 +124,7 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap, const struct i2c_msg *msg ...@@ -125,8 +124,7 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap, const struct i2c_msg *msg
if (retval == 0) if (retval == 0)
goto eio; goto eio;
if (i2c_debug) if (i2c_debug) {
{
if (!(ctrl & I2C_NOSTOP)) if (!(ctrl & I2C_NOSTOP))
printk(" >\n"); printk(" >\n");
} }
...@@ -152,8 +150,7 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap, const struct i2c_msg *msg ...@@ -152,8 +150,7 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap, const struct i2c_msg *msg
if (retval == 0) if (retval == 0)
goto eio; goto eio;
if (i2c_debug) if (i2c_debug) {
{
dprintk(1, " %02x", msg->buf[cnt]); dprintk(1, " %02x", msg->buf[cnt]);
if (!(ctrl & I2C_NOSTOP)) if (!(ctrl & I2C_NOSTOP))
dprintk(1, " >\n"); dprintk(1, " >\n");
...@@ -170,14 +167,14 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap, const struct i2c_msg *msg ...@@ -170,14 +167,14 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap, const struct i2c_msg *msg
return retval; return retval;
} }
static int i2c_readbytes(struct i2c_adapter *i2c_adap, const struct i2c_msg *msg, int joined) static int i2c_readbytes(struct i2c_adapter *i2c_adap,
const struct i2c_msg *msg, int joined)
{ {
struct cx25821_i2c *bus = i2c_adap->algo_data; struct cx25821_i2c *bus = i2c_adap->algo_data;
struct cx25821_dev *dev = bus->dev; struct cx25821_dev *dev = bus->dev;
u32 ctrl, cnt; u32 ctrl, cnt;
int retval; int retval;
if (i2c_debug && !joined) if (i2c_debug && !joined)
dprintk(1, "6-%s(msg->len=%d)\n", __func__, msg->len); dprintk(1, "6-%s(msg->len=%d)\n", __func__, msg->len);
...@@ -190,7 +187,6 @@ static int i2c_readbytes(struct i2c_adapter *i2c_adap, const struct i2c_msg *msg ...@@ -190,7 +187,6 @@ static int i2c_readbytes(struct i2c_adapter *i2c_adap, const struct i2c_msg *msg
if (!i2c_slave_did_ack(i2c_adap)) if (!i2c_slave_did_ack(i2c_adap))
return -EIO; return -EIO;
dprintk(1, "%s() returns 0\n", __func__); dprintk(1, "%s() returns 0\n", __func__);
return 0; return 0;
} }
...@@ -209,7 +205,6 @@ static int i2c_readbytes(struct i2c_adapter *i2c_adap, const struct i2c_msg *msg ...@@ -209,7 +205,6 @@ static int i2c_readbytes(struct i2c_adapter *i2c_adap, const struct i2c_msg *msg
if (cnt < msg->len - 1) if (cnt < msg->len - 1)
ctrl |= I2C_NOSTOP | I2C_EXTEND; ctrl |= I2C_NOSTOP | I2C_EXTEND;
cx_write(bus->reg_addr, msg->addr << 25); cx_write(bus->reg_addr, msg->addr << 25);
cx_write(bus->reg_ctrl, ctrl); cx_write(bus->reg_ctrl, ctrl);
...@@ -244,29 +239,24 @@ static int i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num) ...@@ -244,29 +239,24 @@ static int i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num)
dprintk(1, "%s(num = %d)\n", __func__, 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", dprintk(1, "%s(num = %d) addr = 0x%02x len = 0x%x\n",
__func__, num, msgs[i].addr, msgs[i].len); __func__, num, msgs[i].addr, msgs[i].len);
if (msgs[i].flags & I2C_M_RD) if (msgs[i].flags & I2C_M_RD) {
{
/* read */ /* read */
retval = i2c_readbytes(i2c_adap, &msgs[i], 0); retval = i2c_readbytes(i2c_adap, &msgs[i], 0);
} } else if (i + 1 < num && (msgs[i + 1].flags & I2C_M_RD) &&
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 */ /* write then read from same address */
retval = i2c_sendbytes(i2c_adap, &msgs[i], msgs[i + 1].len); retval =
i2c_sendbytes(i2c_adap, &msgs[i], msgs[i + 1].len);
if (retval < 0) if (retval < 0)
goto err; goto err;
i++; i++;
retval = i2c_readbytes(i2c_adap, &msgs[i], 1); retval = i2c_readbytes(i2c_adap, &msgs[i], 1);
} } else {
else
{
/* write */ /* write */
retval = i2c_sendbytes(i2c_adap, &msgs[i], 0); retval = i2c_sendbytes(i2c_adap, &msgs[i], 0);
} }
...@@ -286,8 +276,7 @@ static u32 cx25821_functionality(struct i2c_adapter *adap) ...@@ -286,8 +276,7 @@ static u32 cx25821_functionality(struct i2c_adapter *adap)
return I2C_FUNC_SMBUS_EMUL | return I2C_FUNC_SMBUS_EMUL |
I2C_FUNC_I2C | I2C_FUNC_I2C |
I2C_FUNC_SMBUS_WORD_DATA | I2C_FUNC_SMBUS_WORD_DATA |
I2C_FUNC_SMBUS_READ_WORD_DATA | I2C_FUNC_SMBUS_READ_WORD_DATA | I2C_FUNC_SMBUS_WRITE_WORD_DATA;
I2C_FUNC_SMBUS_WRITE_WORD_DATA;
} }
static struct i2c_algorithm cx25821_i2c_algo_template = { static struct i2c_algorithm cx25821_i2c_algo_template = {
...@@ -295,7 +284,6 @@ static struct i2c_algorithm cx25821_i2c_algo_template = { ...@@ -295,7 +284,6 @@ static struct i2c_algorithm cx25821_i2c_algo_template = {
.functionality = cx25821_functionality, .functionality = cx25821_functionality,
}; };
static struct i2c_adapter cx25821_i2c_adap_template = { static struct i2c_adapter cx25821_i2c_adap_template = {
.name = "cx25821", .name = "cx25821",
.owner = THIS_MODULE, .owner = THIS_MODULE,
...@@ -333,7 +321,7 @@ int cx25821_i2c_register(struct cx25821_i2c *bus) ...@@ -333,7 +321,7 @@ int cx25821_i2c_register(struct cx25821_i2c *bus)
bus->i2c_client.adapter = &bus->i2c_adap; bus->i2c_client.adapter = &bus->i2c_adap;
//set up the I2c //set up the I2c
bus->i2c_client.addr = (0x88>>1); bus->i2c_client.addr = (0x88 >> 1);
return bus->i2c_rc; return bus->i2c_rc;
} }
...@@ -367,16 +355,15 @@ void cx25821_av_clk(struct cx25821_dev *dev, int enable) ...@@ -367,16 +355,15 @@ void cx25821_av_clk(struct cx25821_dev *dev, int enable)
i2c_xfer(&dev->i2c_bus[0].i2c_adap, &msg, 1); i2c_xfer(&dev->i2c_bus[0].i2c_adap, &msg, 1);
} }
int cx25821_i2c_read(struct cx25821_i2c *bus, u16 reg_addr, int *value) int cx25821_i2c_read(struct cx25821_i2c *bus, u16 reg_addr, int *value)
{ {
struct i2c_client *client = &bus->i2c_client; struct i2c_client *client = &bus->i2c_client;
int retval = 0; int retval = 0;
int v = 0; int v = 0;
u8 addr[2] = {0, 0}; u8 addr[2] = { 0, 0 };
u8 buf[4] = {0,0,0,0}; u8 buf[4] = { 0, 0, 0, 0 };
struct i2c_msg msgs[2]={ struct i2c_msg msgs[2] = {
{ {
.addr = client->addr, .addr = client->addr,
.flags = 0, .flags = 0,
...@@ -390,28 +377,26 @@ int cx25821_i2c_read(struct cx25821_i2c *bus, u16 reg_addr, int *value) ...@@ -390,28 +377,26 @@ int cx25821_i2c_read(struct cx25821_i2c *bus, u16 reg_addr, int *value)
} }
}; };
addr[0] = (reg_addr >> 8);
addr[0] = (reg_addr>>8);
addr[1] = (reg_addr & 0xff); addr[1] = (reg_addr & 0xff);
msgs[0].addr = 0x44; msgs[0].addr = 0x44;
msgs[1].addr = 0x44; msgs[1].addr = 0x44;
retval = i2c_xfer(client->adapter, msgs, 2); retval = i2c_xfer(client->adapter, msgs, 2);
v = (buf[3]<<24) | (buf[2]<<16) | (buf[1]<<8) | buf[0]; v = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0];
*value = v; *value = v;
return v; return v;
} }
int cx25821_i2c_write(struct cx25821_i2c *bus, u16 reg_addr, int value) int cx25821_i2c_write(struct cx25821_i2c *bus, u16 reg_addr, int value)
{ {
struct i2c_client *client = &bus->i2c_client; struct i2c_client *client = &bus->i2c_client;
int retval = 0; int retval = 0;
u8 buf[6] = {0, 0, 0, 0, 0, 0}; u8 buf[6] = { 0, 0, 0, 0, 0, 0 };
struct i2c_msg msgs[1]={ struct i2c_msg msgs[1] = {
{ {
.addr = client->addr, .addr = client->addr,
.flags = 0, .flags = 0,
...@@ -420,12 +405,11 @@ int cx25821_i2c_write(struct cx25821_i2c *bus, u16 reg_addr, int value) ...@@ -420,12 +405,11 @@ int cx25821_i2c_write(struct cx25821_i2c *bus, u16 reg_addr, int value)
} }
}; };
buf[0] = reg_addr >> 8;
buf[0] = reg_addr>>8;
buf[1] = reg_addr & 0xff; buf[1] = reg_addr & 0xff;
buf[5] = (value>>24) & 0xff; buf[5] = (value >> 24) & 0xff;
buf[4] = (value>>16) & 0xff; buf[4] = (value >> 16) & 0xff;
buf[3] = (value>>8) & 0xff; buf[3] = (value >> 8) & 0xff;
buf[2] = value & 0xff; buf[2] = value & 0xff;
client->flags = 0; client->flags = 0;
msgs[0].addr = 0x44; msgs[0].addr = 0x44;
...@@ -434,4 +418,3 @@ int cx25821_i2c_write(struct cx25821_i2c *bus, u16 reg_addr, int value) ...@@ -434,4 +418,3 @@ int cx25821_i2c_write(struct cx25821_i2c *bus, u16 reg_addr, int value)
return retval; return retval;
} }
...@@ -452,5 +452,4 @@ ...@@ -452,5 +452,4 @@
#define VDEC_A_VSAT_CTRL 0x1019 #define VDEC_A_VSAT_CTRL 0x1019
#define VDEC_A_HUE_CTRL 0x101A #define VDEC_A_HUE_CTRL 0x101A
#endif #endif
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include "cx25821-medusa-defines.h" #include "cx25821-medusa-defines.h"
// Color control constants // Color control constants
#define VIDEO_PROCAMP_MIN 0 #define VIDEO_PROCAMP_MIN 0
#define VIDEO_PROCAMP_MAX 10000 #define VIDEO_PROCAMP_MAX 10000
...@@ -41,7 +40,6 @@ ...@@ -41,7 +40,6 @@
#define CONTRAST_DEFAULT 5000 #define CONTRAST_DEFAULT 5000
#define HUE_DEFAULT 5000 #define HUE_DEFAULT 5000
unsigned short _num_decoders; unsigned short _num_decoders;
unsigned short _num_cameras; unsigned short _num_cameras;
......
...@@ -166,7 +166,6 @@ ...@@ -166,7 +166,6 @@
#define FLD_VID_SRC_ERRORS FLD_VID_SRC_OPC_ERR | FLD_VID_SRC_SYNC | FLD_VID_SRC_UF #define FLD_VID_SRC_ERRORS FLD_VID_SRC_OPC_ERR | FLD_VID_SRC_SYNC | FLD_VID_SRC_UF
#define FLD_VID_DST_ERRORS FLD_VID_DST_OPC_ERR | FLD_VID_DST_SYNC | FLD_VID_DST_OF #define FLD_VID_DST_ERRORS FLD_VID_DST_OPC_ERR | FLD_VID_DST_SYNC | FLD_VID_DST_OF
//***************************************************************************** //*****************************************************************************
#define AUD_A_INT_MSK 0x0400C0 // Audio Int interrupt mask #define AUD_A_INT_MSK 0x0400C0 // Audio Int interrupt mask
#define AUD_A_INT_STAT 0x0400C4 // Audio Int interrupt status #define AUD_A_INT_STAT 0x0400C4 // Audio Int interrupt status
...@@ -237,7 +236,6 @@ ...@@ -237,7 +236,6 @@
#define FLD_AUD_EXT_RISCI2 0x00000010 #define FLD_AUD_EXT_RISCI2 0x00000010
#define FLD_AUD_EXT_RISCI1 0x00000001 #define FLD_AUD_EXT_RISCI1 0x00000001
//***************************************************************************** //*****************************************************************************
#define GPIO_LO 0x110010 // Lower of GPIO pins [31:0] #define GPIO_LO 0x110010 // Lower of GPIO pins [31:0]
#define GPIO_HI 0x110014 // Upper WORD of GPIO pins [47:31] #define GPIO_HI 0x110014 // Upper WORD of GPIO pins [47:31]
...@@ -279,7 +277,6 @@ ...@@ -279,7 +277,6 @@
//***************************************************************************** //*****************************************************************************
#define TC_REQ_SET 0x040094 // Rider PCI Express traFFic class request set #define TC_REQ_SET 0x040094 // Rider PCI Express traFFic class request set
//***************************************************************************** //*****************************************************************************
// Rider // Rider
//***************************************************************************** //*****************************************************************************
...@@ -669,7 +666,6 @@ ...@@ -669,7 +666,6 @@
//***************************************************************************** //*****************************************************************************
#define DMA26_PTR1 0x100064 // DMA Current Ptr : Ch#26 #define DMA26_PTR1 0x100064 // DMA Current Ptr : Ch#26
//***************************************************************************** //*****************************************************************************
#define DMA1_PTR2 0x100080 // DMA Tab Ptr : Ch#1 #define DMA1_PTR2 0x100080 // DMA Tab Ptr : Ch#1
...@@ -748,8 +744,6 @@ ...@@ -748,8 +744,6 @@
//***************************************************************************** //*****************************************************************************
#define DMA26_PTR2 0x1000E4 // DMA Tab Ptr : Ch#26 #define DMA26_PTR2 0x1000E4 // DMA Tab Ptr : Ch#26
//***************************************************************************** //*****************************************************************************
#define DMA1_CNT1 0x100100 // DMA BuFFer Size : Ch#1 #define DMA1_CNT1 0x100100 // DMA BuFFer Size : Ch#1
...@@ -828,7 +822,6 @@ ...@@ -828,7 +822,6 @@
//***************************************************************************** //*****************************************************************************
#define DMA26_CNT1 0x100164 // DMA BuFFer Size : Ch#26 #define DMA26_CNT1 0x100164 // DMA BuFFer Size : Ch#26
//***************************************************************************** //*****************************************************************************
#define DMA1_CNT2 0x100180 // DMA Table Size : Ch#1 #define DMA1_CNT2 0x100180 // DMA Table Size : Ch#1
...@@ -907,8 +900,6 @@ ...@@ -907,8 +900,6 @@
//***************************************************************************** //*****************************************************************************
#define DMA26_CNT2 0x1001E4 // DMA Table Size : Ch#26 #define DMA26_CNT2 0x1001E4 // DMA Table Size : Ch#26
//***************************************************************************** //*****************************************************************************
// ITG // ITG
//***************************************************************************** //*****************************************************************************
...@@ -1070,7 +1061,6 @@ ...@@ -1070,7 +1061,6 @@
#define CLK_DELAY 0x110048 // Clock delay #define CLK_DELAY 0x110048 // Clock delay
#define FLD_MOE_CLK_DIS 0x80000000 // Disable MoE clock #define FLD_MOE_CLK_DIS 0x80000000 // Disable MoE clock
//***************************************************************************** //*****************************************************************************
#define PAD_CTRL 0x110068 // Pad drive strength control #define PAD_CTRL 0x110068 // Pad drive strength control
...@@ -1100,7 +1090,6 @@ ...@@ -1100,7 +1090,6 @@
#define VID_CH_MODE_SEL 0x110078 #define VID_CH_MODE_SEL 0x110078
#define VID_CH_CLK_SEL 0x11007C #define VID_CH_CLK_SEL 0x11007C
//***************************************************************************** //*****************************************************************************
#define VBI_A_DMA 0x130008 // VBI A DMA data port #define VBI_A_DMA 0x130008 // VBI A DMA data port
...@@ -1148,7 +1137,6 @@ ...@@ -1148,7 +1137,6 @@
#define VID_C_LNGTH 0x130250 // Video C line length #define VID_C_LNGTH 0x130250 // Video C line length
#define FLD_VID_C_LN_LNGTH 0x00000FFF #define FLD_VID_C_LN_LNGTH 0x00000FFF
//***************************************************************************** //*****************************************************************************
// Video Destination Channels // Video Destination Channels
//***************************************************************************** //*****************************************************************************
...@@ -1173,7 +1161,6 @@ ...@@ -1173,7 +1161,6 @@
#define VID_DST_G_GPCNT_CTL 0x130630 // Video G general purpose control #define VID_DST_G_GPCNT_CTL 0x130630 // Video G general purpose control
#define VID_DST_H_GPCNT_CTL 0x130730 // Video H general purpose control #define VID_DST_H_GPCNT_CTL 0x130730 // Video H general purpose control
//***************************************************************************** //*****************************************************************************
#define VID_DST_A_DMA_CTL 0x130040 // Video A DMA control #define VID_DST_A_DMA_CTL 0x130040 // Video A DMA control
...@@ -1397,7 +1384,6 @@ ...@@ -1397,7 +1384,6 @@
#define FLD_AUD_DST_B_FIFO_EN 0x00000002 #define FLD_AUD_DST_B_FIFO_EN 0x00000002
#define FLD_AUD_DST_A_FIFO_EN 0x00000001 #define FLD_AUD_DST_A_FIFO_EN 0x00000001
//***************************************************************************** //*****************************************************************************
// //
// Mobilygen Interface Registers // Mobilygen Interface Registers
...@@ -1475,7 +1461,6 @@ ...@@ -1475,7 +1461,6 @@
#define FLD_MB_HCMD_H_ADDR 0x00FF0000 #define FLD_MB_HCMD_H_ADDR 0x00FF0000
#define FLD_MB_HCMD_H_DATA 0x0000FFFF #define FLD_MB_HCMD_H_DATA 0x0000FFFF
//***************************************************************************** //*****************************************************************************
// I2C #1 // I2C #1
//***************************************************************************** //*****************************************************************************
...@@ -1605,5 +1590,3 @@ ...@@ -1605,5 +1590,3 @@
#define PIXEL_ENGINE_VIP2 1 #define PIXEL_ENGINE_VIP2 1
#endif //Athena_REGISTERS #endif //Athena_REGISTERS
...@@ -47,7 +47,6 @@ ...@@ -47,7 +47,6 @@
#define AUDIO_CLUSTER_SIZE 128 // AUDIO cluster data line #define AUDIO_CLUSTER_SIZE 128 // AUDIO cluster data line
#define MBIF_CLUSTER_SIZE 1440 // MBIF/HBI cluster data line #define MBIF_CLUSTER_SIZE 1440 // MBIF/HBI cluster data line
//#define TX_SRAM_POOL_FREE_SIZE = 704; // Start of available TX SRAM //#define TX_SRAM_POOL_FREE_SIZE = 704; // Start of available TX SRAM
//#define TX_SRAM_END_SIZE = 0; // End of TX SRAM //#define TX_SRAM_END_SIZE = 0; // End of TX SRAM
...@@ -181,7 +180,6 @@ ...@@ -181,7 +180,6 @@
// Free Receive SRAM 144 Bytes // Free Receive SRAM 144 Bytes
// Transmit SRAM // Transmit SRAM
#define TX_SRAM_POOL_START 0x00000 #define TX_SRAM_POOL_START 0x00000
...@@ -244,7 +242,6 @@ ...@@ -244,7 +242,6 @@
#define TX_SRAM_POOL_FREE 0x0BB00 #define TX_SRAM_POOL_FREE 0x0BB00
#define TX_SRAM_END 0x0C000 #define TX_SRAM_END 0x0C000
#define BYTES_TO_DWORDS(bcount) ((bcount) >> 2) #define BYTES_TO_DWORDS(bcount) ((bcount) >> 2)
#define BYTES_TO_QWORDS(bcount) ((bcount) >> 3) #define BYTES_TO_QWORDS(bcount) ((bcount) >> 3)
#define BYTES_TO_OWORDS(bcount) ((bcount) >> 4) #define BYTES_TO_OWORDS(bcount) ((bcount) >> 4)
...@@ -261,6 +258,4 @@ ...@@ -261,6 +258,4 @@
#define MBIF_CDT_SIZE_QW BYTES_TO_QWORDS(MBIF_CDT_SIZE) #define MBIF_CDT_SIZE_QW BYTES_TO_QWORDS(MBIF_CDT_SIZE)
#define MBIF_CLUSTER_SIZE_OW BYTES_TO_OWORDS(MBIF_CLUSTER_SIZE) #define MBIF_CLUSTER_SIZE_OW BYTES_TO_OWORDS(MBIF_CLUSTER_SIZE)
#endif #endif
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/workqueue.h> #include <linux/workqueue.h>
#define OPEN_FILE_1 0 #define OPEN_FILE_1 0
#define NUM_PROGS 8 #define NUM_PROGS 8
#define NUM_FRAMES 2 #define NUM_FRAMES 2
...@@ -38,8 +37,6 @@ ...@@ -38,8 +37,6 @@
#define RESET_STATUS -1 #define RESET_STATUS -1
#define NUM_NO_OPS 5 #define NUM_NO_OPS 5
// PAL and NTSC line sizes and number of lines. // PAL and NTSC line sizes and number of lines.
#define WIDTH_D1 720 #define WIDTH_D1 720
#define NTSC_LINES_PER_FRAME 480 #define NTSC_LINES_PER_FRAME 480
...@@ -65,8 +62,6 @@ ...@@ -65,8 +62,6 @@
#define MAXSIZE_NO_OPS 36 #define MAXSIZE_NO_OPS 36
#define DWORD_SIZE 4 #define DWORD_SIZE 4
#define USE_RISC_NOOP_VIDEO 1 #define USE_RISC_NOOP_VIDEO 1
#ifdef USE_RISC_NOOP_VIDEO #ifdef USE_RISC_NOOP_VIDEO
...@@ -92,7 +87,6 @@ ...@@ -92,7 +87,6 @@
RISC_WRITECR_INSTRUCTION_SIZE + NUM_NO_OPS*DWORD_SIZE) RISC_WRITECR_INSTRUCTION_SIZE + NUM_NO_OPS*DWORD_SIZE)
#endif #endif
#ifndef USE_RISC_NOOP_VIDEO #ifndef USE_RISC_NOOP_VIDEO
#define PAL_US_VID_PROG_SIZE ((PAL_FIELD_HEIGHT + 1) * 3 * DWORD_SIZE + RISC_WRITECR_INSTRUCTION_SIZE ) #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_RISC_BUF_SIZE ( 2 * (RISC_SYNC_INSTRUCTION_SIZE + PAL_US_VID_PROG_SIZE) )
......
...@@ -38,8 +38,6 @@ ...@@ -38,8 +38,6 @@
#define RESET_STATUS -1 #define RESET_STATUS -1
#define NUM_NO_OPS 5 #define NUM_NO_OPS 5
// PAL and NTSC line sizes and number of lines. // PAL and NTSC line sizes and number of lines.
#define WIDTH_D1 720 #define WIDTH_D1 720
#define NTSC_LINES_PER_FRAME 480 #define NTSC_LINES_PER_FRAME 480
...@@ -65,7 +63,6 @@ ...@@ -65,7 +63,6 @@
#define MAXSIZE_NO_OPS 36 #define MAXSIZE_NO_OPS 36
#define DWORD_SIZE 4 #define DWORD_SIZE 4
#define USE_RISC_NOOP_VIDEO 1 #define USE_RISC_NOOP_VIDEO 1
#ifdef USE_RISC_NOOP_VIDEO #ifdef USE_RISC_NOOP_VIDEO
...@@ -93,7 +90,6 @@ ...@@ -93,7 +90,6 @@
#endif #endif
#ifndef USE_RISC_NOOP_VIDEO #ifndef USE_RISC_NOOP_VIDEO
#define PAL_US_VID_PROG_SIZE ((PAL_FIELD_HEIGHT) * 3 * DWORD_SIZE + RISC_WRITECR_INSTRUCTION_SIZE + \ #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)
......
This diff is collapsed.
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#ifndef CX25821_VIDEO_H_ #ifndef CX25821_VIDEO_H_
#define CX25821_VIDEO_H_ #define CX25821_VIDEO_H_
#include <linux/init.h> #include <linux/init.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -55,7 +54,6 @@ ...@@ -55,7 +54,6 @@
printk(KERN_DEBUG "%s/0: " fmt, dev->name, ## arg);\ printk(KERN_DEBUG "%s/0: " fmt, dev->name, ## arg);\
} while (0) } while (0)
//For IOCTL to identify running upstream //For IOCTL to identify running upstream
#define UPSTREAM_START_VIDEO 700 #define UPSTREAM_START_VIDEO 700
#define UPSTREAM_STOP_VIDEO 701 #define UPSTREAM_STOP_VIDEO 701
...@@ -103,55 +101,75 @@ extern struct cx25821_fmt formats[]; ...@@ -103,55 +101,75 @@ extern struct cx25821_fmt formats[];
extern struct cx25821_fmt *format_by_fourcc(unsigned int fourcc); extern struct cx25821_fmt *format_by_fourcc(unsigned int fourcc);
extern struct cx25821_data timeout_data[MAX_VID_CHANNEL_NUM]; extern struct cx25821_data timeout_data[MAX_VID_CHANNEL_NUM];
extern void dump_video_queue(struct cx25821_dev *dev, struct cx25821_dmaqueue *q); extern void dump_video_queue(struct cx25821_dev *dev,
extern void cx25821_video_wakeup(struct cx25821_dev *dev, struct cx25821_dmaqueue *q, u32 count); struct cx25821_dmaqueue *q);
extern void cx25821_video_wakeup(struct cx25821_dev *dev,
struct cx25821_dmaqueue *q, u32 count);
#ifdef TUNER_FLAG #ifdef TUNER_FLAG
extern int cx25821_set_tvnorm(struct cx25821_dev *dev, v4l2_std_id norm); extern int cx25821_set_tvnorm(struct cx25821_dev *dev, v4l2_std_id norm);
#endif #endif
extern int res_get(struct cx25821_dev *dev, struct cx25821_fh *fh,
extern int res_get(struct cx25821_dev *dev, struct cx25821_fh *fh, unsigned int bit); unsigned int bit);
extern int res_check(struct cx25821_fh *fh, unsigned int bit); extern int res_check(struct cx25821_fh *fh, unsigned int bit);
extern int res_locked(struct cx25821_dev *dev, unsigned int bit); 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 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_video_mux(struct cx25821_dev *dev, unsigned int input);
extern int cx25821_start_video_dma(struct cx25821_dev *dev, extern int cx25821_start_video_dma(struct cx25821_dev *dev,
struct cx25821_dmaqueue *q, struct cx25821_dmaqueue *q,
struct cx25821_buffer *buf, struct cx25821_buffer *buf,
struct sram_channel *channel); 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_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); extern int cx25821_video_irq(struct cx25821_dev *dev, int chan_num, u32 status);
extern void cx25821_video_unregister(struct cx25821_dev *dev, int chan_num); extern void cx25821_video_unregister(struct cx25821_dev *dev, int chan_num);
extern int cx25821_video_register(struct cx25821_dev *dev, int chan_num, struct video_device *video_template); extern int cx25821_video_register(struct cx25821_dev *dev, int chan_num,
struct video_device *video_template);
extern int get_format_size(void); extern int get_format_size(void);
extern int buffer_setup(struct videobuf_queue *q, unsigned int *count, unsigned int *size); extern int buffer_setup(struct videobuf_queue *q, unsigned int *count,
extern int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb, enum v4l2_field field); unsigned int *size);
extern void buffer_release(struct videobuf_queue *q, struct videobuf_buffer *vb); extern int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,
enum v4l2_field field);
extern void buffer_release(struct videobuf_queue *q,
struct videobuf_buffer *vb);
extern struct videobuf_queue *get_queue(struct cx25821_fh *fh); extern struct videobuf_queue *get_queue(struct cx25821_fh *fh);
extern int get_resource(struct cx25821_fh *fh, int resource); extern int get_resource(struct cx25821_fh *fh, int resource);
extern int video_mmap(struct file *file, struct vm_area_struct *vma); extern int video_mmap(struct file *file, struct vm_area_struct *vma);
extern int vidioc_try_fmt_vid_cap(struct file *file, void *priv, struct v4l2_format *f); extern int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
extern int vidioc_querycap(struct file *file, void *priv, struct v4l2_capability *cap); struct v4l2_format *f);
extern int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, struct v4l2_fmtdesc *f); extern int vidioc_querycap(struct file *file, void *priv,
struct v4l2_capability *cap);
extern int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_fmtdesc *f);
extern int vidiocgmbuf(struct file *file, void *priv, struct video_mbuf *mbuf); extern int vidiocgmbuf(struct file *file, void *priv, struct video_mbuf *mbuf);
extern int vidioc_reqbufs(struct file *file, void *priv, struct v4l2_requestbuffers *p); extern int vidioc_reqbufs(struct file *file, void *priv,
extern int vidioc_querybuf(struct file *file, void *priv, struct v4l2_buffer *p); struct v4l2_requestbuffers *p);
extern int vidioc_querybuf(struct file *file, void *priv,
struct v4l2_buffer *p);
extern int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *p); extern int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *p);
extern int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *tvnorms); extern int vidioc_s_std(struct file *file, void *priv, v4l2_std_id * tvnorms);
extern int cx25821_enum_input(struct cx25821_dev *dev, struct v4l2_input *i); extern int cx25821_enum_input(struct cx25821_dev *dev, struct v4l2_input *i);
extern int vidioc_enum_input(struct file *file, void *priv, struct v4l2_input *i); extern int vidioc_enum_input(struct file *file, void *priv,
struct v4l2_input *i);
extern int vidioc_g_input(struct file *file, void *priv, unsigned int *i); extern int vidioc_g_input(struct file *file, void *priv, unsigned int *i);
extern int vidioc_s_input(struct file *file, void *priv, unsigned int i); extern int vidioc_s_input(struct file *file, void *priv, unsigned int i);
extern int vidioc_g_ctrl(struct file *file, void *priv, struct v4l2_control *ctl); extern int vidioc_g_ctrl(struct file *file, void *priv,
extern int vidioc_g_fmt_vid_cap(struct file *file, void *priv, struct v4l2_format *f); struct v4l2_control *ctl);
extern int vidioc_g_frequency(struct file *file, void *priv, struct v4l2_frequency *f); extern int vidioc_g_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *f);
extern int vidioc_g_frequency(struct file *file, void *priv,
struct v4l2_frequency *f);
extern int cx25821_set_freq(struct cx25821_dev *dev, struct v4l2_frequency *f); extern int cx25821_set_freq(struct cx25821_dev *dev, struct v4l2_frequency *f);
extern int vidioc_s_frequency(struct file *file, void *priv, struct v4l2_frequency *f); extern int vidioc_s_frequency(struct file *file, void *priv,
extern int vidioc_g_register(struct file *file, void *fh, struct v4l2_dbg_register *reg); struct v4l2_frequency *f);
extern int vidioc_s_register(struct file *file, void *fh, struct v4l2_dbg_register *reg); extern int vidioc_g_register(struct file *file, void *fh,
struct v4l2_dbg_register *reg);
extern int vidioc_s_register(struct file *file, void *fh,
struct v4l2_dbg_register *reg);
extern int vidioc_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t); extern int vidioc_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t);
extern int vidioc_s_tuner(struct file *file, void *priv, struct v4l2_tuner *t); extern int vidioc_s_tuner(struct file *file, void *priv, struct v4l2_tuner *t);
...@@ -159,14 +177,18 @@ extern int is_valid_width(u32 width, v4l2_std_id tvnorm); ...@@ -159,14 +177,18 @@ extern int is_valid_width(u32 width, v4l2_std_id tvnorm);
extern int is_valid_height(u32 height, v4l2_std_id tvnorm); extern int is_valid_height(u32 height, v4l2_std_id tvnorm);
extern int vidioc_g_priority(struct file *file, void *f, enum v4l2_priority *p); extern int vidioc_g_priority(struct file *file, void *f, enum v4l2_priority *p);
extern int vidioc_s_priority(struct file *file, void *f, enum v4l2_priority prio); extern int vidioc_s_priority(struct file *file, void *f,
enum v4l2_priority prio);
extern int vidioc_queryctrl(struct file *file, void *priv, struct v4l2_queryctrl *qctrl); extern int vidioc_queryctrl(struct file *file, void *priv,
extern int cx25821_set_control(struct cx25821_dev *dev, struct v4l2_control *ctrl, int chan_num); struct v4l2_queryctrl *qctrl);
extern int cx25821_set_control(struct cx25821_dev *dev,
struct v4l2_control *ctrl, int chan_num);
extern int vidioc_cropcap(struct file *file, void *fh, struct v4l2_cropcap *cropcap); extern int vidioc_cropcap(struct file *file, void *fh,
struct v4l2_cropcap *cropcap);
extern int vidioc_s_crop(struct file *file, void *priv, struct v4l2_crop *crop); extern int vidioc_s_crop(struct file *file, void *priv, struct v4l2_crop *crop);
extern int vidioc_g_crop(struct file *file, void *priv, struct v4l2_crop *crop); extern int vidioc_g_crop(struct file *file, void *priv, struct v4l2_crop *crop);
extern int vidioc_querystd(struct file *file, void *priv, v4l2_std_id *norm); extern int vidioc_querystd(struct file *file, void *priv, v4l2_std_id * norm);
#endif #endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#ifndef CX25821_H_ #ifndef CX25821_H_
#define CX25821_H_ #define CX25821_H_
...@@ -85,7 +84,6 @@ ...@@ -85,7 +84,6 @@
#define RESOURCE_VIDEO11 2048 #define RESOURCE_VIDEO11 2048
#define RESOURCE_VIDEO_IOCTL 4096 #define RESOURCE_VIDEO_IOCTL 4096
#define BUFFER_TIMEOUT (HZ) /* 0.5 seconds */ #define BUFFER_TIMEOUT (HZ) /* 0.5 seconds */
#define UNKNOWN_BOARD 0 #define UNKNOWN_BOARD 0
...@@ -301,15 +299,15 @@ struct cx25821_dev { ...@@ -301,15 +299,15 @@ struct cx25821_dev {
int _audio_upstream_channel_select; int _audio_upstream_channel_select;
int _last_index_irq; //The last interrupt index processed. int _last_index_irq; //The last interrupt index processed.
__le32 * _risc_audio_jmp_addr; __le32 *_risc_audio_jmp_addr;
__le32 * _risc_virt_start_addr; __le32 *_risc_virt_start_addr;
__le32 * _risc_virt_addr; __le32 *_risc_virt_addr;
dma_addr_t _risc_phys_addr; dma_addr_t _risc_phys_addr;
dma_addr_t _risc_phys_start_addr; dma_addr_t _risc_phys_start_addr;
unsigned int _audiorisc_size; unsigned int _audiorisc_size;
unsigned int _audiodata_buf_size; unsigned int _audiodata_buf_size;
__le32 * _audiodata_buf_virt_addr; __le32 *_audiodata_buf_virt_addr;
dma_addr_t _audiodata_buf_phys_addr; dma_addr_t _audiodata_buf_phys_addr;
char *_audiofilename; char *_audiofilename;
...@@ -335,17 +333,16 @@ struct cx25821_dev { ...@@ -335,17 +333,16 @@ struct cx25821_dev {
int _channel_upstream_select; int _channel_upstream_select;
unsigned int _risc_size; unsigned int _risc_size;
__le32 * _dma_virt_start_addr; __le32 *_dma_virt_start_addr;
__le32 * _dma_virt_addr; __le32 *_dma_virt_addr;
dma_addr_t _dma_phys_addr; dma_addr_t _dma_phys_addr;
dma_addr_t _dma_phys_start_addr; dma_addr_t _dma_phys_start_addr;
unsigned int _data_buf_size; unsigned int _data_buf_size;
__le32 * _data_buf_virt_addr; __le32 *_data_buf_virt_addr;
dma_addr_t _data_buf_phys_addr; dma_addr_t _data_buf_phys_addr;
char * _filename; char *_filename;
char * _defaultname; char *_defaultname;
int _line_size_ch2; int _line_size_ch2;
int _prog_cnt_ch2; int _prog_cnt_ch2;
...@@ -358,16 +355,16 @@ struct cx25821_dev { ...@@ -358,16 +355,16 @@ struct cx25821_dev {
int _channel2_upstream_select; int _channel2_upstream_select;
unsigned int _risc_size_ch2; unsigned int _risc_size_ch2;
__le32 * _dma_virt_start_addr_ch2; __le32 *_dma_virt_start_addr_ch2;
__le32 * _dma_virt_addr_ch2; __le32 *_dma_virt_addr_ch2;
dma_addr_t _dma_phys_addr_ch2; dma_addr_t _dma_phys_addr_ch2;
dma_addr_t _dma_phys_start_addr_ch2; dma_addr_t _dma_phys_start_addr_ch2;
unsigned int _data_buf_size_ch2; unsigned int _data_buf_size_ch2;
__le32 * _data_buf_virt_addr_ch2; __le32 *_data_buf_virt_addr_ch2;
dma_addr_t _data_buf_phys_addr_ch2; dma_addr_t _data_buf_phys_addr_ch2;
char * _filename_ch2; char *_filename_ch2;
char * _defaultname_ch2; char *_defaultname_ch2;
/* MPEG Encoder ONLY settings */ /* MPEG Encoder ONLY settings */
u32 cx23417_mailbox; u32 cx23417_mailbox;
...@@ -385,11 +382,11 @@ struct cx25821_dev { ...@@ -385,11 +382,11 @@ struct cx25821_dev {
int _isNTSC; int _isNTSC;
int _frame_index; int _frame_index;
int _audioframe_index; int _audioframe_index;
struct workqueue_struct * _irq_queues; struct workqueue_struct *_irq_queues;
struct work_struct _irq_work_entry; struct work_struct _irq_work_entry;
struct workqueue_struct * _irq_queues_ch2; struct workqueue_struct *_irq_queues_ch2;
struct work_struct _irq_work_entry_ch2; struct work_struct _irq_work_entry_ch2;
struct workqueue_struct * _irq_audio_queues; struct workqueue_struct *_irq_audio_queues;
struct work_struct _audio_work_entry; struct work_struct _audio_work_entry;
char *input_filename; char *input_filename;
char *input_filename_ch2; char *input_filename_ch2;
...@@ -410,7 +407,6 @@ struct cx25821_dev { ...@@ -410,7 +407,6 @@ struct cx25821_dev {
int channel_opened; int channel_opened;
}; };
struct upstream_user_struct { struct upstream_user_struct {
char *input_filename; char *input_filename;
char *vid_stdname; char *vid_stdname;
...@@ -458,8 +454,6 @@ extern struct cx25821_subid cx25821_subids[]; ...@@ -458,8 +454,6 @@ extern struct cx25821_subid cx25821_subids[];
#define SRAM_CH10 10 /* Video Upstream J */ #define SRAM_CH10 10 /* Video Upstream J */
#define SRAM_CH11 11 /* Audio Upstream AUD_CHANNEL_B */ #define SRAM_CH11 11 /* Audio Upstream AUD_CHANNEL_B */
#define VID_UPSTREAM_SRAM_CHANNEL_I SRAM_CH09 #define VID_UPSTREAM_SRAM_CHANNEL_I SRAM_CH09
#define VID_UPSTREAM_SRAM_CHANNEL_J SRAM_CH10 #define VID_UPSTREAM_SRAM_CHANNEL_J SRAM_CH10
#define AUDIO_UPSTREAM_SRAM_CHANNEL_B SRAM_CH11 #define AUDIO_UPSTREAM_SRAM_CHANNEL_B SRAM_CH11
...@@ -528,60 +522,78 @@ extern int cx25821_i2c_read(struct cx25821_i2c *bus, u16 reg_addr, int *value); ...@@ -528,60 +522,78 @@ extern int cx25821_i2c_read(struct cx25821_i2c *bus, u16 reg_addr, int *value);
extern int cx25821_i2c_write(struct cx25821_i2c *bus, u16 reg_addr, int value); extern int cx25821_i2c_write(struct cx25821_i2c *bus, u16 reg_addr, int value);
extern int cx25821_i2c_unregister(struct cx25821_i2c *bus); extern int cx25821_i2c_unregister(struct cx25821_i2c *bus);
extern void cx25821_gpio_init(struct cx25821_dev *dev); extern void cx25821_gpio_init(struct cx25821_dev *dev);
extern void cx25821_set_gpiopin_direction( struct cx25821_dev *dev, extern void cx25821_set_gpiopin_direction(struct cx25821_dev *dev,
int pin_number, int pin_number, int pin_logic_value);
int pin_logic_value);
extern int medusa_video_init(struct cx25821_dev *dev); extern int medusa_video_init(struct cx25821_dev *dev);
extern int medusa_set_videostandard(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); extern void medusa_set_resolution(struct cx25821_dev *dev, int width,
extern int medusa_set_brightness(struct cx25821_dev *dev, int brightness, int decoder); int decoder_select);
extern int medusa_set_contrast(struct cx25821_dev *dev, int contrast, int decoder); extern int medusa_set_brightness(struct cx25821_dev *dev, int brightness,
int decoder);
extern int medusa_set_contrast(struct cx25821_dev *dev, int contrast,
int decoder);
extern int medusa_set_hue(struct cx25821_dev *dev, int hue, int decoder); extern int medusa_set_hue(struct cx25821_dev *dev, int hue, int decoder);
extern int medusa_set_saturation(struct cx25821_dev *dev, int saturation, int decoder); extern int medusa_set_saturation(struct cx25821_dev *dev, int saturation,
int decoder);
extern int cx25821_sram_channel_setup(struct cx25821_dev *dev, struct sram_channel *ch, unsigned int bpl, u32 risc); 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, extern int cx25821_risc_buffer(struct pci_dev *pci, struct btcx_riscmem *risc,
struct scatterlist *sglist, struct scatterlist *sglist,
unsigned int top_offset, unsigned int top_offset,
unsigned int bottom_offset, unsigned int bottom_offset,
unsigned int bpl, unsigned int bpl,
unsigned int padding, unsigned int padding, unsigned int lines);
unsigned int lines);
extern int cx25821_risc_databuffer_audio(struct pci_dev *pci, extern int cx25821_risc_databuffer_audio(struct pci_dev *pci,
struct btcx_riscmem *risc, struct btcx_riscmem *risc,
struct scatterlist *sglist, struct scatterlist *sglist,
unsigned int bpl, unsigned int bpl,
unsigned int lines, unsigned int lines, unsigned int lpi);
unsigned int lpi); extern void cx25821_free_buffer(struct videobuf_queue *q,
extern void cx25821_free_buffer(struct videobuf_queue *q, struct cx25821_buffer *buf); struct cx25821_buffer *buf);
extern int cx25821_risc_stopper(struct pci_dev *pci, struct btcx_riscmem *risc,u32 reg, u32 mask, u32 value); extern int cx25821_risc_stopper(struct pci_dev *pci, struct btcx_riscmem *risc,
extern void cx25821_sram_channel_dump(struct cx25821_dev *dev, struct sram_channel *ch); u32 reg, u32 mask, u32 value);
extern void cx25821_sram_channel_dump_audio(struct cx25821_dev *dev, struct sram_channel *ch); extern void cx25821_sram_channel_dump(struct cx25821_dev *dev,
struct sram_channel *ch);
extern void cx25821_sram_channel_dump_audio(struct cx25821_dev *dev,
extern struct cx25821_dev* cx25821_dev_get(struct pci_dev *pci); struct sram_channel *ch);
extern void cx25821_print_irqbits(char *name, char *tag, char **strings, int len, u32 bits, u32 mask);
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 void cx25821_dev_unregister(struct cx25821_dev *dev);
extern int cx25821_sram_channel_setup_audio(struct cx25821_dev *dev, extern int cx25821_sram_channel_setup_audio(struct cx25821_dev *dev,
struct sram_channel *ch, struct sram_channel *ch,
unsigned int bpl, u32 risc); 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_ch1(struct cx25821_dev *dev,
extern int cx25821_vidupstream_init_ch2(struct cx25821_dev *dev, int channel_select, int pixel_format); int channel_select, int pixel_format);
extern int cx25821_audio_upstream_init(struct cx25821_dev *dev, int channel_select); 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_ch1(struct cx25821_dev *dev);
extern void cx25821_free_mem_upstream_ch2(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_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_ch1(struct cx25821_dev *dev,
extern void cx25821_start_upstream_video_ch2(struct cx25821_dev *dev, struct upstream_user_struct *up_data); struct upstream_user_struct
extern void cx25821_start_upstream_audio(struct cx25821_dev *dev, struct upstream_user_struct *up_data); *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_ch1(struct cx25821_dev *dev);
extern void cx25821_stop_upstream_video_ch2(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_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 int cx25821_sram_channel_setup_upstream(struct cx25821_dev *dev,
extern void cx25821_set_pixel_format(struct cx25821_dev *dev, int channel, u32 format); 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 void cx25821_videoioctl_unregister(struct cx25821_dev *dev);
extern struct video_device *cx25821_vdev_init(struct cx25821_dev *dev, extern struct video_device *cx25821_vdev_init(struct cx25821_dev *dev,
struct pci_dev *pci, struct pci_dev *pci,
......
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