zoukankan      html  css  js  c++  java
  • RTC是DS1339,驱动采用的是rtc-ds1307.c

    我的外部RTC是DS1339,驱动采用的是rtc-ds1307.c
    在内核里选上了 
    <*> I2C support 
    以及
     [*]   Set system time from RTC on startup and resume             │ │  
      │ │    (rtc0)  RTC used to set the system time                          │ │  
      │ │    [*]   RTC debug support                                          │ │  
      │ │          *** RTC interfaces ***                                     │ │  
      │ │    [*]   /sys/class/rtc/rtcN (sysfs)                                │ │  
      │ │    [*]   /proc/driver/rtc (procfs for rtc0)                         │ │  
      │ │    [*]   /dev/rtcN (character devices)                              │ │  
      │ │    [*]     RTC UIE emulation on dev interface                       │ │  
      │ │    < >   Test driver/device                       
      │ │          *** I2C RTC drivers ***                                    │ │  
      │ │    <*>   Dallas/Maxim DS1307/37/38/39/40, ST M41T00, EPSON RX-8025  │
    但是启动的时候提示找不到rtc:
    drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
    启动完成后看到有:
    /dev/i2c-1
    /sys/bus/i2c/drivers/rtc-ds1307
    但是没有/dev/rtc什么的。
    加了些调试信息后发现ds1307_probe并没有被执行。以前接触的驱动都是用platform_driver_register注册的,这个rtc则是
    static int __init ds1307_init(void)
    {
    return i2c_add_driver(&ds1307_driver);
    }
    在这种情况下,系统是怎么调用和加载驱动的?我往里看了看,没发现它调用probe和执行I2C操作

    static struct i2c_board_info __initdata am3517evm_i2c1_boardinfo[]
    如下代码:
         {
             I2C_BOARD_INFO("rtc-ds1307",0x68),
             .type = "ds3231",
         },

  • 相关阅读:
    自动构建部署
    EF 性能调优
    断点续传
    gis 相关资料
    easyui 特殊操作
    KJ面试
    前端面试题汇总
    es6之扩展运算符 三个点(...)
    vue.js开发环境搭建
    gulp 环境搭建
  • 原文地址:https://www.cnblogs.com/subo_peng/p/5041247.html
Copyright © 2011-2022 走看看