From 83465554242e2bc4898f3a676f2e5304401f020d Mon Sep 17 00:00:00 2001 From: Wyon Bi Date: Sat, 20 Aug 2022 10:41:26 +0000 Subject: [PATCH] mfd: max96745: Support i2c-mux-idle-disconnect property This is used, for example, when there are several multiplexers on the same bus and the devices on the underlying buses might have same I2C addresses. Signed-off-by: Wyon Bi Change-Id: I33e8206c55785808e2e29128a572ea657cb45f62 --- drivers/mfd/max96745.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/mfd/max96745.c b/drivers/mfd/max96745.c index c56d462167ab..af7fac7d3f5b 100644 --- a/drivers/mfd/max96745.c +++ b/drivers/mfd/max96745.c @@ -202,6 +202,7 @@ static int max96745_i2c_probe(struct i2c_client *client) struct device_node *child; struct max96745 *max96745; unsigned int nr = 0; + bool idle_disc; int ret; for_each_available_child_of_node(dev->of_node, child) { @@ -215,9 +216,11 @@ static int max96745_i2c_probe(struct i2c_client *client) if (!max96745) return -ENOMEM; + idle_disc = device_property_read_bool(dev, "i2c-mux-idle-disconnect"); + max96745->muxc = i2c_mux_alloc(client->adapter, dev, nr, - 0, I2C_MUX_LOCKED, - max96745_select, max96745_deselect); + 0, I2C_MUX_LOCKED, max96745_select, + idle_disc ? max96745_deselect : NULL); if (!max96745->muxc) return -ENOMEM;