From: Dirk Behme <dirk.behme@googlemail.com>
To: linux-omap-open-source@linux.omap.com
Subject: [PATCH] ARM: OMAP: Make AIC23 sound work again
Date: Tue, 31 Oct 2006 19:48:13 +0100 [thread overview]
Message-ID: <45479A6D.2080100@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 148 bytes --]
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>
[-- Attachment #2: i2c_zero_length_smbus_quick_hack_patch.txt --]
[-- Type: text/plain, Size: 1498 bytes --]
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
[-- Attachment #3: Type: text/plain, Size: 0 bytes --]
reply other threads:[~2006-10-31 18:48 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45479A6D.2080100@gmail.com \
--to=dirk.behme@googlemail.com \
--cc=linux-omap-open-source@linux.omap.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox