drivers/soc/sophgo/cv1800-rtcsys.c
Source file repositories/reference/linux-study-clean/drivers/soc/sophgo/cv1800-rtcsys.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/soc/sophgo/cv1800-rtcsys.c- Extension
.c- Size
- 1736 bytes
- Lines
- 64
- Domain
- Driver Families
- Bucket
- drivers/soc
- 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/mfd/core.hlinux/module.hlinux/of.hlinux/property.h
Detected Declarations
function cv1800_rtcsys_probe
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* Driver for Sophgo CV1800 series SoC RTC subsystem
*
* The RTC module comprises a 32kHz oscillator, Power-on-Reset (PoR) sub-module,
* HW state machine to control chip power-on, power-off and reset. Furthermore,
* the 8051 subsystem is located within RTCSYS including associated SRAM block.
*
* Copyright (C) 2025 Alexander Sverdlin <alexander.sverdlin@gmail.com>
*
*/
#include <linux/mfd/core.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/property.h>
static struct resource cv1800_rtcsys_irq_resources[] = {
DEFINE_RES_IRQ_NAMED(0, "alarm"),
};
static const struct mfd_cell cv1800_rtcsys_subdev[] = {
{
.name = "cv1800b-rtc",
.num_resources = 1,
.resources = &cv1800_rtcsys_irq_resources[0],
},
};
static int cv1800_rtcsys_probe(struct platform_device *pdev)
{
int irq;
irq = platform_get_irq_byname(pdev, "alarm");
if (irq < 0)
return irq;
cv1800_rtcsys_irq_resources[0].start = irq;
cv1800_rtcsys_irq_resources[0].end = irq;
return devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO,
cv1800_rtcsys_subdev,
ARRAY_SIZE(cv1800_rtcsys_subdev),
NULL, 0, NULL);
}
static const struct of_device_id cv1800_rtcsys_of_match[] = {
{ .compatible = "sophgo,cv1800b-rtc" },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, cv1800_rtcsys_of_match);
static struct platform_driver cv1800_rtcsys_mfd = {
.probe = cv1800_rtcsys_probe,
.driver = {
.name = "cv1800_rtcsys",
.of_match_table = cv1800_rtcsys_of_match,
},
};
module_platform_driver(cv1800_rtcsys_mfd);
MODULE_AUTHOR("Alexander Sverdlin <alexander.sverdlin@gmail.com>");
MODULE_DESCRIPTION("Sophgo CV1800 series SoC RTC subsystem driver");
MODULE_LICENSE("GPL");
Annotation
- Immediate include surface: `linux/mfd/core.h`, `linux/module.h`, `linux/of.h`, `linux/property.h`.
- Detected declarations: `function cv1800_rtcsys_probe`.
- Atlas domain: Driver Families / drivers/soc.
- 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.