Skip to content

Commit 53cd1ad

Browse files
committed
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
2 parents d56a5ca + e13fe92 commit 53cd1ad

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

drivers/i2c/busses/i2c-cadence.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -962,10 +962,6 @@ static int cdns_i2c_probe(struct platform_device *pdev)
962962
goto err_clk_dis;
963963
}
964964

965-
ret = i2c_add_adapter(&id->adap);
966-
if (ret < 0)
967-
goto err_clk_dis;
968-
969965
/*
970966
* Cadence I2C controller has a bug wherein it generates
971967
* invalid read transaction after HW timeout in master receiver mode.
@@ -975,6 +971,10 @@ static int cdns_i2c_probe(struct platform_device *pdev)
975971
*/
976972
cdns_i2c_writereg(CDNS_I2C_TIMEOUT_MAX, CDNS_I2C_TIME_OUT_OFFSET);
977973

974+
ret = i2c_add_adapter(&id->adap);
975+
if (ret < 0)
976+
goto err_clk_dis;
977+
978978
dev_info(&pdev->dev, "%u kHz mmio %08lx irq %d\n",
979979
id->i2c_clk / 1000, (unsigned long)r_mem->start, id->irq);
980980

drivers/i2c/busses/i2c-imx-lpi2c.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <linux/module.h>
2929
#include <linux/of.h>
3030
#include <linux/of_device.h>
31+
#include <linux/pinctrl/consumer.h>
3132
#include <linux/platform_device.h>
3233
#include <linux/sched.h>
3334
#include <linux/slab.h>
@@ -636,12 +637,31 @@ static int lpi2c_imx_remove(struct platform_device *pdev)
636637
return 0;
637638
}
638639

640+
#ifdef CONFIG_PM_SLEEP
641+
static int lpi2c_imx_suspend(struct device *dev)
642+
{
643+
pinctrl_pm_select_sleep_state(dev);
644+
645+
return 0;
646+
}
647+
648+
static int lpi2c_imx_resume(struct device *dev)
649+
{
650+
pinctrl_pm_select_default_state(dev);
651+
652+
return 0;
653+
}
654+
#endif
655+
656+
static SIMPLE_DEV_PM_OPS(imx_lpi2c_pm, lpi2c_imx_suspend, lpi2c_imx_resume);
657+
639658
static struct platform_driver lpi2c_imx_driver = {
640659
.probe = lpi2c_imx_probe,
641660
.remove = lpi2c_imx_remove,
642661
.driver = {
643662
.name = DRIVER_NAME,
644663
.of_match_table = lpi2c_imx_of_match,
664+
.pm = &imx_lpi2c_pm,
645665
},
646666
};
647667

0 commit comments

Comments
 (0)