RK3288|RK3288 Android7.1 RTC-pcf8563调试 待机唤醒
(1) 先把kernel 目录下.config pcf8563打开,且rk808关闭
文章图片
(2) dts 配置,在根节点添加rtc_pcf8563节点。 之后再在硬件接口i2c
上添加pcf8563子节点。
文章图片
文章图片
(3) 在rtc-lib.c 文件中按图片修改:
文章图片
之后在rtc-pcf8563.c 增加待机写闹钟函数
static int pcf8563_rtc_setalarm_pwron(struct device *dev, struct rtc_time *tm)
{
struct i2c_client *client = to_i2c_client(dev);
unsigned char buf[4];
int err;
printk("enter pcf8563 rtc setalarm pwron function\r\n");
/* The alarm has no seconds, round up to nearest minute */
if (tm->tm_sec) {
time64_t alarm_time = rtc_tm_to_time64(tm);
alarm_time += 60 - tm->tm_sec;
rtc_time64_to_tm(alarm_time, tm);
}dev_info(dev, "%s, min=%d hour=%d wday=%d mday=%d "
, __func__,
tm->tm_min, tm->tm_hour, tm->tm_wday,
tm->tm_mday);
//tm->tm_wday=tm->tm_wday+4;
// for app set to kernel 2020-05-07buf[0] = bin2bcd(tm->tm_min);
buf[1] = bin2bcd(tm->tm_hour);
buf[2] = bin2bcd(tm->tm_mday);
buf[3] = (tm->tm_wday & 0x07);
dev_info(dev, "%s, after min=%d hour=%d mday=%d wday=%d "
, __func__,
buf[0], buf[1], buf[2],
buf[3]);
//err = pcf8563_write_block_data(client, PCF8563_REG_AMN, 4, buf);
err = pcf8563_write_block_data(client, PCF8563_REG_AMN, 3, buf);
if (err)
return err;
printk("%s err=%d",__func__,err);
return pcf8563_set_alarm_mode(client, 1);
}
将上面pcf8563_rtc_setalarm_pwron函数
文章图片
【RK3288|RK3288 Android7.1 RTC-pcf8563调试 待机唤醒】本人创建QQ群,进QQ技术交流,QQ群:712288614
推荐阅读
- RTC-PCF8563驱动问题总结
- [RK3288][Android6.0] RTC驱动的上层调用流程
- [RK3288][Android6.0] RTC模块RX8010SJ驱动添加及改动
- RK3399|[RK3399][Android7.1] 调试笔记 --- 解决开关按键时产生的Pop声
- [RK3288][Android6.0] 如何配置MIPI DSI Clock和PCLK
- 开发文档|【资源共享】RK3288 使用POWER键开机
- RK3288|RK3288 android7.1 mlx90640温度传感器调试
- RK3288|RK3288下添加PCF8563 RTC支持
- rk3288 7.1 usb触摸上下左右反
- Android|Android7.1 SurfaceFlinger实时显示帧率FPS/LCD帧数/Camera帧数