mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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
This commit is contained in:
commit
50d438fb9e
6 changed files with 26 additions and 8 deletions
|
@ -326,7 +326,7 @@ Two parent-locked sibling muxes
|
||||||
|
|
||||||
This is a good topology.
|
This is a good topology.
|
||||||
|
|
||||||
.--------.
|
.--------.
|
||||||
.----------. .--| dev D1 |
|
.----------. .--| dev D1 |
|
||||||
| parent- |--' '--------'
|
| parent- |--' '--------'
|
||||||
.--| locked | .--------.
|
.--| locked | .--------.
|
||||||
|
@ -350,7 +350,7 @@ Mux-locked and parent-locked sibling muxes
|
||||||
|
|
||||||
This is a good topology.
|
This is a good topology.
|
||||||
|
|
||||||
.--------.
|
.--------.
|
||||||
.----------. .--| dev D1 |
|
.----------. .--| dev D1 |
|
||||||
| mux- |--' '--------'
|
| mux- |--' '--------'
|
||||||
.--| locked | .--------.
|
.--| locked | .--------.
|
||||||
|
|
|
@ -59,7 +59,6 @@ config I2C_CHARDEV
|
||||||
|
|
||||||
config I2C_MUX
|
config I2C_MUX
|
||||||
tristate "I2C bus multiplexing support"
|
tristate "I2C bus multiplexing support"
|
||||||
depends on HAS_IOMEM
|
|
||||||
help
|
help
|
||||||
Say Y here if you want the I2C core to support the ability to
|
Say Y here if you want the I2C core to support the ability to
|
||||||
handle multiplexed I2C bus topologies, by presenting each
|
handle multiplexed I2C bus topologies, by presenting each
|
||||||
|
|
|
@ -347,7 +347,7 @@ static int dc_i2c_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
ret = i2c_add_adapter(&i2c->adap);
|
ret = i2c_add_adapter(&i2c->adap);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
clk_unprepare(i2c->clk);
|
clk_disable_unprepare(i2c->clk);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,6 +63,7 @@ config I2C_MUX_PINCTRL
|
||||||
|
|
||||||
config I2C_MUX_REG
|
config I2C_MUX_REG
|
||||||
tristate "Register-based I2C multiplexer"
|
tristate "Register-based I2C multiplexer"
|
||||||
|
depends on HAS_IOMEM
|
||||||
help
|
help
|
||||||
If you say yes to this option, support will be included for a
|
If you say yes to this option, support will be included for a
|
||||||
register based I2C multiplexer. This driver provides access to
|
register based I2C multiplexer. This driver provides access to
|
||||||
|
|
|
@ -69,10 +69,28 @@ static int i2c_demux_activate_master(struct i2c_demux_pinctrl_priv *priv, u32 ne
|
||||||
goto err_with_revert;
|
goto err_with_revert;
|
||||||
}
|
}
|
||||||
|
|
||||||
p = devm_pinctrl_get_select(adap->dev.parent, priv->bus_name);
|
/*
|
||||||
|
* Check if there are pinctrl states at all. Note: we cant' use
|
||||||
|
* devm_pinctrl_get_select() because we need to distinguish between
|
||||||
|
* the -ENODEV from devm_pinctrl_get() and pinctrl_lookup_state().
|
||||||
|
*/
|
||||||
|
p = devm_pinctrl_get(adap->dev.parent);
|
||||||
if (IS_ERR(p)) {
|
if (IS_ERR(p)) {
|
||||||
ret = PTR_ERR(p);
|
ret = PTR_ERR(p);
|
||||||
goto err_with_put;
|
/* continue if just no pinctrl states (e.g. i2c-gpio), otherwise exit */
|
||||||
|
if (ret != -ENODEV)
|
||||||
|
goto err_with_put;
|
||||||
|
} else {
|
||||||
|
/* there are states. check and use them */
|
||||||
|
struct pinctrl_state *s = pinctrl_lookup_state(p, priv->bus_name);
|
||||||
|
|
||||||
|
if (IS_ERR(s)) {
|
||||||
|
ret = PTR_ERR(s);
|
||||||
|
goto err_with_put;
|
||||||
|
}
|
||||||
|
ret = pinctrl_select_state(p, s);
|
||||||
|
if (ret < 0)
|
||||||
|
goto err_with_put;
|
||||||
}
|
}
|
||||||
|
|
||||||
priv->chan[new_chan].parent_adap = adap;
|
priv->chan[new_chan].parent_adap = adap;
|
||||||
|
|
|
@ -268,9 +268,9 @@ static int pca954x_probe(struct i2c_client *client,
|
||||||
/* discard unconfigured channels */
|
/* discard unconfigured channels */
|
||||||
break;
|
break;
|
||||||
idle_disconnect_pd = pdata->modes[num].deselect_on_exit;
|
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);
|
ret = i2c_mux_add_adapter(muxc, force, num, class);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue