i2c: Zynq: Support for TI PCA9548 bus multiplexer
authorMichael Burr <michael.burr@logicpd.com>
Mon, 23 Sep 2013 22:35:45 +0000 (22:35 +0000)
committerHeiko Schocher <hs@denx.de>
Thu, 17 Oct 2013 05:20:25 +0000 (07:20 +0200)
(Interface is not quite the same as Phillips PCA9547.)

Signed-off-by: Michael Burr <michael.burr@logicpd.com>
Cc: Heiko Schocher <hs@denx.de>
Cc: Michal Simek <monstr@monstr.eu>
drivers/i2c/i2c_core.c
include/i2c.h

index d1072e819b0c1abbce880982c6e394c716e3f1a6..b263562edf268ac16342f2906f64a013ec237f08 100644 (file)
@@ -138,6 +138,11 @@ static int i2c_mux_set(struct i2c_adapter *adap, int mux_id, int chip,
                        return -1;
                buf = (uint8_t)((channel & 0x07) | (1 << 3));
                break;
+       case I2C_MUX_PCA9548_ID:
+               if (channel > 7)
+                       return -1;
+               buf = (uint8_t)(0x01 << channel);
+               break;
        default:
                printf("%s: wrong mux id: %d\n", __func__, mux_id);
                return -1;
index 8fd17d190af7cd532a445b77aaadceee00967bdd..c1be533d57cd710ae57462da9209651de8c21758 100644 (file)
@@ -135,6 +135,8 @@ extern struct i2c_bus_hose  i2c_bus[];
 #define I2C_MUX_PCA9544                {I2C_MUX_PCA9544_ID, "PCA9544A"}
 #define I2C_MUX_PCA9547_ID     4
 #define I2C_MUX_PCA9547                {I2C_MUX_PCA9547_ID, "PCA9547A"}
+#define I2C_MUX_PCA9548_ID     5
+#define I2C_MUX_PCA9548                {I2C_MUX_PCA9548_ID, "PCA9548"}
 #endif
 
 #ifndef I2C_SOFT_DECLARATIONS