i2c: i2c-mux-pca954x: fix deselect enabling for device-tree
authorAlex Hemme <ahemme@cisco.com>
Sat, 19 Nov 2016 09:48:38 +0000 (10:48 +0100)
committerWolfram Sang <wsa@the-dreams.de>
Sat, 19 Nov 2016 20:49:29 +0000 (21:49 +0100)
Deselect functionality can be ignored for device-trees with
"i2c-mux-idle-disconnect" entries if no platform_data is available.
By enabling the deselect functionality outside the platform_data
block the logic works as it did in previous kernels.

Fixes: 7fcac9807175 ("i2c: i2c-mux-pca954x: convert to use an explicit i2c mux core")
Cc: <stable@vger.kernel.org> # v4.7+
Signed-off-by: Alex Hemme <ahemme@cisco.com>
Signed-off-by: Ziyang Wu <ziywu@cisco.com>
[touched up a few minor issues /peda]
Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/muxes/i2c-mux-pca954x.c

index 1091346f2480a6e4c4a79dd1836964894b9c8169..8bc3d36d28379ee9bf834b49d8022a310e55aee4 100644 (file)
@@ -268,9 +268,9 @@ static int pca954x_probe(struct i2c_client *client,
                                /* discard unconfigured channels */
                                break;
                        idle_disconnect_pd = pdata->modes[num].deselect_on_exit;
-                       data->deselect |= (idle_disconnect_pd
-                                          || idle_disconnect_dt) << num;
                }
+               data->deselect |= (idle_disconnect_pd ||
+                                  idle_disconnect_dt) << num;
 
                ret = i2c_mux_add_adapter(muxc, force, num, class);