From 95c446361810ee898851243f5ff811fba921199e Mon Sep 17 00:00:00 2001 From: buxiasen Date: Tue, 4 Jun 2024 10:35:13 +0800 Subject: [PATCH] pm: update pm_domain_register/pm_domain_unregister document Signed-off-by: buxiasen --- .../drivers/special/power/pm/index.rst | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/Documentation/components/drivers/special/power/pm/index.rst b/Documentation/components/drivers/special/power/pm/index.rst index ac21a1a386..fdaed82885 100644 --- a/Documentation/components/drivers/special/power/pm/index.rst +++ b/Documentation/components/drivers/special/power/pm/index.rst @@ -81,6 +81,22 @@ All PM interfaces are declared in the file ``include/nuttx/power/pm.h``. initialized (since they may attempt to register with the power management subsystem). +.. c:function:: int pm_domain_register(int domain, FAR struct pm_callback_s *cb) + + Called by a device driver in order to register to receive power + management event callbacks from specific domain. + Refer to the `Callbacks`_ + section for more details. + + :param domain: Identifies the target register domain + :param cb: + An instance of :c:struct:`pm_callback_s` + providing the driver callback functions. + + :return: + Zero (``OK``) on success; otherwise a negated + ``errno`` value is returned. + .. c:function:: int pm_register(FAR struct pm_callback_s *callbacks) Called by a device driver in @@ -88,6 +104,8 @@ All PM interfaces are declared in the file ``include/nuttx/power/pm.h``. Refer to the `Callbacks`_ section for more details. + Compatible kept, only register to PM_IDLE_DOMAIN by marcro. + :param callbacks: An instance of :c:struct:`pm_callback_s` providing the driver callback functions. @@ -96,6 +114,24 @@ All PM interfaces are declared in the file ``include/nuttx/power/pm.h``. Zero (``OK``) on success; otherwise a negated ``errno`` value is returned. +.. c:function:: int pm_domain_unregister(int domain, FAR struct pm_callback_s *cb) + + Called by a device driver in order to unregister previously + registered power management event from specific domain. + callbacks. Refer to the `Callbacks`_ + section for more details. + + **Input Parameters:** + + :param domain: Identifies the target unregister domain + :param cb: + An instance of :c:struct:`pm_callback_s` + providing the driver callback functions. + + :return: + Zero (``OK``) on success; otherwise a negated + ``errno`` value is returned. + .. c:function:: int pm_unregister(FAR struct pm_callback_s *callbacks) Called by a device driver in @@ -103,6 +139,8 @@ All PM interfaces are declared in the file ``include/nuttx/power/pm.h``. callbacks. Refer to the `Callbacks`_ section for more details. + Compatible kept, only unregister with PM_IDLE_DOMAIN by marcro. + **Input Parameters:** :param callbacks: