All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] i2c/busses: Add PM support
@ 2012-02-24 11:31 Viresh Kumar
       [not found] ` <0ca1d8990c23a45193a32d0e7e889620b995af59.1330082915.git.viresh.kumar-qxv4g6HH51o@public.gmane.org>
  0 siblings, 1 reply; 29+ messages in thread
From: Viresh Kumar @ 2012-02-24 11:31 UTC (permalink / raw)
  To: khali-PUYAD+kWke1g9hUCZPvPmw, ben-linux-elnMNo+KYs3YtjvyW6yDsg,
	w.sang-bIcnvbaLZ9MEGnE8C9+IrQ
  Cc: armando.visconti-qxv4g6HH51o, shiraz.hashim-qxv4g6HH51o,
	vipin.kumar-qxv4g6HH51o, rajeev-dlh.kumar-qxv4g6HH51o,
	deepak.sikri-qxv4g6HH51o, vipulkumar.samar-qxv4g6HH51o,
	amit.virdi-qxv4g6HH51o, viresh.kumar-qxv4g6HH51o,
	pratyush.anand-qxv4g6HH51o, bhupesh.sharma-qxv4g6HH51o,
	viresh.linux-Re5JQEeQqe8AvxtiuMwx3w, bhavna.yadav-qxv4g6HH51o,
	vincenzo.frascino-qxv4g6HH51o, mirko.gardi-qxv4g6HH51o,
	salvatore.dedominicis-qxv4g6HH51o,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA

From: Deepak Sikri <deepak.sikri-qxv4g6HH51o@public.gmane.org>

This patch adds in support for standby/S2R/hybernate for i2c-designware driver.

Signed-off-by: Deepak Sikri <deepak.sikri-qxv4g6HH51o@public.gmane.org>
Signed-off-by: Rajeev Kumar <rajeev-dlh.kumar-qxv4g6HH51o@public.gmane.org>
---
 drivers/i2c/busses/i2c-designware-platdrv.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 5244c47..c5ac2dc 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -36,6 +36,7 @@
 #include <linux/interrupt.h>
 #include <linux/of_i2c.h>
 #include <linux/platform_device.h>
+#include <linux/pm.h>
 #include <linux/io.h>
 #include <linux/slab.h>
 #include "i2c-designware-core.h"
@@ -198,6 +199,31 @@ static const struct of_device_id dw_i2c_of_match[] = {
 MODULE_DEVICE_TABLE(of, dw_i2c_of_match);
 #endif
 
+#ifdef CONFIG_PM
+static int dw_i2c_suspend(struct device *dev)
+{
+	struct platform_device *pdev = to_platform_device(dev);
+	struct dw_i2c_dev *i_dev = platform_get_drvdata(pdev);
+
+	clk_disable(i_dev->clk);
+
+	return 0;
+}
+
+static int dw_i2c_resume(struct device *dev)
+{
+	struct platform_device *pdev = to_platform_device(dev);
+	struct dw_i2c_dev *i_dev = platform_get_drvdata(pdev);
+
+	clk_enable(i_dev->clk);
+	i2c_dw_init(i_dev);
+
+	return 0;
+}
+#endif
+
+static SIMPLE_DEV_PM_OPS(dw_i2c_dev_pm_ops, dw_i2c_suspend, dw_i2c_resume);
+
 /* work with hotplug and coldplug */
 MODULE_ALIAS("platform:i2c_designware");
 
@@ -207,6 +233,7 @@ static struct platform_driver dw_i2c_driver = {
 		.name	= "i2c_designware",
 		.owner	= THIS_MODULE,
 		.of_match_table = of_match_ptr(dw_i2c_of_match),
+		.pm	= &dw_i2c_dev_pm_ops,
 	},
 };
 
-- 
1.7.8.110.g4cb5d

^ permalink raw reply related	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2012-07-02  6:55 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-24 11:31 [PATCH 1/2] i2c/busses: Add PM support Viresh Kumar
     [not found] ` <0ca1d8990c23a45193a32d0e7e889620b995af59.1330082915.git.viresh.kumar-qxv4g6HH51o@public.gmane.org>
2012-02-24 11:31   ` [PATCH 2/2] i2c/designware: Provide optional i2c bus recovery function Viresh Kumar
     [not found]     ` <351031347b845920a0ea78e7491d955137e3d7aa.1330082915.git.viresh.kumar-qxv4g6HH51o@public.gmane.org>
2012-02-27  7:21       ` Shubhrajyoti Datta
     [not found]         ` <CAM=Q2cudYcSqAKk4qNg7MQxRBCkJ-XXXSL-Bg=sZ2+hvS_Qcxw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-27  7:27           ` Laxman Dewangan
     [not found]             ` <4F4B3072.6050903-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-02-27  8:10               ` Rajeev kumar
     [not found]                 ` <4F4B3A62.4080409-qxv4g6HH51o@public.gmane.org>
2012-02-27  8:22                   ` Laxman Dewangan
     [not found]                     ` <4F4B3D54.4010502-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-02-27  8:41                       ` Rajeev kumar
     [not found]                         ` <4F4B41CF.7080603-qxv4g6HH51o@public.gmane.org>
2012-02-27  8:45                           ` Laxman Dewangan
2012-02-27  9:12               ` Shubhrajyoti Datta
     [not found]                 ` <CAM=Q2cs-nCuSmkBFtv4odbqoRJcPkXk4Rz-H=9S6RDG3Z8kcEQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-27  9:19                   ` Laxman Dewangan
2012-02-27 10:10                   ` Rajeev kumar
     [not found]                     ` <4F4B569F.3080607-qxv4g6HH51o@public.gmane.org>
2012-02-27 10:27                       ` Viresh Kumar
     [not found]                         ` <4F4B5A9A.4050303-qxv4g6HH51o@public.gmane.org>
2012-02-28 13:23                           ` viresh kumar
     [not found]                             ` <CAOh2x=nfNGpBmHVd1bPT9+AezDMEjaC4ktj4hX9=yWg2_k7r3Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-28 13:55                               ` Salvatore DE DOMINICIS
     [not found]                                 ` <4E01B0DA4B09044DB320A047A7063F8DCA93DAA13E-+EwDPpWUVoSs+H57zxxw29BPR1lH4CV8@public.gmane.org>
2012-02-28 14:05                                   ` Vincenzo Frascino
2012-02-29  4:58                                   ` Viresh Kumar
     [not found]                                     ` <4F4DB073.9030906-qxv4g6HH51o@public.gmane.org>
2012-02-29  8:59                                       ` Vincenzo Frascino
2012-03-01 13:45                                       ` Michael Lawnick
2012-02-29 11:52                               ` Laxman Dewangan
     [not found]                                 ` <4F4E118B.2030403-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-02-29 11:58                                   ` Viresh Kumar
     [not found]                                     ` <4F4E12D9.90909-qxv4g6HH51o@public.gmane.org>
2012-02-29 12:18                                       ` Laxman Dewangan
     [not found]                                         ` <4F4E1797.7010503-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-02-29 17:58                                           ` viresh kumar
     [not found]                                 ` <CAOh2x=mrO+7UBK=nbGLQsVzj5YmOfuh1RAiA4qznXe8nt6pRKA@mail.gmail.com>
     [not found]                                   ` <4F4F12EC.1020703@nvidia.com>
     [not found]                                     ` <4F4F12EC.1020703-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-03-01  6:35                                       ` Viresh Kumar
2012-07-02  5:58                       ` Rajeev kumar
     [not found]                         ` <4FF1388B.4030108-qxv4g6HH51o@public.gmane.org>
2012-07-02  6:32                           ` Shubhrajyoti Datta
     [not found]                             ` <CAM=Q2ct+z_bGYvaOvAQ=AEzOSNh4Uob-HY-DemsYeS-mB-juEg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-07-02  6:55                               ` Rajeev kumar
2012-02-27  9:12           ` Vincenzo Frascino
2012-03-23  8:10   ` [PATCH 1/2] i2c/busses: Add PM support Viresh Kumar
2012-04-22 18:24   ` Wolfram Sang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.