[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200330121546.23872-1-biwen.li@oss.nxp.com>
Date: Mon, 30 Mar 2020 20:15:46 +0800
From: Biwen Li <biwen.li@....nxp.com>
To: leoyang.li@....com, linux@...pel-privat.de, kernel@...gutronix.de,
wsa@...-dreams.de
Cc: linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org,
jiafei.pan@....com, Biwen Li <biwen.li@....com>
Subject: [PATCH] i2c: imx: add shutdown interface
From: Biwen Li <biwen.li@....com>
Add shutdown interface
Signed-off-by: Biwen Li <biwen.li@....com>
---
drivers/i2c/busses/i2c-imx.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index 0ab5381aa012..07da42cb0be4 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -1281,6 +1281,16 @@ static int i2c_imx_remove(struct platform_device *pdev)
return 0;
}
+static void i2c_imx_shutdown(struct platform_device *pdev)
+{
+ struct imx_i2c_struct *i2c_imx = platform_get_drvdata(pdev);
+
+ imx_i2c_write_reg(0, i2c_imx, IMX_I2C_IADR);
+ imx_i2c_write_reg(i2c_imx->hwdata->i2cr_ien_opcode ^ I2CR_IEN,
+ i2c_imx, IMX_I2C_I2CR);
+ imx_i2c_write_reg(i2c_imx->hwdata->i2sr_clr_opcode, i2c_imx, IMX_I2C_I2SR);
+}
+
static int __maybe_unused i2c_imx_runtime_suspend(struct device *dev)
{
struct imx_i2c_struct *i2c_imx = dev_get_drvdata(dev);
@@ -1310,6 +1320,7 @@ static const struct dev_pm_ops i2c_imx_pm_ops = {
static struct platform_driver i2c_imx_driver = {
.probe = i2c_imx_probe,
.remove = i2c_imx_remove,
+ .shutdown = i2c_imx_shutdown,
.driver = {
.name = DRIVER_NAME,
.pm = &i2c_imx_pm_ops,
--
2.17.1
Powered by blists - more mailing lists