Lines Matching +full:ep9301 +full:- +full:rtc

1 // SPDX-License-Identifier: GPL-2.0
3 * A driver for the RTC embedded in the Cirrus Logic EP93XX processors
11 #include <linux/rtc.h>
31 struct rtc_device *rtc; member
40 comp = readl(ep93xx_rtc->mmio_base + EP93XX_RTC_SWCOMP); in ep93xx_rtc_get_swcomp()
58 time = readl(ep93xx_rtc->mmio_base + EP93XX_RTC_DATA); in ep93xx_rtc_read_time()
69 writel(secs + 1, ep93xx_rtc->mmio_base + EP93XX_RTC_LOAD); in ep93xx_rtc_set_time()
96 ep93xx_rtc_get_swcomp(dev->parent, &preload, NULL); in comp_preload_show()
107 ep93xx_rtc_get_swcomp(dev->parent, NULL, &delete); in comp_delete_show()
128 ep93xx_rtc = devm_kzalloc(&pdev->dev, sizeof(*ep93xx_rtc), GFP_KERNEL); in ep93xx_rtc_probe()
130 return -ENOMEM; in ep93xx_rtc_probe()
132 ep93xx_rtc->mmio_base = devm_platform_ioremap_resource(pdev, 0); in ep93xx_rtc_probe()
133 if (IS_ERR(ep93xx_rtc->mmio_base)) in ep93xx_rtc_probe()
134 return PTR_ERR(ep93xx_rtc->mmio_base); in ep93xx_rtc_probe()
138 ep93xx_rtc->rtc = devm_rtc_allocate_device(&pdev->dev); in ep93xx_rtc_probe()
139 if (IS_ERR(ep93xx_rtc->rtc)) in ep93xx_rtc_probe()
140 return PTR_ERR(ep93xx_rtc->rtc); in ep93xx_rtc_probe()
142 ep93xx_rtc->rtc->ops = &ep93xx_rtc_ops; in ep93xx_rtc_probe()
143 ep93xx_rtc->rtc->range_max = U32_MAX; in ep93xx_rtc_probe()
145 err = rtc_add_group(ep93xx_rtc->rtc, &ep93xx_rtc_sysfs_files); in ep93xx_rtc_probe()
149 return devm_rtc_register_device(ep93xx_rtc->rtc); in ep93xx_rtc_probe()
153 { .compatible = "cirrus,ep9301-rtc" },
160 .name = "ep93xx-rtc",
169 MODULE_DESCRIPTION("EP93XX RTC driver");
171 MODULE_ALIAS("platform:ep93xx-rtc");