driver:power:add regulator remote proc

N/A

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
This commit is contained in:
zhuyanlin
2021-11-25 17:48:58 +08:00
committed by Xiang Xiao
parent c8f1a9e430
commit eed6510202
5 changed files with 681 additions and 0 deletions
+9
View File
@@ -351,6 +351,15 @@ config REGULATOR
layer driver can register with, and the common regulator APIs that are easy
for other drivers to call for the control of their power supply.
config REGULATOR_RPMSG
bool "Regulator rpmsg driver support"
default n
---help---
The rpmsg regulator driver implements the common regulator APIs, inside which
the regulator operations are sent from the client to the remote device via
the rpmsg channel. The remote device(namely server) is responsible for
the parse and the completion.
config BATTERY_CHARGER
bool "Battery Charger support"
default n
+10
View File
@@ -81,6 +81,16 @@ POWER_CFLAGS := ${shell $(INCDIR) "$(CC)" $(TOPDIR)$(DELIM)drivers$(DELIM)power}
endif
ifeq ($(CONFIG_REGULATOR_RPMSG), y)
CSRCS += regulator_rpmsg.c
POWER_DEPPATH := --dep-path power
POWER_VPATH := :power
POWER_CFLAGS := ${shell $(INCDIR) "$(CC)" $(TOPDIR)$(DELIM)drivers$(DELIM)power}
endif
# Add battery charger drivers
ifeq ($(CONFIG_BATTERY_CHARGER),y)
+7
View File
@@ -161,6 +161,13 @@ static FAR struct regulator_dev_s *regulator_dev_lookup(const char *supply)
nxsem_post(&g_reg_sem);
#if defined(CONFIG_REGULATOR_RPMSG)
if (rdev_found == NULL)
{
rdev_found = regulator_rpmsg_get(supply);
}
#endif
return rdev_found;
}
File diff suppressed because it is too large Load Diff
+36
View File
@@ -153,6 +153,42 @@ regulator_register(FAR const struct regulator_desc_s *desc,
void regulator_unregister(FAR struct regulator_dev_s *rdev);
#if defined(CONFIG_REGULATOR_RPMSG)
/****************************************************************************
* Name: regulator_rpmsg_get
*
* Description:
*
* Input Parameters:
*
* name - the name for register the rpmsg regulator dev
*
* Returned Value:
*
* Regulator dev pointer
*
****************************************************************************/
FAR struct regulator_dev_s *regulator_rpmsg_get(FAR const char *name);
/****************************************************************************
* Name: regulator_rpmsg_init
*
* Description:
*
* Input Parameters:
*
* Returned Value:
*
* Zero (OK) on success; a negated errno on failure
*
****************************************************************************/
int regulator_rpmsg_init(void);
#endif
#undef EXTERN
#ifdef __cplusplus
}