rk29: vpu: add shutdown support
author黄涛 <huangtao@rock-chips.com>
Mon, 21 Feb 2011 03:42:01 +0000 (11:42 +0800)
committer黄涛 <huangtao@rock-chips.com>
Mon, 21 Feb 2011 03:42:35 +0000 (11:42 +0800)
arch/arm/mach-rk29/vpu.c

index 5811e59fead72aee1225b849bdc5d784d7ef8cfd..16dfd60a929308677d3a2580805e86964fe78ffc 100644 (file)
@@ -423,7 +423,13 @@ static struct miscdevice vpu_misc_device = {
        .fops           = &vpu_fops,
 };
 
-#ifdef CONFIG_PM
+static void vpu_shutdown(struct platform_device *pdev)
+{
+       pr_info("shutdown...");
+       vpu_power_off();
+       pr_cont("done\n");
+}
+
 static int vpu_suspend(struct platform_device *pdev, pm_message_t state)
 {
        bool enabled = client.enabled;
@@ -451,10 +457,10 @@ static struct platform_driver vpu_pm_driver = {
                .name  = "vpu",
                .owner = THIS_MODULE,
        },
+       .shutdown  = vpu_shutdown,
        .suspend   = vpu_suspend,
        .resume    = vpu_resume,
 };
-#endif
 
 static int __init vpu_init(void)
 {
@@ -504,10 +510,8 @@ static int __init vpu_init(void)
 
        vpu_power_off();
 
-#ifdef CONFIG_PM
        platform_device_register(&vpu_pm_device);
        platform_driver_probe(&vpu_pm_driver, NULL);
-#endif
        pr_info("init success\n");
 
        return 0;
@@ -527,10 +531,8 @@ err_reserve_io:
 
 static void __exit vpu_exit(void)
 {
-#ifdef CONFIG_PM
        platform_device_unregister(&vpu_pm_device);
        platform_driver_unregister(&vpu_pm_driver);
-#endif
 
        vpu_power_on();