AnsweredAssumed Answered

platform_driver struct proper usage

Question asked by John Smith on Jun 7, 2017
Latest reply on Jun 7, 2017 by igorpadykov

Hello!

 

I have noticed that GPU driver's suspend/resume callbacks are never called. These callbacks are registered in such a way (drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_probe.c):

 

static struct platform_driver gpu_driver = {
    .probe      = gpu_probe,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
    .remove     = gpu_remove,
#else
    .remove     = __devexit_p(gpu_remove),
#endif

    .suspend    = gpu_suspend,
    .resume     = gpu_resume,

    .driver     = {
        .owner = THIS_MODULE,
        .name   = DEVICE_NAME,
#if defined(CONFIG_PM) && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
        .pm     = &gpu_pm_ops,
#endif
    }
};

 

In init() function:

 

platform_driver_register(&gpu_driver);

 

But when we try echo freeze > sys/power/state (or any other power-down mode) we see that functions gpu_suspend() and gpu_resume() are never being called.

 

What can be the reason of it?

 

P.S. - SabreSD board, official Android 6 from nxp, linux kernel v4.1.15.

Outcomes