aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-11-19 16:35:09 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-11-19 16:35:09 -0500
commit50d438fb9e4229cb37ec89a22c066b626e30885c (patch)
tree30a68ca0fd190054f6c0b61b46c433ce161115d8
parentdce9ce3615ca03bd7adb09a182b5ee192684f17f (diff)
parentad092de60f865c1ad94221bd06d381ecea446cc8 (diff)
Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull i2c fixes from Wolfram Sang: "Some I2C driver bugfixes (and one documentation fix)" * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: i2c-mux-pca954x: fix deselect enabling for device-tree i2c: digicolor: use clk_disable_unprepare instead of clk_unprepare i2c: mux: fix up dependencies i2c: Documentation: i2c-topology: fix minor whitespace nit i2c: mux: demux-pinctrl: make drivers with no pinctrl work again
-rw-r--r--Documentation/i2c/i2c-topology4
-rw-r--r--drivers/i2c/Kconfig1
-rw-r--r--drivers/i2c/busses/i2c-digicolor.c2
-rw-r--r--drivers/i2c/muxes/Kconfig1
-rw-r--r--drivers/i2c/muxes/i2c-demux-pinctrl.c22
-rw-r--r--drivers/i2c/muxes/i2c-mux-pca954x.c4
6 files changed, 26 insertions, 8 deletions
diff --git a/Documentation/i2c/i2c-topology b/Documentation/i2c/i2c-topology
index e0aefeece551..1a014fede0b7 100644
--- a/Documentation/i2c/i2c-topology
+++ b/Documentation/i2c/i2c-topology
@@ -326,7 +326,7 @@ Two parent-locked sibling muxes
326 326
327This is a good topology. 327This is a good topology.
328 328
329 .--------. 329 .--------.
330 .----------. .--| dev D1 | 330 .----------. .--| dev D1 |
331 | parent- |--' '--------' 331 | parent- |--' '--------'
332 .--| locked | .--------. 332 .--| locked | .--------.
@@ -350,7 +350,7 @@ Mux-locked and parent-locked sibling muxes
350 350
351This is a good topology. 351This is a good topology.
352 352
353 .--------. 353 .--------.
354 .----------. .--| dev D1 | 354 .----------. .--| dev D1 |
355 | mux- |--' '--------' 355 | mux- |--' '--------'
356 .--| locked | .--------. 356 .--| locked | .--------.
diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig
index d223650a97e4..11edabf425ae 100644
--- a/drivers/i2c/Kconfig
+++ b/drivers/i2c/Kconfig
@@ -59,7 +59,6 @@ config I2C_CHARDEV
59 59
60config I2C_MUX 60config I2C_MUX
61 tristate "I2C bus multiplexing support" 61 tristate "I2C bus multiplexing support"
62 depends on HAS_IOMEM
63 help 62 help
64 Say Y here if you want the I2C core to support the ability to 63 Say Y here if you want the I2C core to support the ability to
65 handle multiplexed I2C bus topologies, by presenting each 64 handle multiplexed I2C bus topologies, by presenting each
diff --git a/drivers/i2c/busses/i2c-digicolor.c b/drivers/i2c/busses/i2c-digicolor.c
index 49f2084f7bb5..50813a24c541 100644
--- a/drivers/i2c/busses/i2c-digicolor.c
+++ b/drivers/i2c/busses/i2c-digicolor.c
@@ -347,7 +347,7 @@ static int dc_i2c_probe(struct platform_device *pdev)
347 347
348 ret = i2c_add_adapter(&i2c->adap); 348 ret = i2c_add_adapter(&i2c->adap);
349 if (ret < 0) { 349 if (ret < 0) {
350 clk_unprepare(i2c->clk); 350 clk_disable_unprepare(i2c->clk);
351 return ret; 351 return ret;
352 } 352 }
353 353
diff --git a/drivers/i2c/muxes/Kconfig b/drivers/i2c/muxes/Kconfig
index e280c8ecc0b5..96de9ce5669b 100644
--- a/drivers/i2c/muxes/Kconfig
+++ b/drivers/i2c/muxes/Kconfig
@@ -63,6 +63,7 @@ config I2C_MUX_PINCTRL
63 63
64config I2C_MUX_REG 64config I2C_MUX_REG
65 tristate "Register-based I2C multiplexer" 65 tristate "Register-based I2C multiplexer"
66 depends on HAS_IOMEM
66 help 67 help
67 If you say yes to this option, support will be included for a 68 If you say yes to this option, support will be included for a
68 register based I2C multiplexer. This driver provides access to 69 register based I2C multiplexer. This driver provides access to
diff --git a/drivers/i2c/muxes/i2c-demux-pinctrl.c b/drivers/i2c/muxes/i2c-demux-pinctrl.c
index b3893f6282ba..3e6fe1760d82 100644
--- a/drivers/i2c/muxes/i2c-demux-pinctrl.c
+++ b/drivers/i2c/muxes/i2c-demux-pinctrl.c
@@ -69,10 +69,28 @@ static int i2c_demux_activate_master(struct i2c_demux_pinctrl_priv *priv, u32 ne
69 goto err_with_revert; 69 goto err_with_revert;
70 } 70 }
71 71
72 p = devm_pinctrl_get_select(adap->dev.parent, priv->bus_name); 72 /*
73 * Check if there are pinctrl states at all. Note: we cant' use
74 * devm_pinctrl_get_select() because we need to distinguish between
75 * the -ENODEV from devm_pinctrl_get() and pinctrl_lookup_state().
76 */
77 p = devm_pinctrl_get(adap->dev.parent);
73 if (IS_ERR(p)) { 78 if (IS_ERR(p)) {
74 ret = PTR_ERR(p); 79 ret = PTR_ERR(p);
75 goto err_with_put; 80 /* continue if just no pinctrl states (e.g. i2c-gpio), otherwise exit */
81 if (ret != -ENODEV)
82 goto err_with_put;
83 } else {
84 /* there are states. check and use them */
85 struct pinctrl_state *s = pinctrl_lookup_state(p, priv->bus_name);
86
87 if (IS_ERR(s)) {
88 ret = PTR_ERR(s);
89 goto err_with_put;
90 }
91 ret = pinctrl_select_state(p, s);
92 if (ret < 0)
93 goto err_with_put;
76 } 94 }
77 95
78 priv->chan[new_chan].parent_adap = adap; 96 priv->chan[new_chan].parent_adap = adap;
diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c
index 1091346f2480..8bc3d36d2837 100644
--- a/drivers/i2c/muxes/i2c-mux-pca954x.c
+++ b/drivers/i2c/muxes/i2c-mux-pca954x.c
@@ -268,9 +268,9 @@ static int pca954x_probe(struct i2c_client *client,
268 /* discard unconfigured channels */ 268 /* discard unconfigured channels */
269 break; 269 break;
270 idle_disconnect_pd = pdata->modes[num].deselect_on_exit; 270 idle_disconnect_pd = pdata->modes[num].deselect_on_exit;
271 data->deselect |= (idle_disconnect_pd
272 || idle_disconnect_dt) << num;
273 } 271 }
272 data->deselect |= (idle_disconnect_pd ||
273 idle_disconnect_dt) << num;
274 274
275 ret = i2c_mux_add_adapter(muxc, force, num, class); 275 ret = i2c_mux_add_adapter(muxc, force, num, class);
276 276