mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-08 16:41:55 +00:00
spring: Fix a bug that yellow LED is not turned off
When leaving breathing mode, we should switch yellow LED from lighting engine back to PWM control. BUG=chrome-os-partner:18244 TEST=Check yellow LED leaves breathing mode BRANCH=spring Change-Id: I39260ac9040baaf193ce95eec7941aeb6d97e7e8 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/45436 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
@@ -319,22 +319,25 @@ int board_led_breathing(int enabled)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (!enabled) {
|
||||
return lp5562_engine_control(LP5562_ENG_HOLD,
|
||||
if (enabled) {
|
||||
ret |= lp5562_engine_load(LP5562_ENG_SEL_1,
|
||||
breathing_prog,
|
||||
sizeof(breathing_prog));
|
||||
ret |= lp5562_set_engine(LP5562_ENG_SEL_NONE,
|
||||
LP5562_ENG_SEL_NONE,
|
||||
LP5562_ENG_SEL_1);
|
||||
ret |= lp5562_engine_control(LP5562_ENG_RUN,
|
||||
LP5562_ENG_HOLD,
|
||||
LP5562_ENG_HOLD);
|
||||
} else {
|
||||
ret |= lp5562_engine_control(LP5562_ENG_HOLD,
|
||||
LP5562_ENG_HOLD,
|
||||
LP5562_ENG_HOLD);
|
||||
ret |= lp5562_set_engine(LP5562_ENG_SEL_NONE,
|
||||
LP5562_ENG_SEL_NONE,
|
||||
LP5562_ENG_SEL_NONE);
|
||||
}
|
||||
|
||||
ret |= lp5562_engine_load(LP5562_ENG_SEL_1,
|
||||
breathing_prog,
|
||||
sizeof(breathing_prog));
|
||||
ret |= lp5562_set_engine(LP5562_ENG_SEL_NONE,
|
||||
LP5562_ENG_SEL_NONE,
|
||||
LP5562_ENG_SEL_1);
|
||||
ret |= lp5562_engine_control(LP5562_ENG_RUN,
|
||||
LP5562_ENG_HOLD,
|
||||
LP5562_ENG_HOLD);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user