summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJubeom Kim <jubeomk@nvidia.com>2011-03-18 17:45:14 +0900
committerVarun Colbert <vcolbert@nvidia.com>2011-03-22 14:09:17 -0800
commit23082820eafe95665ddbee05e8c63c1ec08cc49f (patch)
treed5bbb31d95a0a6cb224a245ac7b025c4d71d892e /drivers
parentf9979eb6e9042eeb582cfb837668e17715b6c0d0 (diff)
i2c-tegra: Using suspend_noirq()/resume_noirq() for suspend/resume.
I2C driver needs to be suspended late and resumed early than other drivers. So, I2C driver uses the suspend_noirq/resume_noirq callbacks of struct dev_pm_ops for early/late power management system. Change-Id: I79747c374e7e5e3754c0a6fad8d78aa8e71dc6aa Reviewed-on: http://git-master/r/23494 Tested-by: Jubeom Kim <jubeomk@nvidia.com> Reviewed-by: Jinyoung Park <jinyoungp@nvidia.com> Reviewed-by: Daehyoung Ko <dko@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/i2c/busses/i2c-tegra.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
index 8a7c909f5fc3..49880008d5b5 100644
--- a/drivers/i2c/busses/i2c-tegra.c
+++ b/drivers/i2c/busses/i2c-tegra.c
@@ -772,8 +772,9 @@ static int tegra_i2c_remove(struct platform_device *pdev)
}
#ifdef CONFIG_PM
-static int tegra_i2c_suspend(struct platform_device *pdev, pm_message_t state)
+static int tegra_i2c_suspend_noirq(struct device *dev)
{
+ struct platform_device *pdev = to_platform_device(dev);
struct tegra_i2c_dev *i2c_dev = platform_get_drvdata(pdev);
rt_mutex_lock(&i2c_dev->dev_lock);
@@ -783,8 +784,9 @@ static int tegra_i2c_suspend(struct platform_device *pdev, pm_message_t state)
return 0;
}
-static int tegra_i2c_resume(struct platform_device *pdev)
+static int tegra_i2c_resume_noirq(struct device *dev)
{
+ struct platform_device *pdev = to_platform_device(dev);
struct tegra_i2c_dev *i2c_dev = platform_get_drvdata(pdev);
int ret;
@@ -803,18 +805,23 @@ static int tegra_i2c_resume(struct platform_device *pdev)
return 0;
}
+
+static const struct dev_pm_ops tegra_i2c_dev_pm_ops = {
+ .suspend_noirq = tegra_i2c_suspend_noirq,
+ .resume_noirq = tegra_i2c_resume_noirq,
+};
+#define TEGRA_I2C_DEV_PM_OPS (&tegra_i2c_dev_pm_ops)
+#else
+#define TEGRA_I2C_DEV_PM_OPS NULL
#endif
static struct platform_driver tegra_i2c_driver = {
.probe = tegra_i2c_probe,
.remove = tegra_i2c_remove,
-#ifdef CONFIG_PM
- .suspend = tegra_i2c_suspend,
- .resume = tegra_i2c_resume,
-#endif
.driver = {
.name = "tegra-i2c",
.owner = THIS_MODULE,
+ .pm = TEGRA_I2C_DEV_PM_OPS,
},
};