summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandru M Stan <amstan@chromium.org>2015-03-10 13:12:37 -0700
committerChromeOS bot <3su6n15k.default@developer.gserviceaccount.com>2016-01-06 18:12:04 +0000
commit573623b12e19ad9375eb3ac77d5fc2018f15ab3d (patch)
tree79ba79e5815f667a4d49a09731e9015fcb2c3ab4
parentc0c40f97879c8a4fb700919ccb50ff3498ee8895 (diff)
downloadchrome-ec-573623b12e19ad9375eb3ac77d5fc2018f15ab3d.tar.gz
led_policy_std: Add CONFIG_POWER_LED_IS_EXTERNAL
Some power leds are not inside lids, so they shouldn't always be turned off when the lid is closed. BUG=none TEST=With series, note that the led can be seen pulsing in S3 with lid closed BRANCH=cros/firmware-strago-7287.B Change-Id: Ic948c9914aab7f5e462c0196e7b6806b497408dc Signed-off-by: james_chao <james_chao@asus.com> Reviewed-on: https://chromium-review.googlesource.com/320523 Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r--common/led_policy_std.c6
-rw-r--r--include/config.h8
2 files changed, 13 insertions, 1 deletions
diff --git a/common/led_policy_std.c b/common/led_policy_std.c
index ebb7125105..e0f211d200 100644
--- a/common/led_policy_std.c
+++ b/common/led_policy_std.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015 The Chromium OS Authors. All rights reserved.
+/* Copyright 2015 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.
*
@@ -77,8 +77,12 @@ static int pwr_led_set_color(enum led_color color)
gpio_set_level(GPIO_POWER_LED, POWER_LED_OFF);
break;
case LED_WHITE:
+#ifdef CONFIG_POWER_LED_IS_EXTERNAL
+ gpio_set_level(GPIO_POWER_LED, POWER_LED_ON);
+#else
gpio_set_level(GPIO_POWER_LED,
lid_is_open() ? POWER_LED_ON : POWER_LED_OFF);
+#endif
break;
default:
return EC_ERROR_UNKNOWN;
diff --git a/include/config.h b/include/config.h
index c6babf7357..6c76a819c5 100644
--- a/include/config.h
+++ b/include/config.h
@@ -1076,6 +1076,14 @@
#undef CONFIG_LED_BAT_ACTIVE_LOW
#undef CONFIG_LED_POWER_ACTIVE_LOW
+/*
+ * Normally the power led is part of the keyboard, so there's no point of
+ * having it on when the lid is closed. This option can be used for cases
+ * where the power led is externally visible and is supposed to stay
+ * on when the lid is closed.
+ */
+#undef CONFIG_POWER_LED_IS_EXTERNAL
+
/* Support for LED driver chip(s) */
#undef CONFIG_LED_DRIVER_DS2413 /* Maxim DS2413, on one-wire interface */
#undef CONFIG_LED_DRIVER_LP5562 /* LP5562, on I2C interface */