.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;
.name = "vpu",
.owner = THIS_MODULE,
},
+ .shutdown = vpu_shutdown,
.suspend = vpu_suspend,
.resume = vpu_resume,
};
-#endif
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;
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();