mfd: max96755f: 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: Idf2ff4dad5dabffaf7065a3f5d39cf3621b574a1
This commit is contained in:
Wyon Bi
2022-08-20 10:47:53 +00:00
committed by Tao Huang
parent 8346555424
commit 81f7ff481e

View File

@@ -208,6 +208,7 @@ static int max96755f_i2c_probe(struct i2c_client *client)
struct device_node *child;
struct max96755f *max96755f;
unsigned int nr = 0;
bool idle_disc;
int ret;
for_each_available_child_of_node(dev->of_node, child) {
@@ -221,9 +222,11 @@ static int max96755f_i2c_probe(struct i2c_client *client)
if (!max96755f)
return -ENOMEM;
idle_disc = device_property_read_bool(dev, "i2c-mux-idle-disconnect");
max96755f->muxc = i2c_mux_alloc(client->adapter, dev, nr, 0,
I2C_MUX_LOCKED, max96755f_select,
max96755f_deselect);
I2C_MUX_LOCKED, max96755f_select,
idle_disc ? max96755f_deselect : NULL);
if (!max96755f->muxc)
return -ENOMEM;