免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3307 | 回复: 1
打印 上一主题 下一主题

RTC驱动测试函数read_time该怎么写? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-03-09 17:45 |只看该作者 |倒序浏览
  1. static int generic_get_time(struct device *dev, struct rtc_time *tm)
  2. {
  3.         unsigned int ret = get_rtc_time(tm);

  4.         if (ret & RTC_BATT_BAD)
  5.                 return -EOPNOTSUPP;

  6.         return rtc_valid_tm(tm);
  7. }

  8. static int generic_set_time(struct device *dev, struct rtc_time *tm)
  9. {
  10.         if (set_rtc_time(tm) < 0)
  11.                 return -EOPNOTSUPP;

  12.         return 0;
  13. }

  14. static const struct rtc_class_ops generic_rtc_ops = {
  15.         .read_time = generic_get_time,
  16.         .set_time = generic_set_time,
  17. };
复制代码
怎么在用户空间写read_time函数,该函数的参数该怎么写呢?

论坛徽章:
0
2 [报告]
发表于 2010-03-09 19:07 |只看该作者
这个还只是接口,你看rtc-dev.c 里面rtc_dev_ioctl 函数,就知道如何使用了,
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP