aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-01-28 18:09:23 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-01-28 18:09:23 -0500
commit53cd1ad1a68fd10f677445e04ed63aa9ce39b36b (patch)
treec3401d2cbce4615b9a4e1d2bc060e8a310321eaa
parentd56a5ca366e785f463b4782f65daac883612a2b2 (diff)
parente13fe92bb58cf9b8f709ec18267ffc9e6ffeb016 (diff)
Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull i2c fixes from Wolfram Sang: "Two I2C driver bugfixes. The 'VLLS mode support' patch should have been entitled 'reconfigure pinctrl after suspend' to make the bugfix more clear. Sorry, I missed that, yet didn't want to rebase" * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: imx-lpi2c: add VLLS mode support i2c: i2c-cadence: Initialize configuration before probing devices
-rw-r--r--drivers/i2c/busses/i2c-cadence.c8
-rw-r--r--drivers/i2c/busses/i2c-imx-lpi2c.c20
2 files changed, 24 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-cadence.c b/drivers/i2c/busses/i2c-cadence.c
index 686971263bef..45d6771fac8c 100644
--- a/drivers/i2c/busses/i2c-cadence.c
+++ b/drivers/i2c/busses/i2c-cadence.c
@@ -962,10 +962,6 @@ static int cdns_i2c_probe(struct platform_device *pdev)
962 goto err_clk_dis; 962 goto err_clk_dis;
963 } 963 }
964 964
965 ret = i2c_add_adapter(&id->adap);
966 if (ret < 0)
967 goto err_clk_dis;
968
969 /* 965 /*
970 * Cadence I2C controller has a bug wherein it generates 966 * Cadence I2C controller has a bug wherein it generates
971 * invalid read transaction after HW timeout in master receiver mode. 967 * invalid read transaction after HW timeout in master receiver mode.
@@ -975,6 +971,10 @@ static int cdns_i2c_probe(struct platform_device *pdev)
975 */ 971 */
976 cdns_i2c_writereg(CDNS_I2C_TIMEOUT_MAX, CDNS_I2C_TIME_OUT_OFFSET); 972 cdns_i2c_writereg(CDNS_I2C_TIMEOUT_MAX, CDNS_I2C_TIME_OUT_OFFSET);
977 973
974 ret = i2c_add_adapter(&id->adap);
975 if (ret < 0)
976 goto err_clk_dis;
977
978 dev_info(&pdev->dev, "%u kHz mmio %08lx irq %d\n", 978 dev_info(&pdev->dev, "%u kHz mmio %08lx irq %d\n",
979 id->i2c_clk / 1000, (unsigned long)r_mem->start, id->irq); 979 id->i2c_clk / 1000, (unsigned long)r_mem->start, id->irq);
980 980
diff --git a/drivers/i2c/busses/i2c-imx-lpi2c.c b/drivers/i2c/busses/i2c-imx-lpi2c.c
index c62b7cd475f8..3310f2e0dbd3 100644
--- a/drivers/i2c/busses/i2c-imx-lpi2c.c
+++ b/drivers/i2c/busses/i2c-imx-lpi2c.c
@@ -28,6 +28,7 @@
28#include <linux/module.h> 28#include <linux/module.h>
29#include <linux/of.h> 29#include <linux/of.h>
30#include <linux/of_device.h> 30#include <linux/of_device.h>
31#include <linux/pinctrl/consumer.h>
31#include <linux/platform_device.h> 32#include <linux/platform_device.h>
32#include <linux/sched.h> 33#include <linux/sched.h>
33#include <linux/slab.h> 34#include <linux/slab.h>
@@ -636,12 +637,31 @@ static int lpi2c_imx_remove(struct platform_device *pdev)
636 return 0; 637 return 0;
637} 638}
638 639
640#ifdef CONFIG_PM_SLEEP
641static int lpi2c_imx_suspend(struct device *dev)
642{
643 pinctrl_pm_select_sleep_state(dev);
644
645 return 0;
646}
647
648static int lpi2c_imx_resume(struct device *dev)
649{
650 pinctrl_pm_select_default_state(dev);
651
652 return 0;
653}
654#endif
655
656static SIMPLE_DEV_PM_OPS(imx_lpi2c_pm, lpi2c_imx_suspend, lpi2c_imx_resume);
657
639static struct platform_driver lpi2c_imx_driver = { 658static struct platform_driver lpi2c_imx_driver = {
640 .probe = lpi2c_imx_probe, 659 .probe = lpi2c_imx_probe,
641 .remove = lpi2c_imx_remove, 660 .remove = lpi2c_imx_remove,
642 .driver = { 661 .driver = {
643 .name = DRIVER_NAME, 662 .name = DRIVER_NAME,
644 .of_match_table = lpi2c_imx_of_match, 663 .of_match_table = lpi2c_imx_of_match,
664 .pm = &imx_lpi2c_pm,
645 }, 665 },
646}; 666};
647 667