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

[GitHub] vrahane closed pull request #1384: Make lp5523 reset optional

vrahane closed pull request #1384: Make lp5523 reset optional
URL: https://github.com/apache/mynewt-core/pull/1384
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/hw/drivers/led/lp5523/include/lp5523/lp5523.h b/hw/drivers/led/lp5523/include/lp5523/lp5523.h
index a0a92508cd..cd4f400458 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 c7ed66f8a5..9e2ab0d07b 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 */


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services