You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by an...@apache.org on 2020/10/23 19:00:24 UTC

[mynewt-core] 01/02: da1469x_pd: add function to get power domain reference counts

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

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

commit b452162267b0a1fff9fb16e037ec7c9b809d5dbb
Author: JustineKH <ju...@juul.com>
AuthorDate: Tue Oct 20 10:58:45 2020 -0700

    da1469x_pd: add function to get power domain reference counts
---
 hw/mcu/dialog/da1469x/include/mcu/da1469x_pd.h |  1 +
 hw/mcu/dialog/da1469x/src/da1469x_pd.c         | 12 ++++++++++++
 2 files changed, 13 insertions(+)

diff --git a/hw/mcu/dialog/da1469x/include/mcu/da1469x_pd.h b/hw/mcu/dialog/da1469x/include/mcu/da1469x_pd.h
index 26bda87..e8d7272 100644
--- a/hw/mcu/dialog/da1469x/include/mcu/da1469x_pd.h
+++ b/hw/mcu/dialog/da1469x/include/mcu/da1469x_pd.h
@@ -44,6 +44,7 @@ extern "C" {
 #define MCU_PD_DOMAIN_RAD           5
 
 int da1469x_pd_init(void);
+int da1469x_pd_get_ref_cnt(uint8_t pd);
 int da1469x_pd_acquire(uint8_t pd);
 int da1469x_pd_acquire_noconf(uint8_t pd);
 int da1469x_pd_release(uint8_t pd);
diff --git a/hw/mcu/dialog/da1469x/src/da1469x_pd.c b/hw/mcu/dialog/da1469x/src/da1469x_pd.c
index 08ca79f..f734652 100644
--- a/hw/mcu/dialog/da1469x/src/da1469x_pd.c
+++ b/hw/mcu/dialog/da1469x/src/da1469x_pd.c
@@ -119,6 +119,18 @@ da1469x_pd_init(void)
     return 0;
 }
 
+int
+da1469x_pd_get_ref_cnt(uint8_t pd)
+{
+    struct da1469x_pd_data *pdd;
+
+    assert(pd < PD_COUNT);
+
+    pdd = &g_da1469x_pd_data[pd];
+
+    return pdd->refcnt;
+}
+
 static int
 da1469x_pd_acquire_internal(uint8_t pd, bool load)
 {