diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2014-01-10 18:50:54 +0530 |
---|---|---|
committer | Laxman Dewangan <ldewangan@nvidia.com> | 2014-01-13 00:26:24 -0800 |
commit | 53c76f668025e0bf8bcd6a75201ecfae299d19a3 (patch) | |
tree | 214bfcbdefc6ea092e7118085262e15ae19f7968 /drivers/i2c | |
parent | 538993e9f148fa98592ab56af84f9084bd0ac16d (diff) |
i2c: mux: pca954x: pass deselect mux when it is register from DT
If device is registered from DT then pass the deslect_mux callback
always to register the bus adpater. i2c-mux core driver parse
the required propery from child bus node and enable deselct-mux
accordingly.
Change-Id: If11b251c39575812639af6bd455d9c84c7282eba
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/354256
GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/muxes/i2c-mux-pca954x.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c index 15bf2ae32320..46f459333ed5 100644 --- a/drivers/i2c/muxes/i2c-mux-pca954x.c +++ b/drivers/i2c/muxes/i2c-mux-pca954x.c @@ -305,6 +305,8 @@ static int pca954x_probe(struct i2c_client *client, /* Now create an adapter for each channel */ for (num = 0; num < chips[data->type].nchans; num++) { + bool deselect_on_exit = false; + force = 0; /* dynamic adap number */ class = 0; /* no class by default */ if (pdata) { @@ -312,15 +314,19 @@ static int pca954x_probe(struct i2c_client *client, /* force static number */ force = pdata->modes[num].adap_id; class = pdata->modes[num].class; + deselect_on_exit = + pdata->modes[num].deselect_on_exit; } else /* discard unconfigured channels */ break; } + if (client->dev.of_node) + deselect_on_exit = true; data->virt_adaps[num] = i2c_add_mux_adapter(adap, &client->dev, client, force, num, class, pca954x_select_chan, - (pdata && pdata->modes[num].deselect_on_exit) + (deselect_on_exit) ? pca954x_deselect_mux : NULL); if (data->virt_adaps[num] == NULL) { |