summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorMichael Hunold <devnull@localhost>2003-07-17 09:03:24 +0000
committerMichael Hunold <devnull@localhost>2003-07-17 09:03:24 +0000
commit81117df4eb88a22c4f3e5ae030190c98ca033fc5 (patch)
tree17c10eccded78a2e277e4b73d6e796de56dc8116 /linux/drivers/media
parent8ea93347171a95476e21eaabd9ba31ae74f2d233 (diff)
downloadmediapointer-dvb-s2-81117df4eb88a22c4f3e5ae030190c98ca033fc5.tar.gz
mediapointer-dvb-s2-81117df4eb88a22c4f3e5ae030190c98ca033fc5.tar.bz2
[V4L] - fix static build for hexium_gemini and hexium_orion drivers (Thanks to Adrian Bunk <bunk@fs.tum.de> for reporting this)
[V4L] - set debug verbosity to 0 for hexium_gemini and hexium_orion drivers [V4L] - make hexium_gemini and hexium_orion drivers depdend on i2c module [V4L] - make saa7146 module depend on hexium_gemini and hexium_orion drivers [V4L] - let the saa7146 i2c bus report itself as I2C_ADAP_CLASS_TV_ANALOG
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/common/Kconfig6
-rw-r--r--linux/drivers/media/common/saa7146_i2c.c1
-rw-r--r--linux/drivers/media/common/saa7146_video.c14
-rw-r--r--linux/drivers/media/video/hexium_gemini.c419
-rw-r--r--linux/drivers/media/video/hexium_gemini.h227
-rw-r--r--linux/drivers/media/video/hexium_orion.c277
-rw-r--r--linux/drivers/media/video/hexium_orion.h49
7 files changed, 357 insertions, 636 deletions
diff --git a/linux/drivers/media/common/Kconfig b/linux/drivers/media/common/Kconfig
index 844e82dff..1a6b17203 100644
--- a/linux/drivers/media/common/Kconfig
+++ b/linux/drivers/media/common/Kconfig
@@ -1,8 +1,8 @@
config VIDEO_SAA7146
tristate
- default y if DVB_AV7110=y || DVB_BUDGET=y || DVB_BUDGET_AV=y || VIDEO_MXB=y || VIDEO_DPC=y
- default m if DVB_AV7110=m || DVB_BUDGET=m || DVB_BUDGET_AV=m || VIDEO_MXB=m || VIDEO_DPC=m
- depends on VIDEO_DEV && PCI
+ default y if DVB_AV7110=y || DVB_BUDGET=y || DVB_BUDGET_AV=y || VIDEO_MXB=y || VIDEO_DPC=y || VIDEO_HEXIUM_ORION=y || VIDEO_HEXIUM_GEMINI=y
+ default m if DVB_AV7110=m || DVB_BUDGET=m || DVB_BUDGET_AV=m || VIDEO_MXB=m || VIDEO_DPC=m || VIDEO_HEXIUM_ORION=m || VIDEO_HEXIUM_GEMINI=m
+ depends on VIDEO_DEV && PCI && I2C
config VIDEO_VIDEOBUF
tristate
diff --git a/linux/drivers/media/common/saa7146_i2c.c b/linux/drivers/media/common/saa7146_i2c.c
index d904deae5..e9c1435b6 100644
--- a/linux/drivers/media/common/saa7146_i2c.c
+++ b/linux/drivers/media/common/saa7146_i2c.c
@@ -419,6 +419,7 @@ int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c
i2c_adapter->id = I2C_ALGO_SAA7146;
i2c_adapter->timeout = SAA7146_I2C_TIMEOUT;
i2c_adapter->retries = SAA7146_I2C_RETRIES;
+ i2c_adapter->class = I2C_ADAP_CLASS_TV_ANALOG;
}
return 0;
diff --git a/linux/drivers/media/common/saa7146_video.c b/linux/drivers/media/common/saa7146_video.c
index 502ffbc2c..921622aad 100644
--- a/linux/drivers/media/common/saa7146_video.c
+++ b/linux/drivers/media/common/saa7146_video.c
@@ -1045,12 +1045,18 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
return videobuf_querybuf(q,arg);
}
case VIDIOC_QBUF: {
- DEB_D(("VIDIOC_QBUF \n"));
- return videobuf_qbuf(file,q,arg);
+ struct v4l2_buffer *b = arg;
+ int ret = 0;
+ ret = videobuf_qbuf(file,q,b);
+ DEB_D(("VIDIOC_QBUF: ret:%d, index:%d\n",ret,b->index));
+ return ret;
}
case VIDIOC_DQBUF: {
- DEB_D(("VIDIOC_DQBUF \n"));
- return videobuf_dqbuf(file,q,arg);
+ struct v4l2_buffer *b = arg;
+ int ret = 0;
+ ret = videobuf_dqbuf(file,q,b);
+ DEB_D(("VIDIOC_DQBUF: ret:%d, index:%d\n",ret,b->index));
+ return ret;
}
case VIDIOC_STREAMON: {
DEB_D(("VIDIOC_STREAMON \n"));
diff --git a/linux/drivers/media/video/hexium_gemini.c b/linux/drivers/media/video/hexium_gemini.c
index a82de4752..e204d1525 100644
--- a/linux/drivers/media/video/hexium_gemini.c
+++ b/linux/drivers/media/video/hexium_gemini.c
@@ -1,8 +1,8 @@
/*
hexium_gemini.c - v4l2 driver for Hexium Gemini frame grabber cards
- Visit http://www.mihu.de/linux/saa7146/hexium/
- for further details about this card.
+ Visit http://www.mihu.de/linux/saa7146/ and follow the link
+ to "hexium" for further details about this card.
Copyright (C) 2003 Michael Hunold <michael@mihu.de>
@@ -25,12 +25,12 @@
#include <media/saa7146_vv.h>
-static int debug = 255;
-MODULE_PARM(debug,"i");
+static int debug = 0;
+MODULE_PARM(debug, "i");
MODULE_PARM_DESC(debug, "debug verbosity");
/* global variables */
-int hexium_num = 0;
+static int hexium_num = 0;
#include "hexium_gemini.h"
@@ -38,80 +38,80 @@ int hexium_num = 0;
wants to capture from this device before it has been properly initialized.
the capture engine would badly fail, because no valid signal arrives on the
saa7146, thus leading to timeouts and stuff. */
-static int hexium_init_done(struct saa7146_dev* dev)
+static int hexium_init_done(struct saa7146_dev *dev)
{
- struct hexium* hexium = (struct hexium*)dev->ext_priv;
+ struct hexium *hexium = (struct hexium *) dev->ext_priv;
union i2c_smbus_data data;
int i = 0;
DEB_D(("hexium_init_done called.\n"));
/* initialize the helper ics to useful values */
- for(i = 0; i < sizeof(hexium_ks0127b); i++) {
- data.byte = hexium_ks0127b[i];
- if(0 != i2c_smbus_xfer(&hexium->i2c_adapter, 0x6c, 0, I2C_SMBUS_WRITE, i ,I2C_SMBUS_BYTE_DATA, &data)) {
- printk("failed for address 0x%02x\n",i);
- }
+ for (i = 0; i < sizeof(hexium_ks0127b); i++) {
+ data.byte = hexium_ks0127b[i];
+ if (0 != i2c_smbus_xfer(&hexium->i2c_adapter, 0x6c, 0, I2C_SMBUS_WRITE, i, I2C_SMBUS_BYTE_DATA, &data)) {
+ printk("failed for address 0x%02x\n", i);
+ }
}
return 0;
}
-static int hexium_set_input(struct hexium* hexium, int input)
+static int hexium_set_input(struct hexium *hexium, int input)
{
union i2c_smbus_data data;
DEB_D((".\n"));
data.byte = hexium_input_select[input].byte;
- if(0 != i2c_smbus_xfer(&hexium->i2c_adapter, 0x6c, 0, I2C_SMBUS_WRITE, hexium_input_select[input].adr, I2C_SMBUS_BYTE_DATA, &data)) {
- return -1;
+ if (0 != i2c_smbus_xfer(&hexium->i2c_adapter, 0x6c, 0, I2C_SMBUS_WRITE, hexium_input_select[input].adr, I2C_SMBUS_BYTE_DATA, &data)) {
+ return -1;
}
-
+
return 0;
}
-static int hexium_set_standard(struct hexium* hexium, struct hexium_data *vdec)
+static int hexium_set_standard(struct hexium *hexium, struct hexium_data *vdec)
{
union i2c_smbus_data data;
int i = 0;
-
+
DEB_D((".\n"));
- while( vdec[i].adr != -1 ) {
+ while (vdec[i].adr != -1) {
data.byte = vdec[i].byte;
- if(0 != i2c_smbus_xfer(&hexium->i2c_adapter, 0x6c, 0, I2C_SMBUS_WRITE, vdec[i].adr ,I2C_SMBUS_BYTE_DATA, &data)) {
- printk("failed for address 0x%02x\n",i);
- return -1;
+ if (0 != i2c_smbus_xfer(&hexium->i2c_adapter, 0x6c, 0, I2C_SMBUS_WRITE, vdec[i].adr, I2C_SMBUS_BYTE_DATA, &data)) {
+ printk("failed for address 0x%02x\n", i);
+ return -1;
}
i++;
}
- return 0;
+ return 0;
}
static struct saa7146_ext_vv vv_data;
/* this function only gets called when the probing was successful */
-static int hexium_attach(struct saa7146_dev* dev, struct saa7146_pci_extension_data *info)
+static int hexium_attach(struct saa7146_dev *dev, struct saa7146_pci_extension_data *info)
{
- struct hexium* hexium = (struct hexium*)dev->ext_priv;
-
+ struct hexium *hexium = (struct hexium *) dev->ext_priv;
+
DEB_EE((".\n"));
- hexium = (struct hexium*)kmalloc(sizeof(struct hexium), GFP_KERNEL);
- if( NULL == hexium ) {
+ hexium = (struct hexium *) kmalloc(sizeof(struct hexium), GFP_KERNEL);
+ if (NULL == hexium) {
printk("hexium_v4l2.o: hexium_probe: not enough kernel memory.\n");
return -ENOMEM;
}
- memset(hexium, 0x0, sizeof(struct hexium));
- (struct hexium*)dev->ext_priv = hexium;
+ memset(hexium, 0x0, sizeof(struct hexium));
+ (struct hexium *) dev->ext_priv = hexium;
/* FIXME: enable i2c-port pins, video-port-pins
video port pins should be enabled here ?! */
saa7146_write(dev, MC1, (MASK_08 | MASK_24 | MASK_10 | MASK_26));
saa7146_i2c_adapter_prepare(dev, &hexium->i2c_adapter, SAA7146_I2C_BUS_BIT_RATE_480);
- if(i2c_add_adapter(&hexium->i2c_adapter) < 0) {
+ if (i2c_add_adapter(&hexium->i2c_adapter) < 0) {
DEB_S(("cannot register i2c-device. skipping.\n"));
kfree(hexium);
return -EFAULT;
@@ -119,9 +119,9 @@ static int hexium_attach(struct saa7146_dev* dev, struct saa7146_pci_extension_d
/* set HWControl GPIO number 2 */
saa7146_setgpio(dev, 2, SAA7146_GPIO_OUTHI);
-
+
saa7146_write(dev, DD1_INIT, 0x07000700);
- saa7146_write(dev, DD1_STREAM_B, 0x00000000);
+ saa7146_write(dev, DD1_STREAM_B, 0x00000000);
saa7146_write(dev, MC2, (MASK_09 | MASK_25 | MASK_10 | MASK_26));
/* the rest */
@@ -130,29 +130,29 @@ static int hexium_attach(struct saa7146_dev* dev, struct saa7146_pci_extension_d
hexium_set_standard(hexium, hexium_pal);
hexium->cur_std = V4L2_STD_PAL;
-
+
hexium_set_input(hexium, 0);
hexium->cur_input = 0;
-
- saa7146_vv_init(dev,&vv_data);
- if( 0 != saa7146_register_device(&hexium->video_dev, dev, "hexium", VFL_TYPE_GRABBER)) {
+
+ saa7146_vv_init(dev, &vv_data);
+ if (0 != saa7146_register_device(&hexium->video_dev, dev, "hexium", VFL_TYPE_GRABBER)) {
ERR(("cannot register capture v4l2 device. skipping.\n"));
return -1;
}
-
- printk("hexium: found 'hexium frame grabber'-%d.\n",hexium_num);
+
+ printk("hexium: found 'hexium frame grabber'-%d.\n", hexium_num);
hexium_num++;
-
+
return 0;
}
-static int hexium_detach(struct saa7146_dev* dev)
+static int hexium_detach(struct saa7146_dev *dev)
{
- struct hexium* hexium = (struct hexium*)dev->ext_priv;
-
- DEB_EE(("dev:%p\n",dev));
+ struct hexium *hexium = (struct hexium *) dev->ext_priv;
- saa7146_unregister_device(&hexium->video_dev,dev);
+ DEB_EE(("dev:%p\n", dev));
+
+ saa7146_unregister_device(&hexium->video_dev, dev);
saa7146_vv_release(dev);
hexium_num--;
@@ -162,145 +162,144 @@ static int hexium_detach(struct saa7146_dev* dev)
return 0;
}
-static int hexium_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
+static int hexium_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
{
struct saa7146_dev *dev = fh->dev;
- struct hexium* hexium = (struct hexium*)dev->ext_priv;
+ struct hexium *hexium = (struct hexium *) dev->ext_priv;
/*
struct saa7146_vv *vv = dev->vv_data;
*/
- switch(cmd)
- {
+ switch (cmd) {
case VIDIOC_ENUMINPUT:
- {
- struct v4l2_input *i = arg;
- DEB_EE(("VIDIOC_ENUMINPUT %d.\n",i->index));
-
- if( i->index < 0 || i->index >= HEXIUM_INPUTS) {
- return -EINVAL;
- }
-
- memcpy(i, &hexium_inputs[i->index], sizeof(struct v4l2_input));
+ {
+ struct v4l2_input *i = arg;
+ DEB_EE(("VIDIOC_ENUMINPUT %d.\n", i->index));
- DEB_D(("v4l2_ioctl: VIDIOC_ENUMINPUT %d.\n",i->index));
- return 0;
- }
+ if (i->index < 0 || i->index >= HEXIUM_INPUTS) {
+ return -EINVAL;
+ }
+
+ memcpy(i, &hexium_inputs[i->index], sizeof(struct v4l2_input));
+
+ DEB_D(("v4l2_ioctl: VIDIOC_ENUMINPUT %d.\n", i->index));
+ return 0;
+ }
case VIDIOC_G_INPUT:
- {
- int *input = (int *)arg;
- *input = hexium->cur_input;
+ {
+ int *input = (int *) arg;
+ *input = hexium->cur_input;
- DEB_D(("VIDIOC_G_INPUT: %d\n",*input));
- return 0;
- }
+ DEB_D(("VIDIOC_G_INPUT: %d\n", *input));
+ return 0;
+ }
case VIDIOC_S_INPUT:
- {
- int input = *(int *)arg;
+ {
+ int input = *(int *) arg;
- DEB_EE(("VIDIOC_S_INPUT %d.\n",input));
+ DEB_EE(("VIDIOC_S_INPUT %d.\n", input));
- if (input < 0 || input >= HEXIUM_INPUTS) {
- return -EINVAL;
+ if (input < 0 || input >= HEXIUM_INPUTS) {
+ return -EINVAL;
+ }
+
+ hexium->cur_input = input;
+ hexium_set_input(hexium, input);
+
+ return 0;
}
-
- hexium->cur_input = input;
- hexium_set_input(hexium, input);
-
- return 0;
- }
- /* the saa7146 provides some controls (brightness, contrast, saturation)
- which gets registered *after* this function. because of this we have
- to return with a value != 0 even if the function succeded.. */
+ /* the saa7146 provides some controls (brightness, contrast, saturation)
+ which gets registered *after* this function. because of this we have
+ to return with a value != 0 even if the function succeded.. */
case VIDIOC_QUERYCTRL:
- {
- struct v4l2_queryctrl *qc = arg;
- int i;
-
- for (i = HEXIUM_CONTROLS - 1; i >= 0; i--) {
- if (hexium_controls[i].id == qc->id) {
- *qc = hexium_controls[i];
- DEB_D(("VIDIOC_QUERYCTRL %d.\n",qc->id));
- return 0;
+ {
+ struct v4l2_queryctrl *qc = arg;
+ int i;
+
+ for (i = HEXIUM_CONTROLS - 1; i >= 0; i--) {
+ if (hexium_controls[i].id == qc->id) {
+ *qc = hexium_controls[i];
+ DEB_D(("VIDIOC_QUERYCTRL %d.\n", qc->id));
+ return 0;
+ }
}
+ return -EAGAIN;
}
- return -EAGAIN;
- }
case VIDIOC_G_CTRL:
- {
- struct v4l2_control *vc = arg;
- int i;
+ {
+ struct v4l2_control *vc = arg;
+ int i;
+
+ for (i = HEXIUM_CONTROLS - 1; i >= 0; i--) {
+ if (hexium_controls[i].id == vc->id) {
+ break;
+ }
+ }
- for (i = HEXIUM_CONTROLS - 1; i >= 0; i--) {
- if (hexium_controls[i].id == vc->id) {
- break;
+ if (i < 0) {
+ return -EAGAIN;
}
- }
-
- if( i < 0 ) {
- return -EAGAIN;
- }
-
- switch (vc->id ) {
- case V4L2_CID_PRIVATE_BASE: {
- vc->value = hexium->cur_bw;
- DEB_D(("VIDIOC_G_CTRL BW:%d.\n",vc->value));
- return 0;
+
+ switch (vc->id) {
+ case V4L2_CID_PRIVATE_BASE:{
+ vc->value = hexium->cur_bw;
+ DEB_D(("VIDIOC_G_CTRL BW:%d.\n", vc->value));
+ return 0;
+ }
}
+ return -EINVAL;
}
- return -EINVAL;
- }
case VIDIOC_S_CTRL:
- {
- struct v4l2_control *vc = arg;
- int i = 0;
-
- for (i = HEXIUM_CONTROLS - 1; i >= 0; i--) {
- if (hexium_controls[i].id == vc->id) {
- break;
+ {
+ struct v4l2_control *vc = arg;
+ int i = 0;
+
+ for (i = HEXIUM_CONTROLS - 1; i >= 0; i--) {
+ if (hexium_controls[i].id == vc->id) {
+ break;
+ }
}
- }
-
- if( i < 0 ) {
- return -EAGAIN;
- }
-
- switch (vc->id ) {
- case V4L2_CID_PRIVATE_BASE: {
- hexium->cur_bw = vc->value;
- break;
+
+ if (i < 0) {
+ return -EAGAIN;
+ }
+
+ switch (vc->id) {
+ case V4L2_CID_PRIVATE_BASE:{
+ hexium->cur_bw = vc->value;
+ break;
+ }
+ }
+
+ DEB_D(("VIDIOC_S_CTRL BW:%d.\n", hexium->cur_bw));
+
+ if (0 == hexium->cur_bw && V4L2_STD_PAL == hexium->cur_std) {
+ hexium_set_standard(hexium, hexium_pal);
+ return 0;
+ }
+ if (0 == hexium->cur_bw && V4L2_STD_NTSC == hexium->cur_std) {
+ hexium_set_standard(hexium, hexium_ntsc);
+ return 0;
+ }
+ if (0 == hexium->cur_bw && V4L2_STD_SECAM == hexium->cur_std) {
+ hexium_set_standard(hexium, hexium_secam);
+ return 0;
+ }
+ if (1 == hexium->cur_bw && V4L2_STD_PAL == hexium->cur_std) {
+ hexium_set_standard(hexium, hexium_pal_bw);
+ return 0;
+ }
+ if (1 == hexium->cur_bw && V4L2_STD_NTSC == hexium->cur_std) {
+ hexium_set_standard(hexium, hexium_ntsc_bw);
+ return 0;
+ }
+ if (1 == hexium->cur_bw && V4L2_STD_SECAM == hexium->cur_std) {
+ /* fixme: is there no bw secam mode? */
+ return -EINVAL;
}
- }
-
- DEB_D(("VIDIOC_S_CTRL BW:%d.\n",hexium->cur_bw));
- if( 0 == hexium->cur_bw && V4L2_STD_PAL == hexium->cur_std ) {
- hexium_set_standard(hexium, hexium_pal);
- return 0;
- }
- if( 0 == hexium->cur_bw && V4L2_STD_NTSC == hexium->cur_std ) {
- hexium_set_standard(hexium, hexium_ntsc);
- return 0;
- }
- if( 0 == hexium->cur_bw && V4L2_STD_SECAM == hexium->cur_std ) {
- hexium_set_standard(hexium, hexium_secam);
- return 0;
- }
- if( 1 == hexium->cur_bw && V4L2_STD_PAL == hexium->cur_std ) {
- hexium_set_standard(hexium, hexium_pal_bw);
- return 0;
- }
- if( 1 == hexium->cur_bw && V4L2_STD_NTSC == hexium->cur_std ) {
- hexium_set_standard(hexium, hexium_ntsc_bw);
- return 0;
- }
- if( 1 == hexium->cur_bw && V4L2_STD_SECAM == hexium->cur_std ) {
- /* fixme: is there no bw secam mode? */
return -EINVAL;
}
-
- return -EINVAL;
- }
default:
/*
DEB_D(("v4l2_ioctl does not handle this ioctl.\n"));
@@ -310,19 +309,19 @@ static int hexium_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
return 0;
}
-static int std_callback(struct saa7146_dev* dev, struct saa7146_standard *std)
+static int std_callback(struct saa7146_dev *dev, struct saa7146_standard *std)
{
- struct hexium* hexium = (struct hexium*)dev->ext_priv;
+ struct hexium *hexium = (struct hexium *) dev->ext_priv;
- if(V4L2_STD_PAL == std->id ) {
+ if (V4L2_STD_PAL == std->id) {
hexium_set_standard(hexium, hexium_pal);
hexium->cur_std = V4L2_STD_PAL;
return 0;
- } else if (V4L2_STD_NTSC == std->id ) {
+ } else if (V4L2_STD_NTSC == std->id) {
hexium_set_standard(hexium, hexium_ntsc);
hexium->cur_std = V4L2_STD_NTSC;
return 0;
- } else if (V4L2_STD_SECAM == std->id ) {
+ } else if (V4L2_STD_SECAM == std->id) {
hexium_set_standard(hexium, hexium_secam);
hexium->cur_std = V4L2_STD_SECAM;
return 0;
@@ -331,79 +330,75 @@ static int std_callback(struct saa7146_dev* dev, struct saa7146_standard *std)
return -1;
}
-static
-struct saa7146_extension hexium_extension;
+static struct saa7146_extension hexium_extension;
-static
-struct saa7146_pci_extension_data hexium_gemini_4bnc = {
- .ext_priv = "Hexium Gemini (4 BNC)",
- .ext = &hexium_extension,
+static struct saa7146_pci_extension_data hexium_gemini_4bnc = {
+ .ext_priv = "Hexium Gemini (4 BNC)",
+ .ext = &hexium_extension,
};
-static
-struct saa7146_pci_extension_data hexium_gemini_dual_4bnc = {
- .ext_priv = "Hexium Gemini Dual (4 BNC)",
- .ext = &hexium_extension,
+static struct saa7146_pci_extension_data hexium_gemini_dual_4bnc = {
+ .ext_priv = "Hexium Gemini Dual (4 BNC)",
+ .ext = &hexium_extension,
};
-static
-struct pci_device_id pci_tbl[] = {
+static struct pci_device_id pci_tbl[] = {
{
- .vendor = PCI_VENDOR_ID_PHILIPS,
- .device = PCI_DEVICE_ID_PHILIPS_SAA7146,
- .subvendor = 0x17c8,
- .subdevice = 0x2401,
- .driver_data = (unsigned long)&hexium_gemini_4bnc,
- }, {
- .vendor = PCI_VENDOR_ID_PHILIPS,
- .device = PCI_DEVICE_ID_PHILIPS_SAA7146,
- .subvendor = 0x17c8,
- .subdevice = 0x2402,
- .driver_data = (unsigned long)&hexium_gemini_dual_4bnc,
- }, {
- .vendor = 0,
- }
+ .vendor = PCI_VENDOR_ID_PHILIPS,
+ .device = PCI_DEVICE_ID_PHILIPS_SAA7146,
+ .subvendor = 0x17c8,
+ .subdevice = 0x2401,
+ .driver_data = (unsigned long) &hexium_gemini_4bnc,
+ },
+ {
+ .vendor = PCI_VENDOR_ID_PHILIPS,
+ .device = PCI_DEVICE_ID_PHILIPS_SAA7146,
+ .subvendor = 0x17c8,
+ .subdevice = 0x2402,
+ .driver_data = (unsigned long) &hexium_gemini_dual_4bnc,
+ },
+ {
+ .vendor = 0,
+ }
};
MODULE_DEVICE_TABLE(pci, pci_tbl);
-static
-struct saa7146_ext_vv vv_data = {
- .inputs = HEXIUM_INPUTS,
- .capabilities = 0,
- .stds = &hexium_standards[0],
- .num_stds = sizeof(hexium_standards)/sizeof(struct saa7146_standard),
- .std_callback = &std_callback,
- .ioctls = &ioctls[0],
- .ioctl = hexium_ioctl,
+static struct saa7146_ext_vv vv_data = {
+ .inputs = HEXIUM_INPUTS,
+ .capabilities = 0,
+ .stds = &hexium_standards[0],
+ .num_stds = sizeof(hexium_standards) / sizeof(struct saa7146_standard),
+ .std_callback = &std_callback,
+ .ioctls = &ioctls[0],
+ .ioctl = hexium_ioctl,
};
-static
-struct saa7146_extension hexium_extension = {
- .name = "hexium gemini",
- .flags = SAA7146_USE_I2C_IRQ,
-
- .pci_tbl = &pci_tbl[0],
- .module = THIS_MODULE,
+static struct saa7146_extension hexium_extension = {
+ .name = "hexium gemini",
+ .flags = SAA7146_USE_I2C_IRQ,
- .attach = hexium_attach,
- .detach = hexium_detach,
+ .pci_tbl = &pci_tbl[0],
+ .module = THIS_MODULE,
- .irq_mask = 0,
- .irq_func = NULL,
-};
+ .attach = hexium_attach,
+ .detach = hexium_detach,
-int __init hexium_init_module(void)
+ .irq_mask = 0,
+ .irq_func = NULL,
+};
+
+static int __init hexium_init_module(void)
{
- if( 0 != saa7146_register_extension(&hexium_extension)) {
+ if (0 != saa7146_register_extension(&hexium_extension)) {
DEB_S(("failed to register extension.\n"));
return -ENODEV;
}
-
+
return 0;
}
-void __exit hexium_cleanup_module(void)
+static void __exit hexium_cleanup_module(void)
{
saa7146_unregister_extension(&hexium_extension);
}
diff --git a/linux/drivers/media/video/hexium_gemini.h b/linux/drivers/media/video/hexium_gemini.h
index d7a9627d4..8f169aed0 100644
--- a/linux/drivers/media/video/hexium_gemini.h
+++ b/linux/drivers/media/video/hexium_gemini.h
@@ -100,231 +100,4 @@ static struct hexium_data hexium_input_select[] = {
{ 0x02, 0x69 },
{ 0x02, 0x6A },
};
-
-#ifdef axa
-
-#define KS0127BINPUT_NONE SAA7110INPUT_NONE // input channel not specified
-#define KS0127BINPUT_AY0 1 // 0127B input channel Y0 definition
-#define KS0127BINPUT_AY1 2 // 0127B input channel Y1 definition
-#define KS0127BINPUT_AY2 3 // 0127B input channel Y2 definition
-#define KS0127BINPUT_AC0 4 // 0127B input channel C0 definition
-#define KS0127BINPUT_AC1 5 // 0127B input channel C1 definition
-#define KS0127BINPUT_AC2 6 // 0127B input channel C2 definition
-static const INPUTMODE inputmode0127b[MODENUM]={
-{KS0127BINPUT_AY0,KS0127BINPUT_NONE}, // 0 CVBS1
-{KS0127BINPUT_AC0,KS0127BINPUT_NONE}, // 1 CVBS2
-{KS0127BINPUT_AY1,KS0127BINPUT_NONE}, // 2 CVBS3
-{KS0127BINPUT_AC1,KS0127BINPUT_NONE}, // 3 CVBS4
-{KS0127BINPUT_AY2,KS0127BINPUT_NONE}, // 4 CVBS5
-{KS0127BINPUT_AC2,KS0127BINPUT_NONE}, // 5 CVBS6
-{KS0127BINPUT_AY0,KS0127BINPUT_AC0}, // 6 CVBS1
-{KS0127BINPUT_AY1,KS0127BINPUT_AC1}, // 7 CVBS2
-{KS0127BINPUT_AY2,KS0127BINPUT_AC2}, // 8 CVBS3
-};
-
-// -------------------------------------------------------------------------
-// AGC handling functions
-// -------------------------------------------------------------------------
-BYTE SAA7146::ValidateReg0127(int regnum,BYTE Value)
-{
-switch(regnum) {
-case 0x02:
-if (fAGC==false) Value|=0x10; // AGCFRZ AGCOFF
-break;
-case 0x12:
-if (fAGC==false) Value|=0x00; // ACCFRZ AGCOFF
-break;
-case 0x15:
-if (fAGC==false) Value|=0x80; // SATBIT AGCOFF
-break;
-case 0x29:
-if (fAGC==false) Value|=0x40; // TSTCGN AGCOFF
-break;
-}
-return(Value);
-}
-
-#define SAA7110INPUT_NONE 0 /* input channel not specified */
-#define SAA7110INPUT_AI21 1 /* 7110 input channel AI21 definition */
-#define SAA7110INPUT_AI22 2 /* 7110 input channel AI22 definition */
-#define SAA7110INPUT_AI31 3 /* 7110 input channel AI31 definition */
-#define SAA7110INPUT_AI32 4 /* 7110 input channel AI32 definition */
-#define SAA7110INPUT_AI41 5 /* 7110 input channel AI41 definition */
-#define SAA7110INPUT_AI42 6 /* 7110 input channel AI42 definition */
-
-static inputmode7110[MODENUM]={
- {SAA7110INPUT_AI21,SAA7110INPUT_NONE}, // 0 CVBS1
- {SAA7110INPUT_AI22,SAA7110INPUT_NONE}, // 1 CVBS2
- {SAA7110INPUT_AI31,SAA7110INPUT_NONE}, // 2 CVBS3
- {SAA7110INPUT_AI32,SAA7110INPUT_NONE}, // 3 CVBS4
- {SAA7110INPUT_AI41,SAA7110INPUT_NONE}, // 4 CVBS5
- {SAA7110INPUT_AI42,SAA7110INPUT_NONE}, // 5 CVBS6
- {SAA7110INPUT_AI21,SAA7110INPUT_AI42}, // 6 Y1,C1
- {SAA7110INPUT_AI31,SAA7110INPUT_AI22}, // 7 Y2,C2
- {SAA7110INPUT_AI41,SAA7110INPUT_AI32} // 8 Y3,C3
-
-};
-// -------------------------------------------------------------------------
-// Camera select tables (based on SAA7110.pdf input modes)
-// -------------------------------------------------------------------------
-typedef struct REGISTER {
-//public:
-int address;
-BYTE value;
-} _REGISTER;
-static const REGISTER camtable7110_0[]={ // Mode 0
-{ 0x06, 0x00 },
-{ 0x20, 0xD9 },
-{ 0x21, 0x17 },//0x16,
-{ 0x22, 0x40 },
-{ 0x2C, 0x03 },
-{ 0x30, 0x44 },
-{ 0x31, 0x75 }, //??
-{ 0x21, 0x16 }, //0x03,
-{ -1 , 0xFF }
-};
-static const REGISTER camtable7110_1[]={ // Mode 1
-{ 0x06, 0x00 },
-{ 0x20, 0xD8 },
-{ 0x21, 0x17 },//0x16,
-{ 0x22, 0x40 },
-{ 0x2C, 0x03 },
-{ 0x30, 0x44 },
-{ 0x31, 0x75 }, //??
-{ 0x21, 0x16 },//0x03,
-{ -1 , 0xFF }
-};
-static const REGISTER camtable7110_2[]={ // Mode 2
-{ 0x06, 0x00 },
-{ 0x20, 0xBA },
-{ 0x21, 0x07 },//0x05,
-{ 0x22, 0x91 },
-{ 0x2C, 0x03 },
-{ 0x30, 0x60 },
-{ 0x31, 0xB5 }, //??
-{ 0x21, 0x05 },//0x03,
-{ -1 , 0xFF }
-};
-static const REGISTER camtable7110_3[]={ // Mode 3
-{ 0x06, 0x00 },
-{ 0x20, 0xB8 },
-{ 0x21, 0x07 },//0x05,
-{ 0x22, 0x91 },
-{ 0x2C, 0x03 },
-{ 0x30, 0x60 },
-{ 0x31, 0xB5 }, //??
-{ 0x21, 0x05 },//0x03,
-{ -1 , 0xFF }
-};
-static const REGISTER camtable7110_4[]={ // Mode 4
-{ 0x06, 0x00 },
-{ 0x20, 0x7C },
-{ 0x21, 0x07 }, // 0x03
-{ 0x22, 0xD2 },
-{ 0x2C, 0x83 },
-{ 0x30, 0x60 },
-{ 0x31, 0xB5 }, //?
-{ 0x21, 0x03 },
-{ -1 , 0xFF }
-};
-static const REGISTER camtable7110_5[]={ // Mode 5
-{ 0x06, 0x00 },
-{ 0x20, 0x78 },
-{ 0x21, 0x07 },//0x03,
-{ 0x22, 0xD2 },
-{ 0x2C, 0x83 },
-{ 0x30, 0x60 },
-{ 0x31, 0xB5 }, //?
-{ 0x21, 0x03 },
-{ -1 , 0xFF }
-};
-static const REGISTER camtable7110_6[]={ // Mode 6
-{ 0x06, 0x80 },
-{ 0x20, 0x59 },
-{ 0x21, 0x17 },
-{ 0x22, 0x42 },
-{ 0x2C, 0xA3 },
-{ 0x30, 0x44 },
-{ 0x31, 0x75 },
-{ 0x21, 0x12 },
-{ -1 , 0xFF }
-};
-static const REGISTER camtable7110_7[]={ // Mode 7
-{ 0x06, 0x80 },
-{ 0x20, 0x9A },
-{ 0x21, 0x17 },
-{ 0x22, 0xB1 },
-{ 0x2C, 0x13 },
-{ 0x30, 0x60 },
-{ 0x31, 0xB5 },
-{ 0x21, 0x14 },
-{ -1 , 0xFF }
-};
-static const REGISTER camtable7110_8[]={ // Mode 8
-{ 0x06, 0x80 },
-{ 0x20, 0x3C },
-{ 0x21, 0x27 },
-{ 0x22, 0xC1 },
-{ 0x2C, 0x23 },
-{ 0x30, 0x44 },
-{ 0x31, 0x75 },
-{ 0x21, 0x21 },
-{ -1 , 0xFF }
-};
-// Camera mode tables xref
-static const REGISTER *camselect7110[MODENUM]={
-camtable7110_0,
-camtable7110_1,
-camtable7110_2,
-camtable7110_3,
-camtable7110_4,
-camtable7110_5,
-camtable7110_6,
-camtable7110_7,
-camtable7110_8
-};
-// Camera signal select tables (based on SAA7110 pdf)
-// -------------------------------------------------------------------------
-static const REGISTER sigtable7110_bw60[]={ // B/W NTSC
-{ 0x06, 0x80 },
-{ 0x2E, 0x81 },
-{ -1 , 0xFF }
-};
-static const REGISTER sigtable7110_bw50[]={ // B/W PAL
-{ 0x06, 0x80 },
-{ 0x2E, 0x9A },
-{ -1 , 0xFF }
-};
-static const REGISTER sigtable7110_ntsc[]={ // Color NTSC
-{ 0x0D, 0x86 },
-{ 0x11, 0x2C },
-{ 0x2E, 0x81 },
-{ -1 , 0xFF }
-};
-static const REGISTER sigtable7110_pal[]={ // PAL
-{ 0x0D, 0x86 },
-{ 0x11, 0x59 },
-{ 0x2E, 0x9A },
-{ -1 , 0xFF }
-};
-static const REGISTER sigtable7110_secam[]={ // SECAM
-{ 0x0D, 0x87 },
-{ 0x11, 0x59 },
-{ 0x2E, 0x9A },
-{ -1 , 0xFF }
-};
-// -------------------------------------------------------------------------
-// AGC handling functions
-// -------------------------------------------------------------------------
-BYTE SAA7146::ValidateReg7110(int regnum,BYTE Value)
-{
-switch(regnum) {
-case 0x22:
-if (fAGC==false) Value&=0x3F; // AGC OFF
-break;
-}
-return(Value);
-}
-
-#endif
#endif
diff --git a/linux/drivers/media/video/hexium_orion.c b/linux/drivers/media/video/hexium_orion.c
index 8482741ab..7009f0ec8 100644
--- a/linux/drivers/media/video/hexium_orion.c
+++ b/linux/drivers/media/video/hexium_orion.c
@@ -1,8 +1,8 @@
/*
hexium_orion.c - v4l2 driver for the Hexium Orion frame grabber cards
-
- Visit http://www.mihu.de/linux/saa7146/hexium/
- for further details about this card.
+
+ Visit http://www.mihu.de/linux/saa7146/ and follow the link
+ to "hexium" for further details about this card.
Copyright (C) 2003 Michael Hunold <michael@mihu.de>
@@ -25,8 +25,8 @@
#include <media/saa7146_vv.h>
-static int debug = 255;
-MODULE_PARM(debug,"i");
+static int debug = 0;
+MODULE_PARM(debug, "i");
MODULE_PARM_DESC(debug, "debug verbosity");
/* global variables */
@@ -36,36 +36,36 @@ int hexium_num = 0;
/* this is only called for old HV-PCI6/Orion cards
without eeprom */
-static int hexium_probe(struct saa7146_dev* dev)
+static int hexium_probe(struct saa7146_dev *dev)
{
- struct hexium* hexium = 0;
+ struct hexium *hexium = 0;
union i2c_smbus_data data;
int err = 0;
-
+
DEB_EE((".\n"));
/* there are no hexium orion cards with revision 0 saa7146s */
- if( 0 == dev->revision ) {
+ if (0 == dev->revision) {
return -EFAULT;
}
- hexium = (struct hexium*)kmalloc(sizeof(struct hexium), GFP_KERNEL);
- if( NULL == hexium ) {
+ hexium = (struct hexium *) kmalloc(sizeof(struct hexium), GFP_KERNEL);
+ if (NULL == hexium) {
printk("hexium_orion.o: hexium_probe: not enough kernel memory.\n");
return -ENOMEM;
}
- memset(hexium, 0x0, sizeof(struct hexium));
+ memset(hexium, 0x0, sizeof(struct hexium));
/* FIXME: enable i2c-port pins, video-port-pins
video port pins should be enabled here ?! */
saa7146_write(dev, MC1, (MASK_08 | MASK_24 | MASK_10 | MASK_26));
saa7146_write(dev, DD1_INIT, 0x02000200);
- saa7146_write(dev, DD1_STREAM_B, 0x00000000);
+ saa7146_write(dev, DD1_STREAM_B, 0x00000000);
saa7146_write(dev, MC2, (MASK_09 | MASK_25 | MASK_10 | MASK_26));
saa7146_i2c_adapter_prepare(dev, &hexium->i2c_adapter, SAA7146_I2C_BUS_BIT_RATE_480);
- if(i2c_add_adapter(&hexium->i2c_adapter) < 0) {
+ if (i2c_add_adapter(&hexium->i2c_adapter) < 0) {
DEB_S(("cannot register i2c-device. skipping.\n"));
kfree(hexium);
return -EFAULT;
@@ -75,34 +75,32 @@ static int hexium_probe(struct saa7146_dev* dev)
saa7146_setgpio(dev, 0, SAA7146_GPIO_OUTHI);
/* set HWControl GPIO number 2 */
saa7146_setgpio(dev, 2, SAA7146_GPIO_OUTHI);
-
+
mdelay(10);
/* detect newer Hexium Orion cards by subsystem ids */
- if( 0x17c8 == dev->pci->subsystem_vendor
- && 0x0101 == dev->pci->subsystem_device ) {
+ if (0x17c8 == dev->pci->subsystem_vendor && 0x0101 == dev->pci->subsystem_device) {
printk("hexium_orion.o: device is a Hexium Orion w/ 1 SVHS + 3 BNC inputs.\n");
/* we store the pointer in our private data field */
- (struct hexium*)dev->ext_priv = hexium;
- hexium->type = HEXIUM_ORION_1SVHS_3BNC;
+ (struct hexium *) dev->ext_priv = hexium;
+ hexium->type = HEXIUM_ORION_1SVHS_3BNC;
return 0;
}
- if( 0x17c8 == dev->pci->subsystem_vendor
- && 0x2101 == dev->pci->subsystem_device ) {
+ if (0x17c8 == dev->pci->subsystem_vendor && 0x2101 == dev->pci->subsystem_device) {
printk("hexium_orion.o: device is a Hexium Orion w/ 4 BNC inputs.\n");
/* we store the pointer in our private data field */
- (struct hexium*)dev->ext_priv = hexium;
- hexium->type = HEXIUM_ORION_4BNC;
+ (struct hexium *) dev->ext_priv = hexium;
+ hexium->type = HEXIUM_ORION_4BNC;
return 0;
}
/* check if this is an old hexium Orion card by looking at
a saa7110 at address 0x4e */
- if(0 == ( err = i2c_smbus_xfer(&hexium->i2c_adapter, 0x4e, 0, I2C_SMBUS_READ, 0x00, I2C_SMBUS_BYTE_DATA, &data))) {
+ if (0 == (err = i2c_smbus_xfer(&hexium->i2c_adapter, 0x4e, 0, I2C_SMBUS_READ, 0x00, I2C_SMBUS_BYTE_DATA, &data))) {
printk("hexium_orion.o: device is a Hexium HV-PCI6/Orion (old).\n");
/* we store the pointer in our private data field */
- (struct hexium*)dev->ext_priv = hexium;
+ (struct hexium *) dev->ext_priv = hexium;
hexium->type = HEXIUM_HV_PCI6_ORION;
return 0;
}
@@ -116,20 +114,20 @@ static int hexium_probe(struct saa7146_dev* dev)
wants to capture from this device before it has been properly initialized.
the capture engine would badly fail, because no valid signal arrives on the
saa7146, thus leading to timeouts and stuff. */
-static int hexium_init_done(struct saa7146_dev* dev)
+static int hexium_init_done(struct saa7146_dev *dev)
{
- struct hexium* hexium = (struct hexium*)dev->ext_priv;
+ struct hexium *hexium = (struct hexium *) dev->ext_priv;
union i2c_smbus_data data;
int i = 0;
DEB_D(("hexium_init_done called.\n"));
/* initialize the helper ics to useful values */
- for(i = 0; i < sizeof(hexium_saa7110); i++) {
- data.byte = hexium_saa7110[i];
- if(0 != i2c_smbus_xfer(&hexium->i2c_adapter, 0x4e, 0, I2C_SMBUS_WRITE, i ,I2C_SMBUS_BYTE_DATA, &data)) {
- printk("hexium_orion: failed for address 0x%02x\n",i);
- }
+ for (i = 0; i < sizeof(hexium_saa7110); i++) {
+ data.byte = hexium_saa7110[i];
+ if (0 != i2c_smbus_xfer(&hexium->i2c_adapter, 0x4e, 0, I2C_SMBUS_WRITE, i, I2C_SMBUS_BYTE_DATA, &data)) {
+ printk("hexium_orion: failed for address 0x%02x\n", i);
+ }
}
return 0;
@@ -138,35 +136,35 @@ static int hexium_init_done(struct saa7146_dev* dev)
static struct saa7146_ext_vv vv_data;
/* this function only gets called when the probing was successful */
-static int hexium_attach(struct saa7146_dev* dev, struct saa7146_pci_extension_data *info)
+static int hexium_attach(struct saa7146_dev *dev, struct saa7146_pci_extension_data *info)
{
- struct hexium* hexium = (struct hexium*)dev->ext_priv;
+ struct hexium *hexium = (struct hexium *) dev->ext_priv;
DEB_EE((".\n"));
- saa7146_vv_init(dev,&vv_data);
- if( 0 != saa7146_register_device(&hexium->video_dev, dev, "hexium", VFL_TYPE_GRABBER)) {
+ saa7146_vv_init(dev, &vv_data);
+ if (0 != saa7146_register_device(&hexium->video_dev, dev, "hexium", VFL_TYPE_GRABBER)) {
ERR(("cannot register capture v4l2 device. skipping.\n"));
return -1;
}
-
- printk("hexium_orion.o: found 'hexium orion' frame grabber-%d.\n",hexium_num);
+
+ printk("hexium_orion.o: found 'hexium orion' frame grabber-%d.\n", hexium_num);
hexium_num++;
-
+
/* the rest */
hexium->cur_input = 0;
hexium_init_done(dev);
-
+
return 0;
}
-static int hexium_detach(struct saa7146_dev* dev)
+static int hexium_detach(struct saa7146_dev *dev)
{
- struct hexium* hexium = (struct hexium*)dev->ext_priv;
-
- DEB_EE(("dev:%p\n",dev));
+ struct hexium *hexium = (struct hexium *) dev->ext_priv;
+
+ DEB_EE(("dev:%p\n", dev));
- saa7146_unregister_device(&hexium->video_dev,dev);
+ saa7146_unregister_device(&hexium->video_dev, dev);
saa7146_vv_release(dev);
hexium_num--;
@@ -176,53 +174,52 @@ static int hexium_detach(struct saa7146_dev* dev)
return 0;
}
-static int hexium_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
+static int hexium_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
{
struct saa7146_dev *dev = fh->dev;
- struct hexium* hexium = (struct hexium*)dev->ext_priv;
+ struct hexium *hexium = (struct hexium *) dev->ext_priv;
/*
struct saa7146_vv *vv = dev->vv_data;
*/
- switch(cmd)
- {
+ switch (cmd) {
case VIDIOC_ENUMINPUT:
- {
- struct v4l2_input *i = arg;
- DEB_EE(("VIDIOC_ENUMINPUT %d.\n",i->index));
-
- if( i->index < 0 || i->index >= HEXIUM_INPUTS) {
- return -EINVAL;
- }
-
- memcpy(i, &hexium_inputs[i->index], sizeof(struct v4l2_input));
+ {
+ struct v4l2_input *i = arg;
+ DEB_EE(("VIDIOC_ENUMINPUT %d.\n", i->index));
- DEB_D(("v4l2_ioctl: VIDIOC_ENUMINPUT %d.\n",i->index));
- return 0;
- }
+ if (i->index < 0 || i->index >= HEXIUM_INPUTS) {
+ return -EINVAL;
+ }
+
+ memcpy(i, &hexium_inputs[i->index], sizeof(struct v4l2_input));
+
+ DEB_D(("v4l2_ioctl: VIDIOC_ENUMINPUT %d.\n", i->index));
+ return 0;
+ }
case VIDIOC_G_INPUT:
- {
- int *input = (int *)arg;
- *input = hexium->cur_input;
+ {
+ int *input = (int *) arg;
+ *input = hexium->cur_input;
- DEB_D(("VIDIOC_G_INPUT: %d\n",*input));
- return 0;
- }
+ DEB_D(("VIDIOC_G_INPUT: %d\n", *input));
+ return 0;
+ }
case VIDIOC_S_INPUT:
- {
- int input = *(int *)arg;
+ {
+ int input = *(int *) arg;
- if (input < 0 || input >= HEXIUM_INPUTS) {
- return -EINVAL;
- }
-
- hexium->cur_input = input;
+ if (input < 0 || input >= HEXIUM_INPUTS) {
+ return -EINVAL;
+ }
- /* fixme: switch input here, switch audio, too! */
-// saa7146_set_hps_source_and_sync(dev, input_port_selection[input].hps_source, input_port_selection[input].hps_sync);
- printk("hexium_orion.o: VIDIOC_S_INPUT: fixme switch input.\n");
-
- return 0;
- }
+ hexium->cur_input = input;
+
+ /* fixme: switch input here, switch audio, too! */
+// saa7146_set_hps_source_and_sync(dev, input_port_selection[input].hps_source, input_port_selection[input].hps_sync);
+ printk("hexium_orion.o: VIDIOC_S_INPUT: fixme switch input.\n");
+
+ return 0;
+ }
default:
/*
DEB_D(("v4l2_ioctl does not handle this ioctl.\n"));
@@ -232,89 +229,85 @@ static int hexium_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
return 0;
}
-static int std_callback(struct saa7146_dev* dev, struct saa7146_standard *std)
+static int std_callback(struct saa7146_dev *dev, struct saa7146_standard *std)
{
return 0;
}
-static
-struct saa7146_extension extension;
+static struct saa7146_extension extension;
-static
-struct saa7146_pci_extension_data hexium_hv_pci6 = {
- .ext_priv = "Hexium HV-PCI6 / Orion",
- .ext = &extension,
+static struct saa7146_pci_extension_data hexium_hv_pci6 = {
+ .ext_priv = "Hexium HV-PCI6 / Orion",
+ .ext = &extension,
};
-static
-struct saa7146_pci_extension_data hexium_orion_1svhs_3bnc = {
- .ext_priv = "Hexium HV-PCI6 / Orion (1 SVHS/3 BNC)",
- .ext = &extension,
+static struct saa7146_pci_extension_data hexium_orion_1svhs_3bnc = {
+ .ext_priv = "Hexium HV-PCI6 / Orion (1 SVHS/3 BNC)",
+ .ext = &extension,
};
-static
-struct saa7146_pci_extension_data hexium_orion_4bnc = {
- .ext_priv = "Hexium HV-PCI6 / Orion (4 BNC)",
- .ext = &extension,
+static struct saa7146_pci_extension_data hexium_orion_4bnc = {
+ .ext_priv = "Hexium HV-PCI6 / Orion (4 BNC)",
+ .ext = &extension,
};
-static
-struct pci_device_id pci_tbl[] = {
+static struct pci_device_id pci_tbl[] = {
{
- .vendor = PCI_VENDOR_ID_PHILIPS,
- .device = PCI_DEVICE_ID_PHILIPS_SAA7146,
- .subvendor = 0x0000,
- .subdevice = 0x0000,
- .driver_data = (unsigned long)&hexium_hv_pci6,
- }, {
- .vendor = PCI_VENDOR_ID_PHILIPS,
- .device = PCI_DEVICE_ID_PHILIPS_SAA7146,
- .subvendor = 0x17c8,
- .subdevice = 0x0101,
- .driver_data = (unsigned long)&hexium_orion_1svhs_3bnc,
- }, {
- .vendor = PCI_VENDOR_ID_PHILIPS,
- .device = PCI_DEVICE_ID_PHILIPS_SAA7146,
- .subvendor = 0x17c8,
- .subdevice = 0x2101,
- .driver_data = (unsigned long)&hexium_orion_4bnc,
- }, {
- .vendor = 0,
- }
+ .vendor = PCI_VENDOR_ID_PHILIPS,
+ .device = PCI_DEVICE_ID_PHILIPS_SAA7146,
+ .subvendor = 0x0000,
+ .subdevice = 0x0000,
+ .driver_data = (unsigned long) &hexium_hv_pci6,
+ },
+ {
+ .vendor = PCI_VENDOR_ID_PHILIPS,
+ .device = PCI_DEVICE_ID_PHILIPS_SAA7146,
+ .subvendor = 0x17c8,
+ .subdevice = 0x0101,
+ .driver_data = (unsigned long) &hexium_orion_1svhs_3bnc,
+ },
+ {
+ .vendor = PCI_VENDOR_ID_PHILIPS,
+ .device = PCI_DEVICE_ID_PHILIPS_SAA7146,
+ .subvendor = 0x17c8,
+ .subdevice = 0x2101,
+ .driver_data = (unsigned long) &hexium_orion_4bnc,
+ },
+ {
+ .vendor = 0,
+ }
};
MODULE_DEVICE_TABLE(pci, pci_tbl);
-static
-struct saa7146_ext_vv vv_data = {
- .inputs = HEXIUM_INPUTS,
- .capabilities = 0,
- .stds = &hexium_standards[0],
- .num_stds = sizeof(hexium_standards)/sizeof(struct saa7146_standard),
- .std_callback = &std_callback,
- .ioctls = &ioctls[0],
- .ioctl = hexium_ioctl,
+static struct saa7146_ext_vv vv_data = {
+ .inputs = HEXIUM_INPUTS,
+ .capabilities = 0,
+ .stds = &hexium_standards[0],
+ .num_stds = sizeof(hexium_standards) / sizeof(struct saa7146_standard),
+ .std_callback = &std_callback,
+ .ioctls = &ioctls[0],
+ .ioctl = hexium_ioctl,
};
-static
-struct saa7146_extension extension = {
- .name = "hexium HV-PCI6/Orion",
- .flags = 0, // SAA7146_USE_I2C_IRQ,
-
- .pci_tbl = &pci_tbl[0],
- .module = THIS_MODULE,
+static struct saa7146_extension extension = {
+ .name = "hexium HV-PCI6/Orion",
+ .flags = 0, // SAA7146_USE_I2C_IRQ,
- .probe = hexium_probe,
- .attach = hexium_attach,
- .detach = hexium_detach,
+ .pci_tbl = &pci_tbl[0],
+ .module = THIS_MODULE,
- .irq_mask = 0,
- .irq_func = NULL,
-};
+ .probe = hexium_probe,
+ .attach = hexium_attach,
+ .detach = hexium_detach,
+
+ .irq_mask = 0,
+ .irq_func = NULL,
+};
-int __init hexium_init_module(void)
+int __init hexium_init_module(void)
{
- if( 0 != saa7146_register_extension(&extension)) {
+ if (0 != saa7146_register_extension(&extension)) {
DEB_S(("failed to register extension.\n"));
return -ENODEV;
}
@@ -322,7 +315,7 @@ int __init hexium_init_module(void)
return 0;
}
-void __exit hexium_cleanup_module(void)
+void __exit hexium_cleanup_module(void)
{
saa7146_unregister_extension(&extension);
}
diff --git a/linux/drivers/media/video/hexium_orion.h b/linux/drivers/media/video/hexium_orion.h
index ca315b4e9..1c654a228 100644
--- a/linux/drivers/media/video/hexium_orion.h
+++ b/linux/drivers/media/video/hexium_orion.h
@@ -32,7 +32,7 @@ static u8 hexium_saa7110[53]={
static struct {
struct hexium_data data[8];
-} hexium_input_select[] = { /* input 0 */
+} hexium_input_select[] = {
{
{ /* input 0 */
{ 0x06, 0x00 },
@@ -135,51 +135,4 @@ static struct {
}
};
-
-#ifdef axa
-
-// Camera signal select tables (based on SAA7110 pdf)
-// -------------------------------------------------------------------------
-static const REGISTER sigtable7110_bw60[]={ // B/W NTSC
-{ 0x06, 0x80 },
-{ 0x2E, 0x81 },
-{ -1 , 0xFF }
-};
-static const REGISTER sigtable7110_bw50[]={ // B/W PAL
-{ 0x06, 0x80 },
-{ 0x2E, 0x9A },
-{ -1 , 0xFF }
-};
-static const REGISTER sigtable7110_ntsc[]={ // Color NTSC
-{ 0x0D, 0x86 },
-{ 0x11, 0x2C },
-{ 0x2E, 0x81 },
-{ -1 , 0xFF }
-};
-static const REGISTER sigtable7110_pal[]={ // PAL
-{ 0x0D, 0x86 },
-{ 0x11, 0x59 },
-{ 0x2E, 0x9A },
-{ -1 , 0xFF }
-};
-static const REGISTER sigtable7110_secam[]={ // SECAM
-{ 0x0D, 0x87 },
-{ 0x11, 0x59 },
-{ 0x2E, 0x9A },
-{ -1 , 0xFF }
-};
-// -------------------------------------------------------------------------
-// AGC handling functions
-// -------------------------------------------------------------------------
-BYTE SAA7146::ValidateReg7110(int regnum,BYTE Value)
-{
-switch(regnum) {
-case 0x22:
-if (fAGC==false) Value&=0x3F; // AGC OFF
-break;
-}
-return(Value);
-}
-#endif
-
#endif