Linux Drivers: RTC subsystem

Source: Internet
Author: User
Tags set time

    1. Description


      This paper analyzes code based on 3.10 kernel, hardware platform for embedded arm platform.



2. RTC Subsystem Related files

drivers/rtc/class.cdrivers/rtc/interface.cdrivers/rtc/rtc-core.hdrivers/rtc/rtc-dev.cdrivers/rtc/ Rtc-lib.cdrivers/rtc/rtc-proc.cdrivers/rtc/rtc-sysfs.cdrivers/rtc/hctosys.cdrivers/rtc/rtc-xxx.c

CLASS.C: Managing the RTC SYS class;

INTERFACE.C: The main function is the indirect RTC drive interface;

RTC-DEV.C:RTC device user interface;

RTC-LIB.C:RTC auxiliary function, mainly used for RTC time conversion, calculation;

RTC-PROC:RTC proc FS (user) interface;

RTC-SYSFS:RTC SYS FS (user) interface;

HCTOSYS.C: Used to read time from RTC at system startup and set to system time;

RTC-XXX.C:RTC hardware chip driver, such as rtc-wm8350.c,rtc-hym8563.c.



3. RTC Subsystem Block Diagram


650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/97/FC/wKioL1k2EYuwmCfUAABNGCkC9gw392.gif "title=" Rtc-hie.gif "alt=" Wkiol1k2eyuwmcfuaabngckc9gw392.gif "/>

is based on the new RTC Subsystem Framework, which can better adapt to the embedded development environment, the embedded environment may have multiple RTC cores

Chip.

The old RTC Drive is a simple character device driver that is adapted to the PC platform and should have a/DEV/RTC device file.


Under the new RTC Subsystem Framework, the application accesses the RTC chip via the/DEV/RTC[0-N] device. These accesses are

The interface provided by the RTC-DEV.C provides indirect access to the RTC chip driver provided by the RTC-XXX.C. Common operations have read/set time operations,

This each RTC chip must support the operation.

Of course, access to the/dev/rtc[0-n] device files is not the only way to access the RTC chip, and the Proc,sys FS provided by RTC

Interface to access the RTC.



4. System Time Source: RTC Device Development


Device Drivers--->

[*] Real Time Clock--->

(rtc0) RTC used to set system time

...

RTC Interfaces * * *

...

i²c RTC Drivers * * *

...

SPI RTC Drivers * * *

...

on-cpu RTC Drivers * * *

...

Note: The red typeface is the RTC device specified as the source of the system time.


This article is from the "Jimokuangxiangqu" blog, make sure to keep this source http://4594296.blog.51cto.com/4584296/1932659

Linux Drivers: RTC subsystem

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.