i2c: qup: Add shutdown method

Message ID 1516138534-30842-1-git-send-email-austinwc@codeaurora.org
State New
Headers show
Series
  • i2c: qup: Add shutdown method
Related show

Commit Message

Austin Christ Jan. 16, 2018, 9:35 p.m.
This shutdown method disables I2C to avoid corrupting a new kernel
started with kexec.

Signed-off-by: Austin Christ <austinwc@codeaurora.org>
---
 drivers/i2c/busses/i2c-qup.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Bjorn Andersson Feb. 2, 2018, 11:36 p.m. | #1
On Tue 16 Jan 13:35 PST 2018, Austin Christ wrote:

> This shutdown method disables I2C to avoid corrupting a new kernel
> started with kexec.
> 

Can you elaborate on the issue you're seeing here? In what way is the
i2c-qup driver special, will there be similar patches for all other
drivers in the system?

Regards,
Bjorn

Patch

diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c
index 08f8e01..b96f01a 100644
--- a/drivers/i2c/busses/i2c-qup.c
+++ b/drivers/i2c/busses/i2c-qup.c
@@ -1651,12 +1651,16 @@  static int qup_i2c_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static void qup_i2c_shutdown(struct platform_device *pdev)
+{
+	qup_i2c_remove(pdev);
+}
+
 #ifdef CONFIG_PM
 static int qup_i2c_pm_suspend_runtime(struct device *device)
 {
 	struct qup_i2c_dev *qup = dev_get_drvdata(device);
 
-	dev_dbg(device, "pm_runtime: suspending...\n");
 	qup_i2c_disable_clocks(qup);
 	return 0;
 }
@@ -1717,6 +1721,7 @@  static int qup_i2c_resume(struct device *device)
 static struct platform_driver qup_i2c_driver = {
 	.probe  = qup_i2c_probe,
 	.remove = qup_i2c_remove,
+	.shutdown = qup_i2c_shutdown,
 	.driver = {
 		.name = "i2c_qup",
 		.pm = &qup_i2c_qup_pm_ops,