mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-08 08:31:52 +00:00
The power LED now has its own tick-based handler which knows how to blink the LED and resend the desired LED state to work around the flaky 1-wire connection. Removes a bunch of LED state code from charge_state.c. No user-visible impact. Does not need to go into link branch. BUG=chromium-os:18256 BRANCH=none TEST=manual 1) Discharge battery to <97% 2) Plug in AC. LED=yellow 3) 'ectool chargeforceidle 1' from root shell. LED=blinking green/off. 4) 'ectool chargeforceidle 0' from root shell. LED=yellow. 5) Wait for battery >= 97% (or 'battfake 98' from EC console). LED=green. 6) Unplug battery. LED=red (may take 10 sec). 7) Replug battery. LED=green. Change-Id: I999ee3e1abe269bb3f737bbc75e0b872316605ce Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/45469 Reviewed-by: Vic Yang <victoryang@chromium.org>
44 lines
821 B
C
44 lines
821 B
C
/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
|
|
/* Power LED control for Chrome EC */
|
|
|
|
#ifndef __CROS_EC_POWER_LED_H
|
|
#define __CROS_EC_POWER_LED_H
|
|
|
|
#include "common.h"
|
|
|
|
/* Interface for STM32-based boards */
|
|
|
|
enum powerled_state {
|
|
POWERLED_STATE_OFF,
|
|
POWERLED_STATE_ON,
|
|
POWERLED_STATE_SUSPEND,
|
|
POWERLED_STATE_COUNT
|
|
};
|
|
|
|
enum powerled_config {
|
|
POWERLED_CONFIG_MANUAL_OFF,
|
|
POWERLED_CONFIG_MANUAL_ON,
|
|
POWERLED_CONFIG_PWM,
|
|
};
|
|
|
|
#ifdef CONFIG_TASK_POWERLED
|
|
|
|
/**
|
|
* Set the power LED
|
|
*
|
|
* @param state Target state
|
|
*/
|
|
void powerled_set_state(enum powerled_state state);
|
|
|
|
#else
|
|
|
|
static inline void powerled_set_state(enum powerled_state state) {}
|
|
|
|
#endif
|
|
|
|
#endif /* __CROS_EC_POWER_LED_H */
|