summaryrefslogtreecommitdiff
path: root/drivers/i2c
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2014-01-10 18:48:19 +0530
committerLaxman Dewangan <ldewangan@nvidia.com>2014-01-13 00:26:12 -0800
commit538993e9f148fa98592ab56af84f9084bd0ac16d (patch)
tree11b939e25b5bc88264983be8593964e100b004c7 /drivers/i2c
parentd2a9378f15a58c9e17543023291f62453be0016d (diff)
i2c: mux-core: add deselect property on child node
Add deselect enable property on the child node of the mux bus. If child node of mux device have this property then deselect option will be enabled. Change-Id: I7907429e1937c8af608970c8680fe2fcea90da5a Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/354255 GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/i2c-mux.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c
index 7409ebb33c47..abd7fb049c65 100644
--- a/drivers/i2c/i2c-mux.c
+++ b/drivers/i2c/i2c-mux.c
@@ -122,7 +122,6 @@ struct i2c_adapter *i2c_add_mux_adapter(struct i2c_adapter *parent,
priv->mux_priv = mux_priv;
priv->chan_id = chan_id;
priv->select = select;
- priv->deselect = deselect;
/* Need to do algo dynamically because we don't know ahead
* of time what sort of physical adapter we'll be dealing with.
@@ -155,6 +154,7 @@ struct i2c_adapter *i2c_add_mux_adapter(struct i2c_adapter *parent,
*/
if (mux_dev->of_node) {
struct device_node *child;
+ bool enable_deselect;
u32 reg;
for_each_child_of_node(mux_dev->of_node, child) {
@@ -163,9 +163,15 @@ struct i2c_adapter *i2c_add_mux_adapter(struct i2c_adapter *parent,
continue;
if (chan_id == reg) {
priv->adap.dev.of_node = child;
+ enable_deselect = of_property_read_bool(child,
+ "i2c-mux,deselect-on-exit");
+ if (enable_deselect)
+ priv->deselect = deselect;
break;
}
}
+ } else {
+ priv->deselect = deselect;
}
if (force_nr) {