Attention is currently required from: Boris Mittelberg, Caveh Jalali, Pranava Y N, Subrata Banik.
Jérémy Compostella has posted comments on this change by Subrata Banik. ( https://review.coreboot.org/c/coreboot/+/85765?usp=email )
Change subject: ec/google/chromeec: Add function to detect barrel charger ......................................................................
Patch Set 1:
(3 comments)
File src/ec/google/chromeec/ec.h:
https://review.coreboot.org/c/coreboot/+/85765/comment/830aa741_fafa5b96?usp... : PS1, Line 154: * @return true: if the barrel_charger is present s/barrel_charger/barrel charger/
File src/ec/google/chromeec/ec.c:
https://review.coreboot.org/c/coreboot/+/85765/comment/e2c7317e_4bd5775d?usp... : PS1, Line 1024: /* A few minor suggestions:
If both barrel charger and USB-C PD are present at once, the barrelcharger takes precedence over USB-C PD. As a result, `google_chromeec_is_usb_pd_attached()` will return `false`. This logic can then be used to deterministically determine if a barrel charger is present, even when both a barrel charger and USB-C PD are attached.
https://review.coreboot.org/c/coreboot/+/85765/comment/36dde893_07e7545d?usp... : PS1, Line 1029: */ considering these variables are boolean, I would suggest to use boolean test operator like `!`: ``` if (ac_charger_present && !usb_pd_present == false) ```
A simple return be even better actually: ``` return ac_charger_present && !usb_pd_present; ```
You may not even need intermediate variable as function names are self explanatory.