FILE
cv1800-rtcsys.c
File preview with syntax highlighting.
linux-6.19.14/drivers/soc/sophgo/cv1800-rtcsys.c
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Driver for Sophgo CV1800 series SoC RTC subsystem 4 * 5 * The RTC module comprises a 32kHz oscillator, Power-on-Reset (PoR) sub-module, 6 * HW state machine to control chip power-on, power-off and reset. Furthermore, 7 * the 8051 subsystem is located within RTCSYS including associated SRAM block. 8 * 9 * Copyright (C) 2025 Alexander Sverdlin <alexander.sverdlin@gmail.com> 10 * 11 */ 12 13#include <linux/mfd/core.h> 14#include <linux/module.h> 15#include <linux/of.h> 16#include <linux/property.h> 17 18static struct resource cv1800_rtcsys_irq_resources[] = { 19 DEFINE_RES_IRQ_NAMED(0, "alarm"), 20}; 21 22static const struct mfd_cell cv1800_rtcsys_subdev[] = { 23 { 24 .name = "cv1800b-rtc", 25 .num_resources = 1, 26 .resources = &cv1800_rtcsys_irq_resources[0], 27 }, 28}; 29 30static int cv1800_rtcsys_probe(struct platform_device *pdev) 31{ 32 int irq; 33 34 irq = platform_get_irq_byname(pdev, "alarm"); 35 if (irq < 0) 36 return irq; 37 cv1800_rtcsys_irq_resources[0].start = irq; 38 cv1800_rtcsys_irq_resources[0].end = irq; 39 40 return devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO, 41 cv1800_rtcsys_subdev, 42 ARRAY_SIZE(cv1800_rtcsys_subdev), 43 NULL, 0, NULL); 44} 45 46static const struct of_device_id cv1800_rtcsys_of_match[] = { 47 { .compatible = "sophgo,cv1800b-rtc" }, 48 { /* sentinel */ } 49}; 50MODULE_DEVICE_TABLE(of, cv1800_rtcsys_of_match); 51 52static struct platform_driver cv1800_rtcsys_mfd = { 53 .probe = cv1800_rtcsys_probe, 54 .driver = { 55 .name = "cv1800_rtcsys", 56 .of_match_table = cv1800_rtcsys_of_match, 57 }, 58}; 59module_platform_driver(cv1800_rtcsys_mfd); 60 61MODULE_AUTHOR("Alexander Sverdlin <alexander.sverdlin@gmail.com>"); 62MODULE_DESCRIPTION("Sophgo CV1800 series SoC RTC subsystem driver"); 63MODULE_LICENSE("GPL");
~/
Read-only file preview.