summaryrefslogtreecommitdiff
path: root/recipes/linux/linux-omap1-2.6.19-omap1/i2c-fix.patch
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/linux/linux-omap1-2.6.19-omap1/i2c-fix.patch
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/linux/linux-omap1-2.6.19-omap1/i2c-fix.patch')
-rw-r--r--recipes/linux/linux-omap1-2.6.19-omap1/i2c-fix.patch56
1 files changed, 56 insertions, 0 deletions
diff --git a/recipes/linux/linux-omap1-2.6.19-omap1/i2c-fix.patch b/recipes/linux/linux-omap1-2.6.19-omap1/i2c-fix.patch
new file mode 100644
index 0000000000..3b35ce23a2
--- /dev/null
+++ b/recipes/linux/linux-omap1-2.6.19-omap1/i2c-fix.patch
@@ -0,0 +1,56 @@
+Hack to add I2C zero length transfers and SMBus quick mode
+necessary for AIC23 sound again.
+
+Signed-off-by: Dirk Behme <dirk.behme_at_gmail.com>
+
+
+-------------- next part --------------
+Index: linux-osk/drivers/i2c/busses/i2c-omap.c
+===================================================================
+--- linux-osk.orig/drivers/i2c/busses/i2c-omap.c
++++ linux-osk/drivers/i2c/busses/i2c-omap.c
+@@ -285,20 +285,29 @@ static int omap_i2c_xfer_msg(struct i2c_
+ struct i2c_msg *msg, int stop)
+ {
+ struct omap_i2c_dev *dev = i2c_get_adapdata(adap);
++ u8 zero_byte = 0;
+ int r;
+ u16 w;
+
+ dev_dbg(dev->dev, "addr: 0x%04x, len: %d, flags: 0x%x, stop: %d\n",
+ msg->addr, msg->len, msg->flags, stop);
+
+- if (msg->len == 0)
+- return -EINVAL;
+-
+ omap_i2c_write_reg(dev, OMAP_I2C_SA_REG, msg->addr);
+
+- /* REVISIT: Could the STB bit of I2C_CON be used with probing? */
+- dev->buf = msg->buf;
+- dev->buf_len = msg->len;
++ /* Sigh, seems we can't do zero length transactions. Thus, we
++ * can't probe for devices w/o actually sending/receiving at least
++ * a single byte. So we'll set count to 1 for the zero length
++ * transaction case and hope we don't cause grief for some
++ * arbitrary device due to random byte write/read during
++ * probes.
++ */
++ if (msg->len == 0) {
++ dev->buf = &zero_byte;
++ dev->buf_len = 1;
++ } else {
++ dev->buf = msg->buf;
++ dev->buf_len = msg->len;
++ }
+
+ omap_i2c_write_reg(dev, OMAP_I2C_CNT_REG, dev->buf_len);
+
+@@ -383,7 +392,7 @@ out:
+ static u32
+ omap_i2c_func(struct i2c_adapter *adap)
+ {
+- return I2C_FUNC_I2C | (I2C_FUNC_SMBUS_EMUL & ~I2C_FUNC_SMBUS_QUICK);
++ return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
+ }
+
+ static inline void