drivers/rtc/rtc-au1xxx.c
Source file repositories/reference/linux-study-clean/drivers/rtc/rtc-au1xxx.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/rtc/rtc-au1xxx.c- Extension
.c- Size
- 3014 bytes
- Lines
- 119
- Domain
- Driver Families
- Bucket
- drivers/rtc
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/kernel.hlinux/rtc.hlinux/init.hlinux/platform_device.hlinux/io.hasm/mach-au1x00/au1000.h
Detected Declarations
function au1xtoy_rtc_read_timefunction au1xtoy_rtc_set_timefunction au1xtoy_rtc_probe
Annotated Snippet
if (!t) {
/* timed out waiting for register access; assume
* counters are unusable.
*/
dev_err(&pdev->dev, "timeout waiting for access\n");
return -ETIMEDOUT;
}
/* set 1Hz TOY tick rate */
alchemy_wrsys(32767, AU1000_SYS_TOYTRIM);
}
/* wait until the hardware allows writes to the counter reg */
while (alchemy_rdsys(AU1000_SYS_CNTRCTRL) & SYS_CNTRL_C0S)
msleep(1);
rtcdev = devm_rtc_allocate_device(&pdev->dev);
if (IS_ERR(rtcdev))
return PTR_ERR(rtcdev);
rtcdev->ops = &au1xtoy_rtc_ops;
rtcdev->range_max = U32_MAX;
platform_set_drvdata(pdev, rtcdev);
return devm_rtc_register_device(rtcdev);
}
static struct platform_driver au1xrtc_driver = {
.driver = {
.name = "rtc-au1xxx",
},
};
module_platform_driver_probe(au1xrtc_driver, au1xtoy_rtc_probe);
MODULE_DESCRIPTION("Au1xxx TOY-counter-based RTC driver");
MODULE_AUTHOR("Manuel Lauss <manuel.lauss@gmail.com>");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:rtc-au1xxx");
Annotation
- Immediate include surface: `linux/module.h`, `linux/kernel.h`, `linux/rtc.h`, `linux/init.h`, `linux/platform_device.h`, `linux/io.h`, `asm/mach-au1x00/au1000.h`.
- Detected declarations: `function au1xtoy_rtc_read_time`, `function au1xtoy_rtc_set_time`, `function au1xtoy_rtc_probe`.
- Atlas domain: Driver Families / drivers/rtc.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.