From 365ae2dcb93a6fcf5f93a80f0c6989cf8a094ca6 Mon Sep 17 00:00:00 2001 From: Jeffrey Townsend Date: Wed, 4 Jan 2017 20:54:45 +0000 Subject: [PATCH] PC954X Deselect patch. --- ...s-i2c-muxes-pca954x-deselect-on-exit.patch | 58 +++++++++++++++++++ .../base/any/kernels/3.16-lts/patches/series | 1 + 2 files changed, 59 insertions(+) create mode 100644 packages/base/any/kernels/3.16-lts/patches/drivers-i2c-muxes-pca954x-deselect-on-exit.patch diff --git a/packages/base/any/kernels/3.16-lts/patches/drivers-i2c-muxes-pca954x-deselect-on-exit.patch b/packages/base/any/kernels/3.16-lts/patches/drivers-i2c-muxes-pca954x-deselect-on-exit.patch new file mode 100644 index 00000000..6c78a34b --- /dev/null +++ b/packages/base/any/kernels/3.16-lts/patches/drivers-i2c-muxes-pca954x-deselect-on-exit.patch @@ -0,0 +1,58 @@ +diff -urpN a/drivers/i2c/muxes/Kconfig b/drivers/i2c/muxes/Kconfig +--- a/drivers/i2c/muxes/Kconfig 2016-11-20 01:17:41.000000000 +0000 ++++ b/drivers/i2c/muxes/Kconfig 2017-01-04 19:39:46.292811921 +0000 +@@ -48,6 +48,13 @@ config I2C_MUX_PCA954x + This driver can also be built as a module. If so, the module + will be called i2c-mux-pca954x. + ++config I2C_MUX_PCA954X_DESELECT_ON_EXIT ++ bool "Enable deselect-on-exit feature for PCA954X devices." ++ depends on I2C_MUX_PCA954x ++ help ++ If you say yes here you enable the deselect-on-exit feature in ++ the pca954x i2c driver. ++ + config I2C_MUX_PINCTRL + tristate "pinctrl-based I2C multiplexer" + depends on PINCTRL +diff -urpN a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c +--- a/drivers/i2c/muxes/i2c-mux-pca954x.c 2016-11-20 01:17:41.000000000 +0000 ++++ b/drivers/i2c/muxes/i2c-mux-pca954x.c 2017-01-04 19:41:03.832813604 +0000 +@@ -189,6 +189,7 @@ static int pca954x_probe(struct i2c_clie + int num, force, class; + struct pca954x *data; + int ret; ++ int deselect_on_exit = 0; + + if (!i2c_check_functionality(adap, I2C_FUNC_SMBUS_BYTE)) + return -ENODEV; +@@ -213,6 +214,20 @@ static int pca954x_probe(struct i2c_clie + return -ENODEV; + } + ++ /* ++ * Check whether we want to deselect the mux after the ++ * transaction. This can be specified in one of two ways: ++ * ++ * 1. using platform data: pdata->modes[num].deselect_on_exit ++ * 2. using the device tree property deselect_on_exit ++ */ ++ if (of_find_property(client->dev.of_node, "deselect-on-exit", NULL)) { ++ deselect_on_exit = 1; ++ } ++ ++#ifdef CONFIG_I2C_MUX_PCA954X_DESELECT_ON_EXIT ++ deselect_on_exit = 1; ++#endif + data->type = id->driver_data; + data->last_chan = 0; /* force the first selection */ + +@@ -233,7 +248,7 @@ static int pca954x_probe(struct i2c_clie + 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) ++ (pdata && pdata->modes[num].deselect_on_exit) || deselect_on_exit + ? pca954x_deselect_mux : NULL); + + if (data->virt_adaps[num] == NULL) { diff --git a/packages/base/any/kernels/3.16-lts/patches/series b/packages/base/any/kernels/3.16-lts/patches/series index f0408a45..16f255dd 100644 --- a/packages/base/any/kernels/3.16-lts/patches/series +++ b/packages/base/any/kernels/3.16-lts/patches/series @@ -15,3 +15,4 @@ driver-igb-version-5.3.54.patch driver-support-intel-igb-bcm5461X-phy.patch driver-i2c-bus-intel-ismt-enable-param.patch drivers-i2c-busses-i2c-isch-probe-param.patch +drivers-i2c-muxes-pca954x-deselect-on-exit.patch