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 <bivvy.bi@rock-chips.com>
Change-Id: I33e8206c55785808e2e29128a572ea657cb45f62
This commit is contained in:
Wyon Bi
2022-08-20 10:41:26 +00:00
committed by Tao Huang
parent 73a2042551
commit 8346555424

View File

@@ -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;