summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/saa7134/saa7134-i2c.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/saa7134/saa7134-i2c.c')
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-i2c.c31
1 files changed, 13 insertions, 18 deletions
diff --git a/linux/drivers/media/video/saa7134/saa7134-i2c.c b/linux/drivers/media/video/saa7134/saa7134-i2c.c
index cce9ddc3e..78c07db8a 100644
--- a/linux/drivers/media/video/saa7134/saa7134-i2c.c
+++ b/linux/drivers/media/video/saa7134/saa7134-i2c.c
@@ -1,5 +1,5 @@
/*
- * $Id: saa7134-i2c.c,v 1.7 2004/11/07 13:17:15 kraxel Exp $
+ * $Id: saa7134-i2c.c,v 1.8 2004/12/09 12:51:35 kraxel Exp $
*
* device driver for philips saa7134 based TV cards
* i2c interface support
@@ -214,6 +214,13 @@ static inline int i2c_send_byte(struct saa7134_dev *dev,
if (!i2c_is_busy_wait(dev))
return -EIO;
status = i2c_get_status(dev);
+#if 1 /* debug */
+ if (DONE_READ == status) {
+ unsigned char data = saa_readb(SAA7134_I2C_DATA);
+ d2printk(KERN_DEBUG "%s: i2c data <= 0x%x\n",dev->name,data);
+ d1printk(" [%02x]",data);
+ }
+#endif
if (i2c_is_error(status))
return -EIO;
return 0;
@@ -248,10 +255,12 @@ static int saa7134_i2c_xfer(struct i2c_adapter *i2c_adap,
if (!i2c_reset(dev))
return -EIO;
+ d2printk("start xfer\n");
d1printk(KERN_DEBUG "%s: i2c xfer:",dev->name);
for (i = 0; i < num; i++) {
if (!(msgs[i].flags & I2C_M_NOSTART) || 0 == i) {
/* send address */
+ d2printk("send address\n");
addr = msgs[i].addr << 1;
if (msgs[i].flags & I2C_M_RD)
addr |= 1;
@@ -262,6 +271,7 @@ static int saa7134_i2c_xfer(struct i2c_adapter *i2c_adap,
}
if (msgs[i].flags & I2C_M_RD) {
/* read bytes */
+ d2printk("read bytes\n");
for (byte = 0; byte < msgs[i].len; byte++) {
d1printk(" =");
rc = i2c_recv_byte(dev);
@@ -272,6 +282,7 @@ static int saa7134_i2c_xfer(struct i2c_adapter *i2c_adap,
}
} else {
/* write bytes */
+ d2printk("write bytes\n");
for (byte = 0; byte < msgs[i].len; byte++) {
data = msgs[i].buf[byte];
d1printk(" %02x", data);
@@ -281,6 +292,7 @@ static int saa7134_i2c_xfer(struct i2c_adapter *i2c_adap,
}
}
}
+ d2printk("xfer done\n");
d1printk(" >");
i2c_set_attr(dev,STOP);
rc = -EIO;
@@ -313,18 +325,6 @@ static u32 functionality(struct i2c_adapter *adap)
return I2C_FUNC_SMBUS_EMUL;
}
-#ifndef I2C_PEC
-static void inc_use(struct i2c_adapter *adap)
-{
- MOD_INC_USE_COUNT;
-}
-
-static void dec_use(struct i2c_adapter *adap)
-{
- MOD_DEC_USE_COUNT;
-}
-#endif
-
static int attach_inform(struct i2c_client *client)
{
struct saa7134_dev *dev = client->adapter->algo_data;
@@ -345,12 +345,7 @@ static struct i2c_algorithm saa7134_algo = {
};
static struct i2c_adapter saa7134_adap_template = {
-#ifdef I2C_PEC
.owner = THIS_MODULE,
-#else
- .inc_use = inc_use,
- .dec_use = dec_use,
-#endif
#ifdef I2C_CLASS_TV_ANALOG
.class = I2C_CLASS_TV_ANALOG,
#endif