0

I am going through the platform drivers for power management operations. The platform drivers are represented using struct platform_driver.

This structure has functions like suspend() and resume() and the power management functions are present under

struct platform_driver->struct device_driver->const struct dev_pm_ops

I have the following queries related to this:

  1. How are the suspend()/resume() present in struct platform_driver different from suspend()/resume() functions present in const struct dev_pm_ops.

  2. How are the power management functions present in const struct dev_pm_ops gets called.

Is there any good tutorial available for understanding the platform drivers.

akumar
  • 39
  • 7
  • 1
    I think the first question has answer [here](https://stackoverflow.com/questions/15610570/what-is-the-difference-between-a-linux-platform-driver-and-normal-device-driver). To the second question, these prototypes are probably the same as `file_operations` that you're probably already familiar with. Each device can register his own function that will be triggered once one of those prototypes is issued. See [runtime_pm.rst](https://www.kernel.org/doc/Documentation/power/runtime_pm.rst) for more info. – vmemmap Jun 29 '22 at 18:05
  • 1
    1) the first is the definition of the **legacy** PM methods; 2) read _drivers/base/power/_ source code, it has all answers you need. There is also documentation in the kernel source tree. Have you read it? What is your particular question? – 0andriy Jul 05 '22 at 08:12

0 Answers0