summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2015-09-24 15:55:45 -0700
committerchrome-bot <chrome-bot@chromium.org>2015-09-25 09:13:34 -0700
commite5ec074dfafd75bb8df093e920d5bc47eff2b108 (patch)
tree672a0d401c295b7ed7b5550008844069ced4054d
parentf4ef486fc21a655b75c928ed719d366c6e95a2d4 (diff)
downloadchrome-ec-e5ec074dfafd75bb8df093e920d5bc47eff2b108.tar.gz
ryu: fix max lightbar brightness
Fix max brightness for Ryu. The max brightness must be less than 0x80 because the top bit in the lightbar current registers is reserved. Writing the top bit seems to have undefined behavior. This fixes the hiccups in the tap for battery sequence which was ramping brightness to above 0x80 and producing weird results. BUG=chrome-os-partner:45835, chrome-os-partner:44029 BRANCH=smaug TEST=test tap for battery looks smooth. test that the google colors match the desired current levels: > lightbar ... 15 0f 06 16 0f 20 17 16 08 18 06 21 19 26 11 1a 1d 0b Change-Id: Iecf1c770f986064b9b4d2d3d54fab0ea1242af01 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/302146 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org> (cherry picked from commit 133dab0c36160d0e54820cce9e97071df34340f8) Reviewed-on: https://chromium-review.googlesource.com/302446
-rw-r--r--common/lb_common.c7
-rw-r--r--common/lightbar.c8
2 files changed, 5 insertions, 10 deletions
diff --git a/common/lb_common.c b/common/lb_common.c
index da6ea95739..aa237c776d 100644
--- a/common/lb_common.c
+++ b/common/lb_common.c
@@ -152,7 +152,7 @@ static inline uint8_t controller_read(int ctrl_num, uint8_t reg)
#define MAX_GREEN 0x30
#define MAX_BLUE 0x67
#endif
-#if defined(BOARD_SAMUS)
+#if defined(BOARD_SAMUS) || defined(BOARD_RYU)
/* Samus uses completely different LEDs, so the numbers are different. The
* Samus LEDs can handle much higher currents, but these constants were
* calibrated to provide uniform intensity at the level used by Link.
@@ -161,11 +161,6 @@ static inline uint8_t controller_read(int ctrl_num, uint8_t reg)
#define MAX_GREEN 0x2c
#define MAX_BLUE 0x40
#endif
-#if defined(BOARD_RYU)
-#define MAX_RED 0xb4
-#define MAX_GREEN 0xac
-#define MAX_BLUE 0xc0
-#endif
#ifdef BOARD_HOST
/* For testing only */
#define MAX_RED 0xff
diff --git a/common/lightbar.c b/common/lightbar.c
index b7f7bcf680..e0f5afccac 100644
--- a/common/lightbar.c
+++ b/common/lightbar.c
@@ -134,10 +134,10 @@ static const struct lightbar_params_v1 default_params = {
.s5_idx = 5, /* flash red */
.color = {
#if defined(BOARD_RYU)
- {0x22, 0x17, 0x3b}, /* Segment0: Google blue */
- {0x3e, 0x10, 0x0c}, /* Segment1: Google red */
- {0x48, 0x3a, 0x0c}, /* Segment2: Google yellow */
- {0x1e, 0x2c, 0x1c}, /* Segment3: Google green */
+ {0x74, 0x58, 0xb4}, /* Segment0: Google blue */
+ {0xd6, 0x40, 0x20}, /* Segment1: Google red */
+ {0xfa, 0xe6, 0x20}, /* Segment2: Google yellow */
+ {0x66, 0xb0, 0x50}, /* Segment3: Google green */
#else
/*
* These values have been optically calibrated for the