From: Kumar Gala 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 Cc: Jean Delvare Signed-off-by: Andrew Morton --- drivers/i2c/chips/pca954x.c | 4 ++++ 1 files changed, 4 insertions(+) diff -puN drivers/i2c/chips/pca954x.c~i2c-pca954x-fix-initial-access-to-first-mux-switch-port drivers/i2c/chips/pca954x.c --- 25/drivers/i2c/chips/pca954x.c~i2c-pca954x-fix-initial-access-to-first-mux-switch-port Wed Apr 26 14:26:41 2006 +++ 25-akpm/drivers/i2c/chips/pca954x.c Wed Apr 26 14:26:41 2006 @@ -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; _