summaryrefslogtreecommitdiff
path: root/drivers/input/keyboard/tegra-kbc.c
diff options
context:
space:
mode:
authorGerrit Code Review <gerrit2@git-master.nvidia.com>2010-01-23 02:08:55 +0200
committerGerrit Code Review <gerrit2@git-master.nvidia.com>2010-01-23 02:08:55 +0200
commitc7583400a68dee1dc7296e1a9259771453467bc2 (patch)
treef3860513d05c8db230be2e938c74a83d2a5beccc /drivers/input/keyboard/tegra-kbc.c
parent29525b09e9f28b6a11e73f70e156ca7e6e4b618b (diff)
parent87826b75d9c6975ca8051985007bdcdf33466034 (diff)
Merge change I7c506540 into android-tegra-2.6.29tegra-9.12.4
* changes: tegra: power management for mouse/keyboard drivers
Diffstat (limited to 'drivers/input/keyboard/tegra-kbc.c')
-rw-r--r--drivers/input/keyboard/tegra-kbc.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c
index 980ddf6ef757..ea400bdeadca 100644
--- a/drivers/input/keyboard/tegra-kbc.c
+++ b/drivers/input/keyboard/tegra-kbc.c
@@ -224,9 +224,57 @@ static int tegra_kbc_remove(struct platform_device *pdev)
return 0;
}
+static int tegra_kbc_suspend(struct platform_device *pdev, pm_message_t state)
+{
+ struct tegra_kbc_driver_data *kbc = platform_get_drvdata(pdev);
+ NvError e = NvError_Success;
+
+ if (!kbc)
+ return -1;
+
+ if (!kbc->ddkHandle) {
+ printk("%s: device handle is NULL\n", __func__);
+ return -1;
+ }
+
+ /* power down hardware */
+ e = NvDdkKbcSuspend(kbc->ddkHandle);
+ if (e != NvSuccess) {
+ printk("%s: hardware power down fail\n", __func__);
+ return -1;
+ }
+
+ return 0;
+}
+
+static int tegra_kbc_resume(struct platform_device *pdev)
+{
+ struct tegra_kbc_driver_data *kbc = platform_get_drvdata(pdev);
+ NvError e = NvError_Success;
+
+ if (!kbc)
+ return -1;
+
+ if (!kbc->ddkHandle) {
+ printk("%s: device handle is NULL\n", __func__);
+ return -1;
+ }
+
+ /* power up hardware */
+ e = NvDdkKbcResume(kbc->ddkHandle);
+ if (e != NvSuccess) {
+ printk("%s: hardware power up fail\n", __func__);
+ return -1;
+ }
+
+ return 0;
+}
+
static struct platform_driver tegra_kbc_driver = {
.probe = tegra_kbc_probe,
.remove = tegra_kbc_remove,
+ .suspend = tegra_kbc_suspend,
+ .resume = tegra_kbc_resume,
.driver = {
.name = "tegra_kbc",
},