diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-14 10:21:46 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-14 10:21:46 +0300 |
commit | 9bca19a01d50143b736f0f59eb3ccc05b1106172 (patch) | |
tree | 3321118b4a6bd4c949634bbdbb3d2c03454ae33b /drivers/i2c/muxes | |
parent | 463f202172c31b9c36278001cabfbad4e12da42e (diff) | |
parent | 53e39628ac228fada53cc0106be62c6f65f67501 (diff) | |
download | linux-9bca19a01d50143b736f0f59eb3ccc05b1106172.tar.xz |
Merge branch 'i2c/for-4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull i2c updates from Wolfram Sang:
- mainly feature additions to drivers (stm32f7, qup, xlp9xx, mlxcpld, ...)
- conversion to use the i2c_8bit_addr_from_msg macro consistently
- move includes to platform_data
- core updates to allow the (still in review) I3C subsystem to connect
- and the regular share of smaller driver updates
* 'i2c/for-4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (68 commits)
i2c: qup: fix building without CONFIG_ACPI
i2c: tegra: Remove suspend-resume
i2c: imx-lpi2c: Switch to SPDX identifier
i2c: mxs: Switch to SPDX identifier
i2c: busses: make use of i2c_8bit_addr_from_msg
i2c: algos: make use of i2c_8bit_addr_from_msg
i2c: rcar: document R8A77980 bindings
i2c: qup: Add command-line parameter to override SCL frequency
i2c: qup: Correct duty cycle for FM and FM+
i2c: qup: Add support for Fast Mode Plus
i2c: qup: add probe path for Centriq ACPI devices
i2c: robotfuzz-osif: drop pointless test
i2c: robotfuzz-osif: remove pointless local variable
i2c: rk3x: Don't print visible virtual mapping MMIO address
i2c: opal: don't check number of messages in the driver
i2c: ibm_iic: don't check number of messages in the driver
i2c: imx: Switch to SPDX identifier
i2c: mux: pca954x: merge calls to of_match_device and of_device_get_match_data
i2c: mux: demux-pinctrl: use proper parent device for demux adapter
i2c: mux: improve error message for failed symlink
...
Diffstat (limited to 'drivers/i2c/muxes')
-rw-r--r-- | drivers/i2c/muxes/i2c-demux-pinctrl.c | 5 | ||||
-rw-r--r-- | drivers/i2c/muxes/i2c-mux-gpio.c | 2 | ||||
-rw-r--r-- | drivers/i2c/muxes/i2c-mux-ltc4306.c | 7 | ||||
-rw-r--r-- | drivers/i2c/muxes/i2c-mux-pca954x.c | 18 | ||||
-rw-r--r-- | drivers/i2c/muxes/i2c-mux-reg.c | 4 |
5 files changed, 20 insertions, 16 deletions
diff --git a/drivers/i2c/muxes/i2c-demux-pinctrl.c b/drivers/i2c/muxes/i2c-demux-pinctrl.c index 33ce032cb701..035032e20327 100644 --- a/drivers/i2c/muxes/i2c-demux-pinctrl.c +++ b/drivers/i2c/muxes/i2c-demux-pinctrl.c @@ -18,6 +18,7 @@ #include <linux/of.h> #include <linux/pinctrl/consumer.h> #include <linux/platform_device.h> +#include <linux/pm_runtime.h> #include <linux/slab.h> #include <linux/sysfs.h> @@ -105,7 +106,7 @@ static int i2c_demux_activate_master(struct i2c_demux_pinctrl_priv *priv, u32 ne priv->cur_adap.owner = THIS_MODULE; priv->cur_adap.algo = &priv->algo; priv->cur_adap.algo_data = priv; - priv->cur_adap.dev.parent = priv->dev; + priv->cur_adap.dev.parent = &adap->dev; priv->cur_adap.class = adap->class; priv->cur_adap.retries = adap->retries; priv->cur_adap.timeout = adap->timeout; @@ -254,6 +255,8 @@ static int i2c_demux_pinctrl_probe(struct platform_device *pdev) platform_set_drvdata(pdev, priv); + pm_runtime_no_callbacks(&pdev->dev); + /* switch to first parent as active master */ i2c_demux_activate_master(priv, 0); diff --git a/drivers/i2c/muxes/i2c-mux-gpio.c b/drivers/i2c/muxes/i2c-mux-gpio.c index ddc4bd4ca13b..401308e3d036 100644 --- a/drivers/i2c/muxes/i2c-mux-gpio.c +++ b/drivers/i2c/muxes/i2c-mux-gpio.c @@ -10,7 +10,7 @@ #include <linux/i2c.h> #include <linux/i2c-mux.h> -#include <linux/i2c-mux-gpio.h> +#include <linux/platform_data/i2c-mux-gpio.h> #include <linux/platform_device.h> #include <linux/module.h> #include <linux/slab.h> diff --git a/drivers/i2c/muxes/i2c-mux-ltc4306.c b/drivers/i2c/muxes/i2c-mux-ltc4306.c index 311b1cced0c0..a9af93259b19 100644 --- a/drivers/i2c/muxes/i2c-mux-ltc4306.c +++ b/drivers/i2c/muxes/i2c-mux-ltc4306.c @@ -206,8 +206,7 @@ static const struct of_device_id ltc4306_of_match[] = { }; MODULE_DEVICE_TABLE(of, ltc4306_of_match); -static int ltc4306_probe(struct i2c_client *client, - const struct i2c_device_id *id) +static int ltc4306_probe(struct i2c_client *client) { struct i2c_adapter *adap = to_i2c_adapter(client->dev.parent); const struct chip_desc *chip; @@ -221,7 +220,7 @@ static int ltc4306_probe(struct i2c_client *client, chip = of_device_get_match_data(&client->dev); if (!chip) - chip = &chips[id->driver_data]; + chip = &chips[i2c_match_id(ltc4306_id, client)->driver_data]; idle_disc = device_property_read_bool(&client->dev, "i2c-mux-idle-disconnect"); @@ -310,7 +309,7 @@ static struct i2c_driver ltc4306_driver = { .name = "ltc4306", .of_match_table = of_match_ptr(ltc4306_of_match), }, - .probe = ltc4306_probe, + .probe_new = ltc4306_probe, .remove = ltc4306_remove, .id_table = ltc4306_id, }; diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c index 09bafd3e68fa..fbc748027087 100644 --- a/drivers/i2c/muxes/i2c-mux-pca954x.c +++ b/drivers/i2c/muxes/i2c-mux-pca954x.c @@ -36,6 +36,7 @@ */ #include <linux/device.h> +#include <linux/delay.h> #include <linux/gpio/consumer.h> #include <linux/i2c.h> #include <linux/i2c-mux.h> @@ -373,7 +374,6 @@ static int pca954x_probe(struct i2c_client *client, int num, force, class; struct i2c_mux_core *muxc; struct pca954x *data; - const struct of_device_id *match; int ret; if (!i2c_check_functionality(adap, I2C_FUNC_SMBUS_BYTE)) @@ -389,15 +389,19 @@ static int pca954x_probe(struct i2c_client *client, i2c_set_clientdata(client, muxc); data->client = client; - /* Get the mux out of reset if a reset GPIO is specified. */ - gpio = devm_gpiod_get_optional(&client->dev, "reset", GPIOD_OUT_LOW); + /* Reset the mux if a reset GPIO is specified. */ + gpio = devm_gpiod_get_optional(&client->dev, "reset", GPIOD_OUT_HIGH); if (IS_ERR(gpio)) return PTR_ERR(gpio); + if (gpio) { + udelay(1); + gpiod_set_value_cansleep(gpio, 0); + /* Give the chip some time to recover. */ + udelay(1); + } - match = of_match_device(of_match_ptr(pca954x_of_match), &client->dev); - if (match) - data->chip = of_device_get_match_data(&client->dev); - else + data->chip = of_device_get_match_data(&client->dev); + if (!data->chip) data->chip = &chips[id->driver_data]; if (data->chip->id.manufacturer_id != I2C_DEVICE_ID_NONE) { diff --git a/drivers/i2c/muxes/i2c-mux-reg.c b/drivers/i2c/muxes/i2c-mux-reg.c index f583f805fee9..5653295b01cd 100644 --- a/drivers/i2c/muxes/i2c-mux-reg.c +++ b/drivers/i2c/muxes/i2c-mux-reg.c @@ -127,10 +127,8 @@ static int i2c_mux_reg_probe_dt(struct regmux *mux, values = devm_kcalloc(&pdev->dev, mux->data.n_values, sizeof(*mux->data.values), GFP_KERNEL); - if (!values) { - dev_err(&pdev->dev, "Cannot allocate values array"); + if (!values) return -ENOMEM; - } for_each_child_of_node(np, child) { of_property_read_u32(child, "reg", values + i); |