summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorVenu Byravarasu <vbyravarasu@nvidia.com>2010-08-10 10:12:05 +0530
committerBharat Nihalani <bnihalani@nvidia.com>2010-08-17 03:16:19 -0700
commita0dab997adbb9ee7163b07a06a87e670dd16e425 (patch)
tree98c56b7395dae812e58049451e9aae8bcc587dca /drivers
parent3aa07d834b13113624d1841a3c3a811888591770 (diff)
tegra accelerometer: power management changes
Added suspend and resume functionality to tegra accelerometer, for supporting LP0 on Ventana tested on Ventana-C bug 716080 Change-Id: Ib57b3f2f0d3bec77839f40226f79cd60e222a366 Reviewed-on: http://git-master/r/4836 Tested-by: Venu Byravarasu <vbyravarasu@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/misc/tegra_odm_accel.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/input/misc/tegra_odm_accel.c b/drivers/input/misc/tegra_odm_accel.c
index f08cc81b665e..5d7d49dcf402 100644
--- a/drivers/input/misc/tegra_odm_accel.c
+++ b/drivers/input/misc/tegra_odm_accel.c
@@ -403,9 +403,27 @@ static NvS32 tegra_acc_remove(struct platform_device *pdev)
return 0;
}
+static int tegra_acc_suspend(struct platform_device *pAccel, pm_message_t state)
+{
+ if (NvOdmAccelSetPowerState(accel_dev->hOdmAcr, NvOdmAccelPower_Standby))
+ return 0;
+ else
+ return -EIO;
+}
+
+static int tegra_acc_resume(struct platform_device *pAccel)
+{
+ if (NvOdmAccelSetPowerState(accel_dev->hOdmAcr, NvOdmAccelPower_Fullrun))
+ return 0;
+ else
+ return -EIO;
+}
+
static struct platform_driver tegra_acc_driver = {
.probe = tegra_acc_probe,
.remove = tegra_acc_remove,
+ .suspend = tegra_acc_suspend,
+ .resume = tegra_acc_resume,
.driver = {
.name = "tegra_accelerometer",
},