浏览代码

Merge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging

* 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  i2c/pca954x: Initialize the mux to disconnected state
  i2c-taos-evm: Fix log messages
Linus Torvalds 14 年之前
父节点
当前提交
c773547183
共有 2 个文件被更改,包括 8 次插入7 次删除
  1. 4 4
      drivers/i2c/busses/i2c-taos-evm.c
  2. 4 3
      drivers/i2c/muxes/pca954x.c

+ 4 - 4
drivers/i2c/busses/i2c-taos-evm.c

@@ -234,7 +234,7 @@ static int taos_connect(struct serio *serio, struct serio_driver *drv)
 
 
 	if (taos->state != TAOS_STATE_IDLE) {
 	if (taos->state != TAOS_STATE_IDLE) {
 		err = -ENODEV;
 		err = -ENODEV;
-		dev_dbg(&serio->dev, "TAOS EVM reset failed (state=%d, "
+		dev_err(&serio->dev, "TAOS EVM reset failed (state=%d, "
 			"pos=%d)\n", taos->state, taos->pos);
 			"pos=%d)\n", taos->state, taos->pos);
 		goto exit_close;
 		goto exit_close;
 	}
 	}
@@ -255,7 +255,7 @@ static int taos_connect(struct serio *serio, struct serio_driver *drv)
 					 msecs_to_jiffies(250));
 					 msecs_to_jiffies(250));
 	if (taos->state != TAOS_STATE_IDLE) {
 	if (taos->state != TAOS_STATE_IDLE) {
 		err = -ENODEV;
 		err = -ENODEV;
-		dev_err(&adapter->dev, "Echo off failed "
+		dev_err(&serio->dev, "TAOS EVM echo off failed "
 			"(state=%d)\n", taos->state);
 			"(state=%d)\n", taos->state);
 		goto exit_close;
 		goto exit_close;
 	}
 	}
@@ -263,7 +263,7 @@ static int taos_connect(struct serio *serio, struct serio_driver *drv)
 	err = i2c_add_adapter(adapter);
 	err = i2c_add_adapter(adapter);
 	if (err)
 	if (err)
 		goto exit_close;
 		goto exit_close;
-	dev_dbg(&serio->dev, "Connected to TAOS EVM\n");
+	dev_info(&serio->dev, "Connected to TAOS EVM\n");
 
 
 	taos->client = taos_instantiate_device(adapter);
 	taos->client = taos_instantiate_device(adapter);
 	return 0;
 	return 0;
@@ -288,7 +288,7 @@ static void taos_disconnect(struct serio *serio)
 	serio_set_drvdata(serio, NULL);
 	serio_set_drvdata(serio, NULL);
 	kfree(taos);
 	kfree(taos);
 
 
-	dev_dbg(&serio->dev, "Disconnected from TAOS EVM\n");
+	dev_info(&serio->dev, "Disconnected from TAOS EVM\n");
 }
 }
 
 
 static struct serio_device_id taos_serio_ids[] = {
 static struct serio_device_id taos_serio_ids[] = {

+ 4 - 3
drivers/i2c/muxes/pca954x.c

@@ -201,10 +201,11 @@ static int pca954x_probe(struct i2c_client *client,
 
 
 	i2c_set_clientdata(client, data);
 	i2c_set_clientdata(client, data);
 
 
-	/* Read the mux register at addr to verify
-	 * that the mux is in fact present.
+	/* Write the mux register at addr to verify
+	 * that the mux is in fact present. This also
+	 * initializes the mux to disconnected state.
 	 */
 	 */
-	if (i2c_smbus_read_byte(client) < 0) {
+	if (i2c_smbus_write_byte(client, 0) < 0) {
 		dev_warn(&client->dev, "probe failed\n");
 		dev_warn(&client->dev, "probe failed\n");
 		goto exit_free;
 		goto exit_free;
 	}
 	}