summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorMichael Hunold <devnull@localhost>2004-06-21 16:52:14 +0000
committerMichael Hunold <devnull@localhost>2004-06-21 16:52:14 +0000
commit5a55a75489eb0d6a3b1dfdf391f7be6f09036d64 (patch)
treed8be3f2083fb421bf90acb54cc5fb75011eb37da /linux
parent532af0393d74270b67d5510647d61ed7c59db948 (diff)
downloadmediapointer-dvb-s2-5a55a75489eb0d6a3b1dfdf391f7be6f09036d64.tar.gz
mediapointer-dvb-s2-5a55a75489eb0d6a3b1dfdf391f7be6f09036d64.tar.bz2
- Replace generic saa7146 i2c name by card specific name, suggested by Uli Luckas <luckas@musoft.de>
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/common/saa7146_i2c.c6
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110.c14
-rw-r--r--linux/drivers/media/dvb/ttpci/budget-core.c14
-rw-r--r--linux/include/media/saa7146.h4
4 files changed, 24 insertions, 14 deletions
diff --git a/linux/drivers/media/common/saa7146_i2c.c b/linux/drivers/media/common/saa7146_i2c.c
index 6e991a90f..9d7b806fb 100644
--- a/linux/drivers/media/common/saa7146_i2c.c
+++ b/linux/drivers/media/common/saa7146_i2c.c
@@ -400,7 +400,7 @@ static struct i2c_algorithm saa7146_algo = {
.functionality = saa7146_i2c_func,
};
-int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c_adapter, unsigned int class, u32 bitrate)
+int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c_adapter, u32 bitrate)
{
DEB_EE(("bitrate: 0x%08x\n",bitrate));
@@ -411,13 +411,11 @@ int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c
saa7146_i2c_reset(dev);
if( NULL != i2c_adapter ) {
- memset(i2c_adapter,0,sizeof(struct i2c_adapter));
- strcpy(i2c_adapter->name, dev->name);
+ BUG_ON(!i2c_adapter->class);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
i2c_adapter->data = dev;
#else
i2c_set_adapdata(i2c_adapter,dev);
- i2c_adapter->class = class;
#endif
i2c_adapter->algo = &saa7146_algo;
i2c_adapter->algo_data = NULL;
diff --git a/linux/drivers/media/dvb/ttpci/av7110.c b/linux/drivers/media/dvb/ttpci/av7110.c
index f2466f715..007130a6c 100644
--- a/linux/drivers/media/dvb/ttpci/av7110.c
+++ b/linux/drivers/media/dvb/ttpci/av7110.c
@@ -1390,13 +1390,19 @@ static int av7110_attach(struct saa7146_dev* dev, struct saa7146_pci_extension_d
/* the Siemens DVB needs this if you want to have the i2c chips
get recognized before the main driver is fully loaded */
saa7146_write(dev, GPIO_CTRL, 0x500000);
+
+ av7110->i2c_adap = (struct i2c_adapter) {
+ .client_register = client_register,
+ .client_unregister = client_unregister,
#ifdef I2C_ADAP_CLASS_TV_DIGITAL
- saa7146_i2c_adapter_prepare(dev, &av7110->i2c_adap, I2C_ADAP_CLASS_TV_DIGITAL, SAA7146_I2C_BUS_BIT_RATE_120); /* 275 kHz */
+ .class = I2C_ADAP_CLASS_TV_DIGITAL,
#else
- saa7146_i2c_adapter_prepare(dev, &av7110->i2c_adap, I2C_CLASS_TV_DIGITAL, SAA7146_I2C_BUS_BIT_RATE_120); /* 275 kHz */
+ .class = I2C_CLASS_TV_DIGITAL,
#endif
- av7110->i2c_adap.client_register = client_register;
- av7110->i2c_adap.client_unregister = client_unregister;
+ };
+ strlcpy(av7110->i2c_adap.name, pci_ext->ext_priv, sizeof(av7110->i2c_adap.name));
+
+ saa7146_i2c_adapter_prepare(dev, &av7110->i2c_adap, SAA7146_I2C_BUS_BIT_RATE_120); /* 275 kHz */
av7110->i2c_bus = dvb_register_i2c_bus(master_xfer, dev,
av7110->dvb_adapter, 0);
diff --git a/linux/drivers/media/dvb/ttpci/budget-core.c b/linux/drivers/media/dvb/ttpci/budget-core.c
index d0dfd9990..c37353e19 100644
--- a/linux/drivers/media/dvb/ttpci/budget-core.c
+++ b/linux/drivers/media/dvb/ttpci/budget-core.c
@@ -321,13 +321,19 @@ int ttpci_budget_init (struct budget *budget,
if (bi->type != BUDGET_FS_ACTIVY)
saa7146_write(dev, GPIO_CTRL, 0x500000); /* GPIO 3 = 1 */
+ budget->i2c_adap = (struct i2c_adapter) {
+ .client_register = client_register,
+ .client_unregister = client_unregister,
#ifdef I2C_ADAP_CLASS_TV_DIGITAL
- saa7146_i2c_adapter_prepare(dev, &budget->i2c_adap, I2C_ADAP_CLASS_TV_DIGITAL, SAA7146_I2C_BUS_BIT_RATE_120);
+ .class = I2C_ADAP_CLASS_TV_DIGITAL,
#else
- saa7146_i2c_adapter_prepare(dev, &budget->i2c_adap, I2C_CLASS_TV_DIGITAL, SAA7146_I2C_BUS_BIT_RATE_120);
+ .class = I2C_CLASS_TV_DIGITAL,
#endif
- budget->i2c_adap.client_register = client_register;
- budget->i2c_adap.client_unregister = client_unregister;
+ };
+ strlcpy(budget->i2c_adap.name, budget->card->name, sizeof(budget->card->name));
+
+
+ saa7146_i2c_adapter_prepare(dev, &budget->i2c_adap, SAA7146_I2C_BUS_BIT_RATE_120);
budget->i2c_bus = dvb_register_i2c_bus (master_xfer, dev,
budget->dvb_adapter, 0);
diff --git a/linux/include/media/saa7146.h b/linux/include/media/saa7146.h
index 762736f43..f683b6c08 100644
--- a/linux/include/media/saa7146.h
+++ b/linux/include/media/saa7146.h
@@ -166,8 +166,8 @@ struct saa7146_dev
};
/* from saa7146_i2c.c */
-int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c_adapter, unsigned int class, u32 bitrate);
-int saa7146_i2c_transfer(struct saa7146_dev *saa, const struct i2c_msg msgs[], int num, int retries);
+int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c_adapter, u32 bitrate);
+int saa7146_i2c_transfer(struct saa7146_dev *saa, const struct i2c_msg msgs[], int num, int retries);
/* from saa7146_core.c */
extern struct list_head saa7146_devices;