Kevin,

Sorry for the late response.
I see that the davinci git is atill at 2.6.23. I've attached the Davinci hack for SMBUS that David have mentioned about. That is pretty the same one like OMAP does.
That ultimately should be merged in davinci 2.6.24 git.

Regards,
Vladmir

Kevin Hilman wrote:
David Brownell wrote:
On Sunday 28 October 2007, Jean Delvare wrote:
Hi David,

On Sat, 27 Oct 2007 08:48:35 -0700, David Brownell wrote:
Let DaVinci support new-style i2c drivers.
It already does.
... hmm, but not in the latest DaVinci tree ...

The i2c-davinci driver does NOT advertise support for SMBUS_QUICK:

static u32 i2c_davinci_func(struct i2c_adapter *adap)
{
        return I2C_FUNC_I2C | (I2C_FUNC_SMBUS_EMUL & ~I2C_FUNC_SMBUS_QUICK);
}
Same thing.


Sorry for the confusion, I'd thought the DaVinci tree would be
synced with mainline fo drivers that went upstream.


Yeah, the DaVinci tree is still at 2.6.23.  Will be merging w/upstream
this week.

Kevin


_______________________________________________
i2c mailing list
[EMAIL PROTECTED]
http://lists.lm-sensors.org/mailman/listinfo/i2c

Index: linux-2.6.alsa/drivers/i2c/busses/i2c-davinci.c
===================================================================
--- linux-2.6.alsa.orig/drivers/i2c/busses/i2c-davinci.c
+++ linux-2.6.alsa/drivers/i2c/busses/i2c-davinci.c
@@ -41,6 +41,11 @@
 
 #include <asm/arch/i2c.h>
 
+/* Hack to enable zero length transfers and smbus quick until clean fix
+ * is available
+ */
+#define DAVINCI_HACK
+
 /* ----- global defines ----------------------------------------------- */
 
 #define DAVINCI_I2C_TIMEOUT	(1*HZ)
@@ -236,9 +241,14 @@ i2c_davinci_xfer_msg(struct i2c_adapter 
 	u32 stat;
 	u16 w;
 	int r;
+#ifdef DAVINCI_HACK
+	u8 zero_byte = 0;
+#endif
 
+#ifndef DAVINCI_HACK
 	if (msg->len == 0)
 		return -EINVAL;
+#endif
 
 	if (!pdata)
 		pdata = &davinci_i2c_platform_data_default;
@@ -249,8 +259,18 @@ i2c_davinci_xfer_msg(struct i2c_adapter 
 	/* set the slave address */
 	davinci_i2c_write_reg(dev, DAVINCI_I2C_SAR_REG, msg->addr);
 
+#ifndef DAVINCI_HACK
 	dev->buf = msg->buf;
 	dev->buf_len = msg->len;
+#else
+	if (msg->len == 0) {
+		dev->buf = &zero_byte;
+		dev->buf_len = 1;
+	} else {
+		dev->buf = msg->buf;
+		dev->buf_len = msg->len;
+	}
+#endif
 
 	davinci_i2c_write_reg(dev, DAVINCI_I2C_CNT_REG, dev->buf_len);
 
@@ -349,7 +369,11 @@ i2c_davinci_xfer(struct i2c_adapter *ada
 
 static u32 i2c_davinci_func(struct i2c_adapter *adap)
 {
+#ifndef DAVINCI_HACK
 	return I2C_FUNC_I2C | (I2C_FUNC_SMBUS_EMUL & ~I2C_FUNC_SMBUS_QUICK);
+#else
+	return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
+#endif
 }
 
 /*
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to