platform: msm_shared: Add support for pmic type API
Add support for API to detect if the pmic type given as input is present
on the system.
Change-Id: I7350f43c52ed64b5eb7925d3a77c03f990dc7e8b
diff --git a/platform/msm_shared/board.c b/platform/msm_shared/board.c
index 1265f29..8839a8a 100644
--- a/platform/msm_shared/board.c
+++ b/platform/msm_shared/board.c
@@ -400,6 +400,21 @@
return 0;
}
+bool board_pmic_type(uint32_t type)
+{
+ uint8_t i;
+ if (format_major == 0x0 && format_minor >= 0x0B)
+ {
+ for (i = 0; i < SMEM_MAX_PMIC_DEVICES; i++)
+ {
+ if (type == (board.pmic_info_array[i].pmic_type & 0x0000ffff))
+ return true;
+ }
+ }
+
+ return false;
+}
+
uint32_t board_pmic_target(uint8_t num_ent)
{
if (format_major == 0x0 && num_ent < SMEM_MAX_PMIC_DEVICES)