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",
         },

  • 相关阅读:
    vue中的 computed 和 watch 的区别
    mysql8.0 初始化数据库及表名大小写问题
    sql server alwayson 调整数据文件路径
    zabbix 自定义监控 SQL Server
    mysql 创建用户及授权
    mysql 设置从库只读模式
    mysql8.0 主从复制安装及配置
    centos8.0安装mysql8.0
    centos8替换阿里数据源
    npm publish 报错 【you or one of your dependencies are requesting a package version that is forbidden by your security policy】
  • 原文地址:https://www.cnblogs.com/subo_peng/p/5041247.html
Copyright © 2011-2022 走看看