summaryrefslogtreecommitdiff
path: root/src/drivers/i2c
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2015-03-19 10:14:13 -0700
committerPatrick Georgi <pgeorgi@google.com>2015-04-22 19:57:28 +0200
commit420fb5eb3e862974644433381ae95d73a9b1a349 (patch)
tree221ac1cc8bee588fb6d778c9fc6cd378dbee5fda /src/drivers/i2c
parent5fa5f99d4744dfd5ddd62fa591c3b9cb28a2a8e6 (diff)
i2c/ww_ring: stop running programs before loading the new ones
The two controllers on the ring are programmed independently, and if the second controller is running the old pattern while the first one was loaded with a new pattern, there is a window of when the two unrelated patterns might interact. To avoid this shut down execution on both controllers before starting downloading the new pattern code. BRANCH=storm BUG=chrome-os-partner:36059 TEST=verified recovery/wipeout LED ring behavior did not change. Change-Id: I163f2983d414fe839208054ae3e9025663a46aeb Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 3502ca6b119c033855b45388e7b782d35cfdd82b Original-Change-Id: I0f71f94a7e82f6c0e7f98d3aad1f93ece207248f Original-Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/261200 Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/9872 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/drivers/i2c')
-rw-r--r--src/drivers/i2c/ww_ring/ww_ring.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/drivers/i2c/ww_ring/ww_ring.c b/src/drivers/i2c/ww_ring/ww_ring.c
index 780d0db0bb..bfecc60f40 100644
--- a/src/drivers/i2c/ww_ring/ww_ring.c
+++ b/src/drivers/i2c/ww_ring/ww_ring.c
@@ -349,6 +349,18 @@ int ww_ring_display_pattern(unsigned i2c_bus, enum display_pattern pattern)
if (wwr_prog->led_pattern == pattern) {
int j;
+ /*
+ * First stop all running programs to avoid
+ * inerference between the controllers.
+ */
+ for (j = 0; j < WW_RING_NUM_LED_CONTROLLERS; j++) {
+ if (!lp55231s[j].dev_addr)
+ continue;
+ ledc_write_engctrl2
+ (lp55231s + j,
+ LP55231_ENGCTRL2_ALL_DISABLE);
+ }
+
for (j = 0; j < WW_RING_NUM_LED_CONTROLLERS; j++) {
if (!lp55231s[j].dev_addr)
continue;