You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/07/25 10:27:16 UTC

[GitHub] [incubator-nuttx] davids5 commented on a diff in pull request #6673: power related update

davids5 commented on code in PR #6673:
URL: https://github.com/apache/incubator-nuttx/pull/6673#discussion_r928710357


##########
drivers/power/pm_activity.c:
##########
@@ -143,21 +182,40 @@ void pm_stay(int domain, enum pm_state_e state)
 
 void pm_relax(int domain, enum pm_state_e state)
 {
-  FAR struct pm_domain_s *pdom;
-  irqstate_t flags;
+  DEBUGASSERT(state < PM_COUNT);
+  DEBUGASSERT(domain >= 0 && domain < CONFIG_PM_NDOMAINS);
 
-  /* Get a convenience pointer to minimize all of the indexing */
+  pm_wakelock_relax(&g_wakelock[domain][state]);
+}
 
-  DEBUGASSERT(domain >= 0 && domain < CONFIG_PM_NDOMAINS);
-  pdom = &g_pmglobals.domain[domain];
+/****************************************************************************
+ * Name: pm_staytimeout
+ *
+ * Description:
+ *   This function is called by a device driver to indicate that it is
+ *   performing meaningful activities (non-idle), needs the power at kept
+ *   last the specified level.

Review Comment:
   ```suggestion
    *   the last specified level.
   ```



##########
drivers/power/pm_activity.c:
##########
@@ -143,21 +182,40 @@ void pm_stay(int domain, enum pm_state_e state)
 
 void pm_relax(int domain, enum pm_state_e state)
 {
-  FAR struct pm_domain_s *pdom;
-  irqstate_t flags;
+  DEBUGASSERT(state < PM_COUNT);
+  DEBUGASSERT(domain >= 0 && domain < CONFIG_PM_NDOMAINS);
 
-  /* Get a convenience pointer to minimize all of the indexing */
+  pm_wakelock_relax(&g_wakelock[domain][state]);
+}
 
-  DEBUGASSERT(domain >= 0 && domain < CONFIG_PM_NDOMAINS);
-  pdom = &g_pmglobals.domain[domain];
+/****************************************************************************
+ * Name: pm_staytimeout
+ *
+ * Description:
+ *   This function is called by a device driver to indicate that it is
+ *   performing meaningful activities (non-idle), needs the power at kept
+ *   last the specified level.
+ *   And this will be timeout after time (ms), menas auto pm_relax
+ *
+ * Input Parameters:
+ *   domain - The domain of the PM activity
+ *   state - The state want to stay.

Review Comment:
   ```suggestion
    *   state   - The state want to stay.
   ```
   Please line this up



##########
drivers/power/pm_activity.c:
##########
@@ -143,21 +182,40 @@ void pm_stay(int domain, enum pm_state_e state)
 
 void pm_relax(int domain, enum pm_state_e state)
 {
-  FAR struct pm_domain_s *pdom;
-  irqstate_t flags;
+  DEBUGASSERT(state < PM_COUNT);
+  DEBUGASSERT(domain >= 0 && domain < CONFIG_PM_NDOMAINS);
 
-  /* Get a convenience pointer to minimize all of the indexing */
+  pm_wakelock_relax(&g_wakelock[domain][state]);
+}
 
-  DEBUGASSERT(domain >= 0 && domain < CONFIG_PM_NDOMAINS);
-  pdom = &g_pmglobals.domain[domain];
+/****************************************************************************
+ * Name: pm_staytimeout
+ *
+ * Description:
+ *   This function is called by a device driver to indicate that it is
+ *   performing meaningful activities (non-idle), needs the power at kept

Review Comment:
   ```suggestion
    *   performing meaningful activities (non-idle), needs the power kept at
   ```



##########
drivers/power/pm_activity.c:
##########
@@ -143,21 +182,40 @@ void pm_stay(int domain, enum pm_state_e state)
 
 void pm_relax(int domain, enum pm_state_e state)
 {
-  FAR struct pm_domain_s *pdom;
-  irqstate_t flags;
+  DEBUGASSERT(state < PM_COUNT);
+  DEBUGASSERT(domain >= 0 && domain < CONFIG_PM_NDOMAINS);
 
-  /* Get a convenience pointer to minimize all of the indexing */
+  pm_wakelock_relax(&g_wakelock[domain][state]);
+}
 
-  DEBUGASSERT(domain >= 0 && domain < CONFIG_PM_NDOMAINS);
-  pdom = &g_pmglobals.domain[domain];
+/****************************************************************************
+ * Name: pm_staytimeout
+ *
+ * Description:
+ *   This function is called by a device driver to indicate that it is
+ *   performing meaningful activities (non-idle), needs the power at kept
+ *   last the specified level.
+ *   And this will be timeout after time (ms), menas auto pm_relax

Review Comment:
   ```suggestion
    *   And this will timeout after time (ms), menas auto pm_relax
   ```
   
   Not sure what menas  was supposed to me.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org