You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by vi...@apache.org on 2018/09/05 14:53:30 UTC

[mynewt-core] branch master updated: Make the device reset at the top of lp5523_config optional. (#1384)

This is an automated email from the ASF dual-hosted git repository.

vipulrahane pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 1d3b2e6  Make the device reset at the top of lp5523_config optional. (#1384)
1d3b2e6 is described below

commit 1d3b2e69ba874b2e4fff6f01d0ea404a45c218f3
Author: Ben McCrea <be...@users.noreply.github.com>
AuthorDate: Wed Sep 5 07:53:27 2018 -0700

    Make the device reset at the top of lp5523_config optional. (#1384)
---
 hw/drivers/led/lp5523/include/lp5523/lp5523.h | 3 ++-
 hw/drivers/led/lp5523/src/lp5523.c            | 8 +++++---
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/hw/drivers/led/lp5523/include/lp5523/lp5523.h b/hw/drivers/led/lp5523/include/lp5523/lp5523.h
index a0a9250..cd4f400 100644
--- a/hw/drivers/led/lp5523/include/lp5523/lp5523.h
+++ b/hw/drivers/led/lp5523/include/lp5523/lp5523.h
@@ -101,7 +101,8 @@ struct lp5523_cfg {
     uint8_t timer:2;
     /* Force_1x enbale */
     uint8_t force_1x:1;
-
+    /* Optional reset */
+    bool prereset;
     /* All per LED configs go here - 0: D1 8: D9 */
     struct per_led_cfg per_led_cfg[MYNEWT_VAL(LP5523_LEDS_PER_DRIVER)];
 };
diff --git a/hw/drivers/led/lp5523/src/lp5523.c b/hw/drivers/led/lp5523/src/lp5523.c
index c7ed66f..9e2ab0d 100644
--- a/hw/drivers/led/lp5523/src/lp5523.c
+++ b/hw/drivers/led/lp5523/src/lp5523.c
@@ -982,9 +982,11 @@ lp5523_config(struct led_itf *itf, struct lp5523_cfg *cfg)
 
     itf->li_addr = LP5523_I2C_BASE_ADDR + cfg->asel;
 
-    rc = lp5523_reset(itf);
-    if (rc) {
-        return rc;
+    if (cfg->prereset) {
+        rc = lp5523_reset(itf);
+        if (rc) {
+            goto err;
+        }
     }
 
     /* chip enable */