Files
OpenCellular/include/power_led.h
Vincent Palatin fbc4c150d2 stm32: make power led optional
The spring board doesn't have one and we doesn't want to mess up with
that pin.
When the POWERLED task is not present, let's de-activate cleanly that
code.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BUG=chrome-os-partner:14324
TEST=make BOARD=spring (no power_led.o compiled)
make BOARD=snow (power_led.o compiled)
make BOARD=link && make BOARD=bds
run on Snow and see the power LED working

Change-Id: Ib44f5df54ec4fdee1863814e6c7052fd6620fee8
Reviewed-on: https://gerrit.chromium.org/gerrit/35272
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2012-10-11 23:32:24 -07:00

47 lines
1.2 KiB
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,
};
#if defined(CONFIG_TASK_POWERLED) || defined(CONFIG_POWER_LED)
/* 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);
#else /* CONFIG_TASK_POWERLED */
static inline int powerled_set(enum powerled_color color) { return 0; }
static inline void powerled_set_state(enum powerled_state state) {}
#endif /* CONFIG_TASK_POWERLED */
#endif /* __CROS_EC_POWER_LED_H */