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 03:21:21 UTC

[GitHub] [incubator-nuttx] Donny9 opened a new pull request, #6698: driver/power:add ioctl cmd for voltage info and protocol and add update event mask

Donny9 opened a new pull request, #6698:
URL: https://github.com/apache/incubator-nuttx/pull/6698

   ## Summary
   driver/power:
   get voltage info by cmd BATIOC_VOLTAGE_INFO.
   get charger protocol by cmd BATIOC_GET_PROTOCOL.
   add mask to record power device update event.
   
   ## Impact
   N/A
   ## Testing
   Vela Ci
   


-- 
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


[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6698: driver/power:add ioctl cmd for voltage info and protocol and add update event mask

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #6698:
URL: https://github.com/apache/incubator-nuttx/pull/6698#discussion_r929715929


##########
include/nuttx/power/battery_charger.h:
##########
@@ -125,7 +125,11 @@ struct battery_charger_operations_s
 
   /* Get the actual output voltage for charging */
 
-  int (*get_voltage)(struct battery_charger_dev_s *dev, int *value);
+  int (*get_voltage)(struct battery_charger_dev_s *dev, FAR int *value);

Review Comment:
   In general all `struct battery_charger_operations_s` is missing `CODE` and `FAR`, but let's add it in the separate PR



-- 
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


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6698: driver/power:add ioctl cmd for voltage info and protocol and add update event mask

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #6698:
URL: https://github.com/apache/incubator-nuttx/pull/6698#discussion_r928556423


##########
drivers/power/battery_charger.c:
##########
@@ -388,6 +388,16 @@ static int bat_charger_ioctl(FAR struct file *filep, int cmd,
         }
         break;
 
+      case BATIOC_VOLTAGE_INFO:
+        {
+          FAR int *outvoltsp = (FAR int *)((uintptr_t)arg);
+          if (outvoltsp)
+            {
+              ret = dev->ops->voltage_info(dev, outvoltsp);

Review Comment:
   what's different between BATIOC_GET_VOLTAGE and BATIOC_VOLTAGE_INFO?



-- 
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


[GitHub] [incubator-nuttx] pkarashchenko merged pull request #6698: driver/power:add ioctl cmd for voltage info and protocol and add update event mask

Posted by GitBox <gi...@apache.org>.
pkarashchenko merged PR #6698:
URL: https://github.com/apache/incubator-nuttx/pull/6698


-- 
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


[GitHub] [incubator-nuttx] Donny9 commented on a diff in pull request #6698: driver/power:add ioctl cmd for voltage info and protocol and add update event mask

Posted by GitBox <gi...@apache.org>.
Donny9 commented on code in PR #6698:
URL: https://github.com/apache/incubator-nuttx/pull/6698#discussion_r929485650


##########
drivers/power/battery_charger.c:
##########
@@ -388,6 +388,16 @@ static int bat_charger_ioctl(FAR struct file *filep, int cmd,
         }
         break;
 
+      case BATIOC_VOLTAGE_INFO:
+        {
+          FAR int *outvoltsp = (FAR int *)((uintptr_t)arg);
+          if (outvoltsp)
+            {
+              ret = dev->ops->voltage_info(dev, outvoltsp);

Review Comment:
   BATIOC_GET_VOLTAGE used to get voltage from setting register.
   BATIOC_VOLTAGE_INFO used to get actual output voltage from other register. 
   One is the theoretical value and the other is the actual value.
   This is not a common usage,so removed it.



-- 
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