My external RTC is DS1339, driven by rtc-ds1307.c
I chose it in the kernel.
<*> i²c Support
And
[*] 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
││*** i²c RTC Drivers ***││
││<*> Dallas/maxim ds1307/37/38/39/40, ST m41t00, EPSON rx-8025│
However, when you start, you are not prompted to find RTC:
Drivers/rtc/hctosys.c:unable to open RTC Device (RTC0)
When the boot is complete, you see:
/dev/i2c-1
/sys/bus/i2c/drivers/rtc-ds1307
But there's no/dev/rtc or anything.
After adding some debugging information, it was found that Ds1307_probe was not executed. Previously contacted drivers are registered with Platform_driver_register, and this RTC is
static int __init ds1307_init (void)
{
Return I2c_add_driver (&ds1307_driver);
}
In this case, how does the system invoke and load the driver? I looked inside and didn't find it. Call probe and perform an i²c operation
static struct I2c_board_info __initdata am3517evm_i2c1_boardinfo[]
The following code:
{
I2c_board_info ("rtc-ds1307", 0x68),
. Type = "ds3231",
},
The RTC is the DS1339, the driver uses the RTC-DS1307.C