lkml.org 
[lkml]   [2006]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] I2C PCA954x: Fix initial access to first mux/switch port
The first mux/switch port would not get selected if it was the first port to be
accessed because the code believed it already had. We now initialize the last
channel to a bogus value to ensure the first access will properly select the
channel.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

---
commit 9040559b19987489000a75a5f8b4957ecbb0fa7f
tree 63056d09c30f32b71bf0a2a3d57a42c2380a9dd8
parent c2f0d4dc88921bb6bed9e289fbda132f587a4306
author Kumar Gala <galak@kernel.crashing.org> Tue, 25 Apr 2006 11:58:51 -0500
committer Kumar Gala <galak@kernel.crashing.org> Tue, 25 Apr 2006 11:58:51 -0500

drivers/i2c/chips/pca954x.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/chips/pca954x.c b/drivers/i2c/chips/pca954x.c
index f300493..4ee38bc 100644
--- a/drivers/i2c/chips/pca954x.c
+++ b/drivers/i2c/chips/pca954x.c
@@ -234,6 +234,10 @@ static int pca954x_detect(struct i2c_ada

data->chip_offset = i;

+ /* Set last_chan to an invalid channel to force an initial setting
+ * of the mux/switch on the first select_chan */
+ data->last_chan = 0xff;
+
if ((ret = i2c_attach_client(client)))
goto exit_free;


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-04-25 19:07    [W:0.217 / U:0.596 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site