diff options
author | Gerrit Code Review <gerrit2@git-master.nvidia.com> | 2010-01-23 02:08:55 +0200 |
---|---|---|
committer | Gerrit Code Review <gerrit2@git-master.nvidia.com> | 2010-01-23 02:08:55 +0200 |
commit | c7583400a68dee1dc7296e1a9259771453467bc2 (patch) | |
tree | f3860513d05c8db230be2e938c74a83d2a5beccc /drivers/input/keyboard/tegra-kbc.c | |
parent | 29525b09e9f28b6a11e73f70e156ca7e6e4b618b (diff) | |
parent | 87826b75d9c6975ca8051985007bdcdf33466034 (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.c | 48 |
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", }, |