summaryrefslogtreecommitdiff
path: root/linux/drivers/media/common/saa7146_core.c
diff options
context:
space:
mode:
authorMichael Hunold <devnull@localhost>2002-12-20 14:18:26 +0000
committerMichael Hunold <devnull@localhost>2002-12-20 14:18:26 +0000
commite62b273dd417c051d1624d6854414d6054e6a131 (patch)
tree84cab0d55c55c4742a03eb8e6aad210def78f7e3 /linux/drivers/media/common/saa7146_core.c
parentdf166bc1551ee91e374068939c2e58925db8064e (diff)
downloadmediapointer-dvb-s2-e62b273dd417c051d1624d6854414d6054e6a131.tar.gz
mediapointer-dvb-s2-e62b273dd417c051d1624d6854414d6054e6a131.tar.bz2
Removed the dependecy to i2c-core from saa7146 and av7110,
changed mxb to (un)register the i2c adapter by itself
Diffstat (limited to 'linux/drivers/media/common/saa7146_core.c')
-rw-r--r--linux/drivers/media/common/saa7146_core.c34
1 files changed, 4 insertions, 30 deletions
diff --git a/linux/drivers/media/common/saa7146_core.c b/linux/drivers/media/common/saa7146_core.c
index 28a84fc25..a92511cdd 100644
--- a/linux/drivers/media/common/saa7146_core.c
+++ b/linux/drivers/media/common/saa7146_core.c
@@ -557,18 +557,8 @@ void try_attach_extension_and_device(struct saa7146_dev *dev, struct saa7146_ext
return;
}
- if( 0 != ext->use_kernel_i2c ) {
- /* register new i2c-bus */
- if(i2c_add_adapter(dev->i2c_adapter) < 0) {
- DEB_S(("cannot register i2c-device. skipping.\n"));
- return;
- }
- }
-
if( 0 != ext->probe(dev, dev->pci->subsystem_vendor, dev->pci->subsystem_device) ) {
DEB_D(("ext->probe() failed for %p. skipping device.\n",dev));
- if( 0 != ext->use_kernel_i2c )
- i2c_del_adapter(dev->i2c_adapter);
return;
}
@@ -576,8 +566,6 @@ void try_attach_extension_and_device(struct saa7146_dev *dev, struct saa7146_ext
if( 0 != ext->attach(dev) ) {
DEB_D(("ext->attach() failed for %p. skipping device.\n",dev));
- if( 0 != ext->use_kernel_i2c )
- i2c_del_adapter(dev->i2c_adapter);
dev->ext = NULL;
return;
}
@@ -596,8 +584,6 @@ void try_attach_extension_and_device(struct saa7146_dev *dev, struct saa7146_ext
it looks - you cannot access the device.
we simply call the 'release' function. */
ext->detach(dev);
- if( 0 != ext->use_kernel_i2c )
- i2c_del_adapter(dev->i2c_adapter);
dev->ext = NULL;
return;
}
@@ -693,9 +679,6 @@ int saa7146_unregister_extension(struct saa7146_extension* ext)
DEB_D(("ext->detach() failed. ignoring.\n"));
}
- if( 0 != ext->use_kernel_i2c )
- i2c_del_adapter(dev->i2c_adapter);
-
video_unregister_device(&dev->video_dev);
if( 0 != BOARD_CAN_DO_VBI(dev)) {
video_unregister_device(&dev->vbi_dev);
@@ -813,19 +796,11 @@ static int config_a_device(struct pci_dev *pci)
goto kmalloc_error_3;
memset(dev->clipping, 0x0, SAA7146_CLIPPING_MEM);
- dev->i2c_adapter = kmalloc(sizeof(struct i2c_adapter), GFP_KERNEL);
- if ( NULL == dev->i2c_adapter )
- goto kmalloc_error_4;
- memset(dev->i2c_adapter, 0x0, sizeof(struct i2c_adapter));
-
dev->i2c_mem = (u32*)kmalloc(SAA7146_I2C_MEM, GFP_KERNEL);
if( NULL == dev->i2c_mem )
- goto kmalloc_error_5;
+ goto kmalloc_error_4;
memset(dev->i2c_mem, 0x00, SAA7146_I2C_MEM);
- /* i2c-adapter preparations */
- saa7146_i2c_adapter_prepare(dev);
-
/* enable i2c-port pins, video-port-pins */
saa7146_write(dev, MC1, (MASK_08 | MASK_24 | MASK_10 | MASK_26));
@@ -855,8 +830,6 @@ static int config_a_device(struct pci_dev *pci)
return try_match_device_to_extension(dev);
-kmalloc_error_5:
- kfree( dev->i2c_adapter );
kmalloc_error_4:
kfree( dev->clipping );
kmalloc_error_3:
@@ -890,7 +863,6 @@ static void unconfig_a_device(struct saa7146_dev* dev)
kfree(dev->rps1 );
kfree(dev->clipping);
kfree(dev->i2c_mem);
- kfree(dev->i2c_adapter);
iounmap(dev->mem);
release_mem_region(pci_resource_start(dev->pci,0), pci_resource_len(dev->pci,0));
@@ -931,7 +903,7 @@ struct pci_device_id saa7146_pci_tbl[] __devinitdata = {
{ 0,},
};
-static MODULE_DEVICE_TABLE(pci, saa7146_pci_tbl);
+MODULE_DEVICE_TABLE(pci, saa7146_pci_tbl);
static
struct pci_driver saa7146_driver = {
@@ -977,6 +949,8 @@ EXPORT_SYMBOL_GPL(saa7146_pgtable_alloc);
EXPORT_SYMBOL_GPL(saa7146_pgtable_free);
EXPORT_SYMBOL_GPL(saa7146_pgtable_build_single);
EXPORT_SYMBOL_GPL(saa7146_i2c_transfer);
+EXPORT_SYMBOL_GPL(saa7146_i2c_adapter_prepare);
+EXPORT_SYMBOL_GPL(saa7146_debug);
MODULE_AUTHOR("Michael Hunold <michael@mihu.de>");
MODULE_DESCRIPTION("video4linux driver for saa7146-based video hardware");