misc/rpmsgdev: get battery info by rpmsgdev

read battery info register by other core

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
dongjiuzhu1 2024-03-07 22:43:53 +08:00 committed by Xiang Xiao
parent 22c4a82fa3
commit 190fdd18e2

View file

@ -42,6 +42,7 @@
#include <nuttx/rptun/openamp.h>
#include <nuttx/net/ioctl.h>
#include <nuttx/drivers/rpmsgdev.h>
#include <nuttx/power/battery_ioctl.h>
#include "rpmsgdev.h"
@ -622,12 +623,16 @@ static ssize_t rpmsgdev_ioctl_arglen(int cmd)
case FIONSPACE:
case FBIOSET_POWER:
case FBIOGET_POWER:
case BATIOC_STATE:
return sizeof(int);
case TUNSETIFF:
case TUNGETIFF:
return sizeof(struct ifreq);
case FIOC_FILEPATH:
return PATH_MAX;
case BATIOC_GET_PROTOCOL:
case BATIOC_OPERATE:
return sizeof(struct batio_operate_msg_s);
default:
return -ENOTTY;
}