drivers/rtc/rtc-da9063.c
Source file repositories/reference/linux-study-clean/drivers/rtc/rtc-da9063.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/rtc/rtc-da9063.c- Extension
.c- Size
- 14888 bytes
- Lines
- 498
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/delay.hlinux/init.hlinux/interrupt.hlinux/kernel.hlinux/module.hlinux/of.hlinux/platform_device.hlinux/pm_wakeirq.hlinux/regmap.hlinux/rtc.hlinux/slab.hlinux/mfd/da9062/registers.hlinux/mfd/da9063/registers.hlinux/mfd/da9063/core.h
Detected Declarations
struct da9063_compatible_rtc_regmapstruct da9063_compatible_rtcfunction da9063_data_to_tmfunction da9063_tm_to_datafunction da9063_rtc_alarm_irq_enablefunction da9063_rtc_read_timefunction da9063_rtc_set_timefunction da9063_rtc_read_alarmfunction da9063_rtc_set_alarmfunction da9063_alarm_eventfunction da9063_rtc_probe
Annotated Snippet
struct da9063_compatible_rtc_regmap {
/* REGS */
int rtc_enable_reg;
int rtc_enable_32k_crystal_reg;
int rtc_alarm_secs_reg;
int rtc_alarm_year_reg;
int rtc_count_secs_reg;
int rtc_count_year_reg;
int rtc_event_reg;
/* MASKS */
int rtc_enable_mask;
int rtc_crystal_mask;
int rtc_event_alarm_mask;
int rtc_alarm_on_mask;
int rtc_alarm_status_mask;
int rtc_tick_on_mask;
int rtc_ready_to_read_mask;
int rtc_count_sec_mask;
int rtc_count_min_mask;
int rtc_count_hour_mask;
int rtc_count_day_mask;
int rtc_count_month_mask;
int rtc_count_year_mask;
/* ALARM CONFIG */
int rtc_data_start;
int rtc_alarm_len;
};
struct da9063_compatible_rtc {
struct rtc_device *rtc_dev;
struct rtc_time alarm_time;
struct regmap *regmap;
const struct da9063_compatible_rtc_regmap *config;
bool rtc_sync;
};
static const struct da9063_compatible_rtc_regmap da9063_ad_regs = {
/* REGS */
.rtc_enable_reg = DA9063_REG_CONTROL_E,
.rtc_alarm_secs_reg = DA9063_AD_REG_ALARM_MI,
.rtc_alarm_year_reg = DA9063_AD_REG_ALARM_Y,
.rtc_count_secs_reg = DA9063_REG_COUNT_S,
.rtc_count_year_reg = DA9063_REG_COUNT_Y,
.rtc_event_reg = DA9063_REG_EVENT_A,
/* MASKS */
.rtc_enable_mask = DA9063_RTC_EN,
.rtc_crystal_mask = DA9063_CRYSTAL,
.rtc_enable_32k_crystal_reg = DA9063_REG_EN_32K,
.rtc_event_alarm_mask = DA9063_E_ALARM,
.rtc_alarm_on_mask = DA9063_ALARM_ON,
.rtc_alarm_status_mask = DA9063_ALARM_STATUS_ALARM |
DA9063_ALARM_STATUS_TICK,
.rtc_tick_on_mask = DA9063_TICK_ON,
.rtc_ready_to_read_mask = DA9063_RTC_READ,
.rtc_count_sec_mask = DA9063_COUNT_SEC_MASK,
.rtc_count_min_mask = DA9063_COUNT_MIN_MASK,
.rtc_count_hour_mask = DA9063_COUNT_HOUR_MASK,
.rtc_count_day_mask = DA9063_COUNT_DAY_MASK,
.rtc_count_month_mask = DA9063_COUNT_MONTH_MASK,
.rtc_count_year_mask = DA9063_COUNT_YEAR_MASK,
/* ALARM CONFIG */
.rtc_data_start = RTC_MIN,
.rtc_alarm_len = RTC_DATA_LEN - 1,
};
static const struct da9063_compatible_rtc_regmap da9063_bb_regs = {
/* REGS */
.rtc_enable_reg = DA9063_REG_CONTROL_E,
.rtc_alarm_secs_reg = DA9063_BB_REG_ALARM_S,
.rtc_alarm_year_reg = DA9063_BB_REG_ALARM_Y,
.rtc_count_secs_reg = DA9063_REG_COUNT_S,
.rtc_count_year_reg = DA9063_REG_COUNT_Y,
.rtc_event_reg = DA9063_REG_EVENT_A,
/* MASKS */
.rtc_enable_mask = DA9063_RTC_EN,
.rtc_crystal_mask = DA9063_CRYSTAL,
.rtc_enable_32k_crystal_reg = DA9063_REG_EN_32K,
.rtc_event_alarm_mask = DA9063_E_ALARM,
.rtc_alarm_on_mask = DA9063_ALARM_ON,
.rtc_alarm_status_mask = DA9063_ALARM_STATUS_ALARM |
DA9063_ALARM_STATUS_TICK,
.rtc_tick_on_mask = DA9063_TICK_ON,
.rtc_ready_to_read_mask = DA9063_RTC_READ,
.rtc_count_sec_mask = DA9063_COUNT_SEC_MASK,
.rtc_count_min_mask = DA9063_COUNT_MIN_MASK,
.rtc_count_hour_mask = DA9063_COUNT_HOUR_MASK,
.rtc_count_day_mask = DA9063_COUNT_DAY_MASK,
.rtc_count_month_mask = DA9063_COUNT_MONTH_MASK,
.rtc_count_year_mask = DA9063_COUNT_YEAR_MASK,
/* ALARM CONFIG */
Annotation
- Immediate include surface: `linux/delay.h`, `linux/init.h`, `linux/interrupt.h`, `linux/kernel.h`, `linux/module.h`, `linux/of.h`, `linux/platform_device.h`, `linux/pm_wakeirq.h`.
- Detected declarations: `struct da9063_compatible_rtc_regmap`, `struct da9063_compatible_rtc`, `function da9063_data_to_tm`, `function da9063_tm_to_data`, `function da9063_rtc_alarm_irq_enable`, `function da9063_rtc_read_time`, `function da9063_rtc_set_time`, `function da9063_rtc_read_alarm`, `function da9063_rtc_set_alarm`, `function da9063_alarm_event`.
- Atlas domain: Driver Families / drivers/rtc.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.