mode = mode << 4 will produce out-of-range values for the AC modes: EC_AC_BEST_PERFORMANCE will become 256 (16 << 4), EC_AC_BALANCED (32) will become 512, etc.
Reading the condition, it looks like we want to treat low-power AC (AC < 55W) as the same as DC.
I would expect that to downgrade EC_AC_BEST_PERFORMANCE to EC_**DC**_BEST_PERFORMANCE (as an example).
If that's the case, I suspect mode >> 4 is what you want. That reduces EC_AC_BEST_PERFORMANCE to 1 (16 >> 4)... which happens to match the value for EC_DC_BEST_...
I think the code here is wrong as of 42ec4cc58fad9f9f3f6f350b9a9566576137ccbd.
https://github.com/FrameworkComputer/EmbeddedController/blob/42ec4cc58fad9f9f3f6f350b9a9566576137ccbd/zephyr/program/lotus/azalea/src/cpu_power.c#L286-L290
mode = mode << 4
will produce out-of-range values for the AC modes:EC_AC_BEST_PERFORMANCE
will become256
(16 << 4
),EC_AC_BALANCED
(32
) will become512
, etc.Reading the condition, it looks like we want to treat low-power AC (AC < 55W) as the same as DC. I would expect that to downgrade
EC_AC_BEST_PERFORMANCE
toEC_**DC**_BEST_PERFORMANCE
(as an example).If that's the case, I suspect
mode >> 4
is what you want. That reducesEC_AC_BEST_PERFORMANCE
to1
(16 >> 4
)... which happens to match the value forEC_DC_BEST_...