From c6cbfb91b878224e78408a2e15901c79de77115a Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Mon, 20 Apr 2015 15:14:47 -0700 Subject: i2c: rk3x: report number of messages transmitted master_xfer() method should return number of i2c messages transferred, but on Rockchip we were usually returning just 1, which caused trouble with users that actually check number of transferred messages vs. checking for negative error codes. Signed-off-by: Dmitry Torokhov Signed-off-by: Wolfram Sang Cc: stable@kernel.org --- drivers/i2c/busses/i2c-rk3x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c index 5f96b1b3e3a5..019d5426fe52 100644 --- a/drivers/i2c/busses/i2c-rk3x.c +++ b/drivers/i2c/busses/i2c-rk3x.c @@ -833,7 +833,7 @@ static int rk3x_i2c_xfer(struct i2c_adapter *adap, clk_disable(i2c->clk); spin_unlock_irqrestore(&i2c->lock, flags); - return ret; + return ret < 0 ? ret : num; } static u32 rk3x_i2c_func(struct i2c_adapter *adap) -- cgit v1.2.3-59-g8ed1b From 4daf5a2839b38cbb2d234d35bff993609d12ba61 Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Mon, 20 Apr 2015 15:51:39 +0200 Subject: i2c: mxs: fix broken email address My Pengutronix address is not valid anymore, redirect people to the Pengutronix kernel team. Reported-by: Harald Geyer Signed-off-by: Wolfram Sang Acked-by: Robert Schwebel --- drivers/i2c/busses/i2c-mxs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-mxs.c b/drivers/i2c/busses/i2c-mxs.c index 56fceff6ba14..3e84f6c090a5 100644 --- a/drivers/i2c/busses/i2c-mxs.c +++ b/drivers/i2c/busses/i2c-mxs.c @@ -913,7 +913,7 @@ static void __exit mxs_i2c_exit(void) module_exit(mxs_i2c_exit); MODULE_AUTHOR("Marek Vasut "); -MODULE_AUTHOR("Wolfram Sang "); +MODULE_AUTHOR("Wolfram Sang "); MODULE_DESCRIPTION("MXS I2C Bus Driver"); MODULE_LICENSE("GPL"); MODULE_ALIAS("platform:" DRIVER_NAME); -- cgit v1.2.3-59-g8ed1b From 9ef8a0bee93606afb1dd111ccc1d467f261099cc Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Mon, 20 Apr 2015 15:51:40 +0200 Subject: i2c: pca-platform: fix broken email address My Pengutronix address is not valid anymore, redirect people to the Pengutronix kernel team. Reported-by: Harald Geyer Signed-off-by: Wolfram Sang Acked-by: Robert Schwebel --- drivers/i2c/busses/i2c-pca-platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-pca-platform.c b/drivers/i2c/busses/i2c-pca-platform.c index 6336f02ec566..3bd2e7d06e4b 100644 --- a/drivers/i2c/busses/i2c-pca-platform.c +++ b/drivers/i2c/busses/i2c-pca-platform.c @@ -285,6 +285,6 @@ static struct platform_driver i2c_pca_pf_driver = { module_platform_driver(i2c_pca_pf_driver); -MODULE_AUTHOR("Wolfram Sang "); +MODULE_AUTHOR("Wolfram Sang "); MODULE_DESCRIPTION("I2C-PCA9564/PCA9665 platform driver"); MODULE_LICENSE("GPL"); -- cgit v1.2.3-59-g8ed1b From 6ada5c1e1b077ab98fc144d7ac132b4dcc0148ec Mon Sep 17 00:00:00 2001 From: Charles Keepax Date: Thu, 16 Apr 2015 13:05:19 +0100 Subject: i2c: Mark adapter devices with pm_runtime_no_callbacks Commit 523c5b89640e ("i2c: Remove support for legacy PM") removed the PM ops from the bus type, which causes the pm operations on the s3c2410 adapter device to fail (-ENOSUPP in rpm_callback). The adapter device doesn't get bound to a driver and as such can't have its own pm_runtime callbacks. Previously this was fine as the bus callbacks would have been used, but now this can cause devices which use PM runtime and are attached over I2C to fail to resume. This commit fixes this issue by marking all adapter devices with pm_runtime_no_callbacks, since they can't have any. Signed-off-by: Charles Keepax Acked-by: Beata Michalska Signed-off-by: Wolfram Sang Fixes: 523c5b89640e Cc: stable@kernel.org --- drivers/i2c/i2c-core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 098f698fe8f4..987c124432c5 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -1413,6 +1413,8 @@ static int i2c_register_adapter(struct i2c_adapter *adap) dev_dbg(&adap->dev, "adapter [%s] registered\n", adap->name); + pm_runtime_no_callbacks(&adap->dev); + #ifdef CONFIG_I2C_COMPAT res = class_compat_create_link(i2c_adapter_compat_class, &adap->dev, adap->dev.parent); -- cgit v1.2.3-59-g8ed1b From 4c8979b226d773a02586ca75e88b6fb4b2d63a7b Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Wed, 22 Apr 2015 10:16:11 +0200 Subject: i2c: digicolor: remove duplicate include And sort them to prevent this from happening again. Reported-by: Wei Yongjun Signed-off-by: Wolfram Sang --- drivers/i2c/busses/i2c-digicolor.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-digicolor.c b/drivers/i2c/busses/i2c-digicolor.c index 03f1e5549896..9604024e0eb0 100644 --- a/drivers/i2c/busses/i2c-digicolor.c +++ b/drivers/i2c/busses/i2c-digicolor.c @@ -12,11 +12,10 @@ #include #include +#include #include #include #include -#include -#include #include #include #include -- cgit v1.2.3-59-g8ed1b From 133778482ec6c8fde69406be380333963627c17a Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Thu, 23 Apr 2015 10:29:09 +0200 Subject: i2c: mux: use proper dev when removing "channel-X" symlinks Those symlinks are created for the mux_dev, so we need to remove it from there. Currently, it breaks for muxes where the mux_dev is not the device of the parent adapter like this: [ 78.234644] WARNING: CPU: 0 PID: 365 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x5c/0x78() [ 78.242438] sysfs: cannot create duplicate filename '/devices/platform/i2cbus@8/channel-0' Remove confusing comments while we are here. Signed-off-by: Wolfram Sang Signed-off-by: Wolfram Sang Fixes: c9449affad2ae0 Cc: stable@kernel.org --- drivers/i2c/i2c-mux.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c index 593f7ca9adc7..06cc1ff088f1 100644 --- a/drivers/i2c/i2c-mux.c +++ b/drivers/i2c/i2c-mux.c @@ -32,8 +32,9 @@ struct i2c_mux_priv { struct i2c_algorithm algo; struct i2c_adapter *parent; - void *mux_priv; /* the mux chip/device */ - u32 chan_id; /* the channel id */ + struct device *mux_dev; + void *mux_priv; + u32 chan_id; int (*select)(struct i2c_adapter *, void *mux_priv, u32 chan_id); int (*deselect)(struct i2c_adapter *, void *mux_priv, u32 chan_id); @@ -119,6 +120,7 @@ struct i2c_adapter *i2c_add_mux_adapter(struct i2c_adapter *parent, /* Set up private adapter data */ priv->parent = parent; + priv->mux_dev = mux_dev; priv->mux_priv = mux_priv; priv->chan_id = chan_id; priv->select = select; @@ -203,7 +205,7 @@ void i2c_del_mux_adapter(struct i2c_adapter *adap) char symlink_name[20]; snprintf(symlink_name, sizeof(symlink_name), "channel-%u", priv->chan_id); - sysfs_remove_link(&adap->dev.parent->kobj, symlink_name); + sysfs_remove_link(&priv->mux_dev->kobj, symlink_name); sysfs_remove_link(&priv->adap.dev.kobj, "mux_device"); i2c_del_adapter(adap); -- cgit v1.2.3-59-g8ed1b From fcdd5f09c03bfc95f196dfa781ff447c5cbcc319 Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Thu, 23 Apr 2015 13:42:02 +0200 Subject: i2c: st: add include for pinctrl The driver uses pinctrl directly and thus should include the appropriate header. Sort the headers while we are here to have a better view what is included and what is not. Reported-by: Pascal Huerst Signed-off-by: Wolfram Sang --- drivers/i2c/busses/i2c-st.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/i2c/busses/i2c-st.c b/drivers/i2c/busses/i2c-st.c index 88057fad9dfe..ea72dca32fdf 100644 --- a/drivers/i2c/busses/i2c-st.c +++ b/drivers/i2c/busses/i2c-st.c @@ -10,17 +10,18 @@ * published by the Free Software Foundation. */ -#include -#include -#include #include -#include #include -#include #include -#include +#include +#include +#include +#include #include #include +#include +#include +#include /* SSC registers */ #define SSC_BRG 0x000 -- cgit v1.2.3-59-g8ed1b