rtc/rpmsg: Move rtc_initialize out of rpmsg_rtc_initialize
like other rtc driver Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
93b0b9678f
commit
6121f15d51
@ -105,7 +105,9 @@ int sim_bringup(void)
|
|||||||
#ifdef CONFIG_SIM_SPI
|
#ifdef CONFIG_SIM_SPI
|
||||||
FAR struct spi_dev_s *spidev;
|
FAR struct spi_dev_s *spidev;
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(CONFIG_RTC_RPMSG) && !defined(CONFIG_RTC_RPMSG_SERVER)
|
||||||
|
FAR struct rtc_lowerhalf_s *rtc;
|
||||||
|
#endif
|
||||||
int ret = OK;
|
int ret = OK;
|
||||||
|
|
||||||
#ifdef CONFIG_FS_BINFS
|
#ifdef CONFIG_FS_BINFS
|
||||||
@ -446,16 +448,16 @@ int sim_bringup(void)
|
|||||||
syslog_rpmsg_server_init();
|
syslog_rpmsg_server_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CONFIG_RTC_RPMSG_SERVER
|
#if defined(CONFIG_RTC_RPMSG) && !defined(CONFIG_RTC_RPMSG_SERVER)
|
||||||
up_rtc_set_lowerhalf(rpmsg_rtc_initialize(0));
|
rtc = rpmsg_rtc_initialize();
|
||||||
|
up_rtc_set_lowerhalf(rtc);
|
||||||
|
rtc_initialize(0, rtc);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_FS_RPMSGFS
|
#if defined(CONFIG_FS_RPMSGFS) && defined(CONFIG_SIM_RPTUN_MASTER)
|
||||||
#ifdef CONFIG_SIM_RPTUN_MASTER
|
|
||||||
rpmsgfs_server_init();
|
rpmsgfs_server_init();
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CONFIG_SIM_WTGAHRS2_UARTN
|
#ifdef CONFIG_SIM_WTGAHRS2_UARTN
|
||||||
#if CONFIG_SIM_WTGAHRS2_UARTN == 0
|
#if CONFIG_SIM_WTGAHRS2_UARTN == 0
|
||||||
|
@ -689,9 +689,6 @@ static void rpmsg_rtc_server_ns_bind(FAR struct rpmsg_device *rdev,
|
|||||||
*
|
*
|
||||||
* Take remote core RTC as external RTC hardware through rpmsg.
|
* Take remote core RTC as external RTC hardware through rpmsg.
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
|
||||||
* minor - device minor number
|
|
||||||
*
|
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
* Return the lower half RTC driver instance on success;
|
* Return the lower half RTC driver instance on success;
|
||||||
* A NULL pointer on failure.
|
* A NULL pointer on failure.
|
||||||
@ -699,21 +696,19 @@ static void rpmsg_rtc_server_ns_bind(FAR struct rpmsg_device *rdev,
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef CONFIG_RTC_RPMSG_SERVER
|
#ifndef CONFIG_RTC_RPMSG_SERVER
|
||||||
FAR struct rtc_lowerhalf_s *rpmsg_rtc_initialize(int minor)
|
FAR struct rtc_lowerhalf_s *rpmsg_rtc_initialize(void)
|
||||||
{
|
{
|
||||||
FAR struct rpmsg_rtc_lowerhalf_s *lower;
|
FAR struct rpmsg_rtc_lowerhalf_s *lower;
|
||||||
|
|
||||||
lower = kmm_zalloc(sizeof(*lower));
|
lower = kmm_zalloc(sizeof(*lower));
|
||||||
if (lower)
|
if (lower != NULL)
|
||||||
{
|
{
|
||||||
lower->ops = &g_rpmsg_rtc_ops;
|
lower->ops = &g_rpmsg_rtc_ops;
|
||||||
|
|
||||||
rpmsg_register_callback(lower,
|
rpmsg_register_callback(lower,
|
||||||
rpmsg_rtc_device_created,
|
rpmsg_rtc_device_created,
|
||||||
rpmsg_rtc_device_destroy,
|
rpmsg_rtc_device_destroy,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
rtc_initialize(minor, (FAR struct rtc_lowerhalf_s *)lower);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (FAR struct rtc_lowerhalf_s *)lower;
|
return (FAR struct rtc_lowerhalf_s *)lower;
|
||||||
|
@ -42,7 +42,7 @@ extern "C"
|
|||||||
|
|
||||||
#ifdef CONFIG_RTC_RPMSG
|
#ifdef CONFIG_RTC_RPMSG
|
||||||
#ifndef CONFIG_RTC_RPMSG_SERVER
|
#ifndef CONFIG_RTC_RPMSG_SERVER
|
||||||
FAR struct rtc_lowerhalf_s *rpmsg_rtc_initialize(int minor);
|
FAR struct rtc_lowerhalf_s *rpmsg_rtc_initialize(void);
|
||||||
#else
|
#else
|
||||||
FAR struct rtc_lowerhalf_s *rpmsg_rtc_server_initialize(
|
FAR struct rtc_lowerhalf_s *rpmsg_rtc_server_initialize(
|
||||||
FAR struct rtc_lowerhalf_s *lower);
|
FAR struct rtc_lowerhalf_s *lower);
|
||||||
|
Loading…
Reference in New Issue
Block a user