mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-04 14:01:54 +00:00
Usually the power LED is driven by the PWM mode so that its nominal brightness can be set to a "soft" on value. However, when the LED is to remain off the LED should be switched to floating input mode. This reduces voltage leakage. This CL updates the power_led_task to configure the LED however is appropriate and adds board functions to re-configure the GPIO. Signed-off-by: David Hendricks <dhendrix@chromium.org> BRANCH=snow BUG=chrome-os-partner:12381 TEST=LED responds as expected in suspend and on/off states, also tested that leakage is reduced with multimeter Change-Id: If90ac78aaffe7358cce80dd02ec1423c2cb4f664 Reviewed-on: https://gerrit.chromium.org/gerrit/29705 Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Ready: David Hendricks <dhendrix@chromium.org> Tested-by: David Hendricks <dhendrix@chromium.org>
41 lines
928 B
C
41 lines
928 B
C
/* Copyright (c) 2011 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"
|
|
|
|
enum powerled_color {
|
|
POWERLED_OFF = 0,
|
|
POWERLED_RED,
|
|
POWERLED_YELLOW,
|
|
POWERLED_GREEN,
|
|
POWERLED_COLOR_COUNT /* Number of colors, not a color itself */
|
|
};
|
|
|
|
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,
|
|
};
|
|
|
|
/* Set the power adapter LED to the specified color. */
|
|
int powerled_set(enum powerled_color color);
|
|
|
|
/* Set the power LED according to the specified state. */
|
|
void powerled_set_state(enum powerled_state state);
|
|
|
|
#endif /* __CROS_EC_POWER_LED_H */
|