summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/cx88/cx88-blackbird.c
diff options
context:
space:
mode:
authorGerd Knorr <devnull@localhost>2004-10-13 10:38:59 +0000
committerGerd Knorr <devnull@localhost>2004-10-13 10:38:59 +0000
commitedd4507a9edff255a67ce707442560a4ec4b3b14 (patch)
treed7c709acacb87b01d70340692df17aebcfbe2913 /linux/drivers/media/video/cx88/cx88-blackbird.c
parentc391a6857f19bd7eb8b9a40dc238242c34332f7a (diff)
downloadmediapointer-dvb-s2-edd4507a9edff255a67ce707442560a4ec4b3b14.tar.gz
mediapointer-dvb-s2-edd4507a9edff255a67ce707442560a4ec4b3b14.tar.bz2
- kill trailing whitespaces.
Diffstat (limited to 'linux/drivers/media/video/cx88/cx88-blackbird.c')
-rw-r--r--linux/drivers/media/video/cx88/cx88-blackbird.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-blackbird.c b/linux/drivers/media/video/cx88/cx88-blackbird.c
index 4e754eace..3434952cf 100644
--- a/linux/drivers/media/video/cx88/cx88-blackbird.c
+++ b/linux/drivers/media/video/cx88/cx88-blackbird.c
@@ -1,5 +1,5 @@
/*
- * $Id: cx88-blackbird.c,v 1.14 2004/10/12 07:33:22 kraxel Exp $
+ * $Id: cx88-blackbird.c,v 1.15 2004/10/13 10:39:00 kraxel Exp $
*
* Support for a cx23416 mpeg encoder via cx2388x host port.
* "blackbird" reference design.
@@ -7,7 +7,7 @@
* (c) 2004 Jelle Foks <jelle@foks.8m.com>
* (c) 2004 Gerd Knorr <kraxel@bytesex.org>
*
- * Includes parts from the ivtv driver( http://ivtv.sourceforge.net/),
+ * Includes parts from the ivtv driver( http://ivtv.sourceforge.net/),
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -53,7 +53,7 @@ static LIST_HEAD(cx8802_devlist);
/* ------------------------------------------------------------------ */
-#define BLACKBIRD_FIRM_ENC_FILENAME "blackbird-fw-enc.bin"
+#define BLACKBIRD_FIRM_ENC_FILENAME "blackbird-fw-enc.bin"
#define BLACKBIRD_FIRM_IMAGE_SIZE 256*1024
/* defines below are from ivtv-driver.h */
@@ -104,12 +104,12 @@ static LIST_HEAD(cx8802_devlist);
static void host_setup(struct cx88_core *core)
{
- /* toggle reset of the host */
+ /* toggle reset of the host */
cx_write(MO_GPHST_SOFT_RST, 1);
udelay(100);
cx_write(MO_GPHST_SOFT_RST, 0);
udelay(100);
-
+
/* host port setup */
cx_write(MO_GPHST_WSC, 0x44444444U);
cx_write(MO_GPHST_XFR, 0);
@@ -178,9 +178,9 @@ static int memory_read(struct cx88_core *core, u32 address, u32 *value)
cx_writeb(P1_MADDR1, (unsigned int)(address >> 8));
cx_writeb(P1_MADDR0, (unsigned int)address);
cx_read(P1_MADDR0);
-
+
retval = wait_ready_gpio0_bit1(core,1);
-
+
cx_writeb(P1_MDATA3, 0);
val = (unsigned char)cx_read(P1_MDATA3) << 24;
cx_writeb(P1_MDATA2, 0);
@@ -245,7 +245,7 @@ static int blackbird_api_cmd(struct cx8802_dev *dev, u32 command,
int i;
va_list args;
va_start(args, outputcnt);
-
+
dprintk(1,"%s: 0x%X\n", __FUNCTION__, command);
/* this may not be 100% safe if we can't read any memory location
@@ -255,7 +255,7 @@ static int blackbird_api_cmd(struct cx8802_dev *dev, u32 command,
dprintk(0, "Firmware and/or mailbox pointer not initialized or corrupted\n");
return -1;
}
-
+
memory_read(dev->core, dev->mailbox, &flag);
if (flag) {
dprintk(0, "ERROR: Mailbox appears to be in use (%x)\n", flag);
@@ -264,7 +264,7 @@ static int blackbird_api_cmd(struct cx8802_dev *dev, u32 command,
flag |= 1; /* tell 'em we're working on it */
memory_write(dev->core, dev->mailbox, flag);
-
+
/* write command + args + fill remaining with zeros */
memory_write(dev->core, dev->mailbox + 1, command); /* command code */
memory_write(dev->core, dev->mailbox + 3, IVTV_API_STD_TIMEOUT); /* timeout */
@@ -299,7 +299,7 @@ static int blackbird_api_cmd(struct cx8802_dev *dev, u32 command,
dprintk(1, "API Output %d = %d\n", i, *vptr);
}
va_end(args);
-
+
memory_read(dev->core, dev->mailbox + 2, &retval);
dprintk(1, "API result = %d\n",retval);
@@ -330,7 +330,7 @@ static int blackbird_find_mailbox(struct cx8802_dev *dev)
dprintk(0, "Mailbox signature values not found!\n");
return -1;
}
-
+
static int blackbird_load_firmware(struct cx8802_dev *dev)
{
static const unsigned char magic[8] = {
@@ -341,17 +341,17 @@ static int blackbird_load_firmware(struct cx8802_dev *dev)
u32 value = 0;
u32 checksum = 0;
u32 *dataptr;
-
+
retval = register_write(dev->core, IVTV_REG_VPU, 0xFFFFFFED);
retval |= register_write(dev->core, IVTV_REG_HW_BLOCKS, IVTV_CMD_HW_BLOCKS_RST);
retval |= register_write(dev->core, IVTV_REG_ENC_SDRAM_REFRESH, 0x80000640);
retval |= register_write(dev->core, IVTV_REG_ENC_SDRAM_PRECHARGE, 0x1A);
msleep(1);
retval |= register_write(dev->core, IVTV_REG_APU, 0);
-
+
if (retval < 0)
dprintk(0, "Error with register_write\n");
-
+
retval = request_firmware(&firmware, BLACKBIRD_FIRM_ENC_FILENAME,
&dev->pci->dev);
if (retval != 0) {
@@ -361,7 +361,7 @@ static int blackbird_load_firmware(struct cx8802_dev *dev)
"not work without firmware loaded!\n");
return -1;
}
-
+
if (firmware->size != BLACKBIRD_FIRM_IMAGE_SIZE) {
dprintk(0, "ERROR: Firmware size mismatch (have %ld, expected %d)\n",
firmware->size, BLACKBIRD_FIRM_IMAGE_SIZE);
@@ -394,15 +394,15 @@ static int blackbird_load_firmware(struct cx8802_dev *dev)
}
release_firmware(firmware);
dprintk(0, "Firmware upload successful.\n");
-
+
retval |= register_write(dev->core, IVTV_REG_HW_BLOCKS, IVTV_CMD_HW_BLOCKS_RST);
retval |= register_read(dev->core, IVTV_REG_SPU, &value);
retval |= register_write(dev->core, IVTV_REG_SPU, value & 0xFFFFFFFE);
msleep(1);
-
+
retval |= register_read(dev->core, IVTV_REG_VPU, &value);
retval |= register_write(dev->core, IVTV_REG_VPU, value & 0xFFFFFFE8);
-
+
if (retval < 0)
dprintk(0, "Error with register_write\n");
return 0;
@@ -447,8 +447,8 @@ static void blackbird_codec_settings(struct cx8802_dev *dev)
blackbird_api_cmd(dev, IVTV_API_ASSIGN_3_2_PULLDOWN, 1, 0, 0);
/* note: it's not necessary to set the samplerate, the mpeg encoder seems to autodetect/adjust */
- blackbird_api_cmd(dev, IVTV_API_ASSIGN_AUDIO_PROPERTIES, 1, 0, (2<<2) | (8<<4));
-
+ blackbird_api_cmd(dev, IVTV_API_ASSIGN_AUDIO_PROPERTIES, 1, 0, (2<<2) | (8<<4));
+
/* assign gop closure */
blackbird_api_cmd(dev, IVTV_API_ASSIGN_GOP_CLOSURE, 1, 0, 0);
@@ -492,13 +492,13 @@ static int blackbird_initialize_codec(struct cx8802_dev *dev)
dev->mailbox = blackbird_find_mailbox(dev);
if (dev->mailbox < 0)
return -1;
-
+
retval = blackbird_api_cmd(dev, IVTV_API_ENC_PING_FW, 0, 0); /* ping */
if (retval < 0) {
dprintk(0, "ERROR: Firmware ping failed!\n");
return -1;
}
-
+
retval = blackbird_api_cmd(dev, IVTV_API_ENC_GETVER, 0, 1, &version);
if (retval < 0) {
dprintk(0, "ERROR: Firmware get encoder version failed!\n");
@@ -507,7 +507,7 @@ static int blackbird_initialize_codec(struct cx8802_dev *dev)
dprintk(0, "Firmware version is 0x%08x\n", version);
}
msleep(1);
-
+
cx_write(MO_PINMUX_IO, 0x88); /* 656-8bit IO and enable MPEG parallel IO */
cx_clear(MO_INPUT_FORMAT, 0x100); /* chroma subcarrier lock to normal? */
cx_write(MO_VBOS_CONTROL, 0x84A00); /* no 656 mode, 8-bit pixels, disable VBI */
@@ -525,14 +525,14 @@ static int blackbird_initialize_codec(struct cx8802_dev *dev)
blackbird_api_cmd(dev, IVTV_API_ASSIGN_PLACEHOLDER, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
blackbird_api_cmd(dev, IVTV_API_INITIALIZE_INPUT, 0, 0); /* initialize the video input */
-
+
msleep(1);
blackbird_api_cmd(dev, IVTV_API_MUTE_VIDEO, 1, 0, 0);
msleep(1);
blackbird_api_cmd(dev, IVTV_API_MUTE_AUDIO, 1, 0, 0);
msleep(1);
-
+
blackbird_api_cmd(dev, IVTV_API_BEGIN_CAPTURE, 2, 0, 0, 0x13); /* start capturing to the host interface */
//blackbird_api_cmd(dev, IVTV_API_BEGIN_CAPTURE, 2, 0, 0, 0); /* start capturing to the host interface */
msleep(1);
@@ -610,7 +610,7 @@ static int mpeg_do_ioctl(struct inode *inode, struct file *file,
index = f->index;
if (index != 0)
return -EINVAL;
-
+
memset(f,0,sizeof(*f));
f->index = index;
strlcpy(f->description, "MPEG TS", sizeof(f->description));
@@ -624,7 +624,7 @@ static int mpeg_do_ioctl(struct inode *inode, struct file *file,
{
/* FIXME -- quick'n'dirty for exactly one size ... */
struct v4l2_format *f = arg;
-
+
memset(f,0,sizeof(*f));
f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
f->fmt.pix.width = 720;
@@ -783,7 +783,7 @@ static void blackbird_unregister_video(struct cx8802_dev *dev)
static int blackbird_register_video(struct cx8802_dev *dev)
{
int err;
-
+
dev->mpeg_dev = cx88_vdev_init(dev->core,dev->pci,
&cx8802_mpeg_template,"mpeg");
err = video_register_device(dev->mpeg_dev,VFL_TYPE_GRABBER, -1);
@@ -850,7 +850,7 @@ static void __devexit blackbird_remove(struct pci_dev *pci_dev)
/* blackbird */
blackbird_unregister_video(dev);
list_del(&dev->devlist);
-
+
/* common */
cx8802_fini_common(dev);
}