瀏覽代碼

i2c: mux: inform the i2c mux core about how it is used

The i2c mux core can then take appropriate action depending on if it is
used for an actual i2c mux, for a gate or for an arbitrator (the last
is the case for these drivers). This adds support for the new clearer
and more compact devicetree bindings that was added recently.

Reviewed-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Peter Rosin <peda@axentia.se>
Peter Rosin 9 年之前
父節點
當前提交
40839590f8
共有 2 個文件被更改,包括 3 次插入2 次删除
  1. 1 1
      drivers/i2c/muxes/i2c-arb-gpio-challenge.c
  2. 2 1
      drivers/i2c/muxes/i2c-mux-pca9541.c

+ 1 - 1
drivers/i2c/muxes/i2c-arb-gpio-challenge.c

@@ -130,7 +130,7 @@ static int i2c_arbitrator_probe(struct platform_device *pdev)
 		return -EINVAL;
 		return -EINVAL;
 	}
 	}
 
 
-	muxc = i2c_mux_alloc(NULL, dev, 1, sizeof(*arb), 0,
+	muxc = i2c_mux_alloc(NULL, dev, 1, sizeof(*arb), I2C_MUX_ARBITRATOR,
 			     i2c_arbitrator_select, i2c_arbitrator_deselect);
 			     i2c_arbitrator_select, i2c_arbitrator_deselect);
 	if (!muxc)
 	if (!muxc)
 		return -ENOMEM;
 		return -ENOMEM;

+ 2 - 1
drivers/i2c/muxes/i2c-mux-pca9541.c

@@ -349,7 +349,8 @@ static int pca9541_probe(struct i2c_client *client,
 	force = 0;
 	force = 0;
 	if (pdata)
 	if (pdata)
 		force = pdata->modes[0].adap_id;
 		force = pdata->modes[0].adap_id;
-	muxc = i2c_mux_alloc(adap, &client->dev, 1, sizeof(*data), 0,
+	muxc = i2c_mux_alloc(adap, &client->dev, 1, sizeof(*data),
+			     I2C_MUX_ARBITRATOR,
 			     pca9541_select_chan, pca9541_release_chan);
 			     pca9541_select_chan, pca9541_release_chan);
 	if (!muxc)
 	if (!muxc)
 		return -ENOMEM;
 		return -ENOMEM;