mirror of
https://github.com/apache/nuttx.git
synced 2026-05-21 21:34:07 +08:00
driver:power:add regulator remote proc
N/A Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user