summaryrefslogtreecommitdiff
path: root/linux/drivers/media/common/saa7146_i2c.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_i2c.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_i2c.c')
-rw-r--r--linux/drivers/media/common/saa7146_i2c.c74
1 files changed, 17 insertions, 57 deletions
diff --git a/linux/drivers/media/common/saa7146_i2c.c b/linux/drivers/media/common/saa7146_i2c.c
index fb876b03b..ed5f23930 100644
--- a/linux/drivers/media/common/saa7146_i2c.c
+++ b/linux/drivers/media/common/saa7146_i2c.c
@@ -362,75 +362,35 @@ int saa7146_i2c_xfer(struct i2c_adapter* adapter, struct i2c_msg msg[], int num)
return saa7146_i2c_transfer(dev, msg, num, adapter->retries);
}
-/* these are just for completeness */
-static
-int saa7146_i2c_reg(struct i2c_client *client)
-{
- return 0;
-}
-
-static
-int saa7146_i2c_unreg(struct i2c_client *client)
-{
- return 0;
-}
-
-/* fixme
-void saa7146_i2c_inc_use(struct i2c_adapter *adap)
-{
-#ifdef MODULE
- MOD_INC_USE_COUNT;
-#endif
-}
-
-void saa7146_i2c_dec_use(struct i2c_adapter *adap)
-{
-#ifdef MODULE
- MOD_DEC_USE_COUNT;
-#endif
-}
-*/
/*****************************************************************************/
/* i2c-adapter helper functions */
+#include <linux/i2c-id.h>
/* exported algorithm data */
static
struct i2c_algorithm saa7146_algo = {
- "saa7146 i2c algorithm",
- I2C_ALGO_SAA7146,
- saa7146_i2c_xfer,
- NULL,
- NULL, /* slave_xmit */
- NULL, /* slave_recv */
- NULL, /* ioctl */
- saa7146_i2c_func, /* functionality */
+ .name = "saa7146 i2c algorithm",
+ .id = I2C_ALGO_SAA7146,
+ .master_xfer = saa7146_i2c_xfer,
+ .functionality = saa7146_i2c_func,
};
-int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev)
+int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c_adapter, u32 bitrate)
{
- /* fixme: this should be adjusted by the extension */
- dev->i2c_bitrate = SAA7146_I2C_BUS_BIT_RATE_480;
-
+ dev->i2c_bitrate = bitrate;
saa7146_i2c_reset(dev);
- memset(dev->i2c_adapter,0,sizeof(struct i2c_adapter));
- strcpy(dev->i2c_adapter->name, dev->name);
-
- dev->i2c_adapter->data = dev;
- dev->i2c_adapter->algo = &saa7146_algo;
- dev->i2c_adapter->algo_data = NULL;
- dev->i2c_adapter->id = I2C_ALGO_SAA7146;
-
-/* fixme
- dev->i2c_adapter->inc_use = saa7146_i2c_inc_use;
- dev->i2c_adapter->dec_use = saa7146_i2c_dec_use;
-*/
- dev->i2c_adapter->client_register = saa7146_i2c_reg;
- dev->i2c_adapter->client_unregister = saa7146_i2c_unreg;
-
- dev->i2c_adapter->timeout = SAA7146_I2C_TIMEOUT;
- dev->i2c_adapter->retries = SAA7146_I2C_RETRIES;
+ if( NULL != i2c_adapter ) {
+ memset(i2c_adapter,0,sizeof(struct i2c_adapter));
+ strcpy(i2c_adapter->name, dev->name);
+ i2c_adapter->data = dev;
+ i2c_adapter->algo = &saa7146_algo;
+ i2c_adapter->algo_data = NULL;
+ i2c_adapter->id = I2C_ALGO_SAA7146;
+ i2c_adapter->timeout = SAA7146_I2C_TIMEOUT;
+ i2c_adapter->retries = SAA7146_I2C_RETRIES;
+ }
return 0;
}