18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Xilinx Zynq Ultrascale+ MPSoC Real Time Clock Driver
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 2015 Xilinx, Inc.
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci */
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#include <linux/delay.h>
108c2ecf20Sopenharmony_ci#include <linux/init.h>
118c2ecf20Sopenharmony_ci#include <linux/io.h>
128c2ecf20Sopenharmony_ci#include <linux/module.h>
138c2ecf20Sopenharmony_ci#include <linux/of.h>
148c2ecf20Sopenharmony_ci#include <linux/platform_device.h>
158c2ecf20Sopenharmony_ci#include <linux/rtc.h>
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci/* RTC Registers */
188c2ecf20Sopenharmony_ci#define RTC_SET_TM_WR		0x00
198c2ecf20Sopenharmony_ci#define RTC_SET_TM_RD		0x04
208c2ecf20Sopenharmony_ci#define RTC_CALIB_WR		0x08
218c2ecf20Sopenharmony_ci#define RTC_CALIB_RD		0x0C
228c2ecf20Sopenharmony_ci#define RTC_CUR_TM		0x10
238c2ecf20Sopenharmony_ci#define RTC_CUR_TICK		0x14
248c2ecf20Sopenharmony_ci#define RTC_ALRM		0x18
258c2ecf20Sopenharmony_ci#define RTC_INT_STS		0x20
268c2ecf20Sopenharmony_ci#define RTC_INT_MASK		0x24
278c2ecf20Sopenharmony_ci#define RTC_INT_EN		0x28
288c2ecf20Sopenharmony_ci#define RTC_INT_DIS		0x2C
298c2ecf20Sopenharmony_ci#define RTC_CTRL		0x40
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci#define RTC_FR_EN		BIT(20)
328c2ecf20Sopenharmony_ci#define RTC_FR_DATSHIFT		16
338c2ecf20Sopenharmony_ci#define RTC_TICK_MASK		0xFFFF
348c2ecf20Sopenharmony_ci#define RTC_INT_SEC		BIT(0)
358c2ecf20Sopenharmony_ci#define RTC_INT_ALRM		BIT(1)
368c2ecf20Sopenharmony_ci#define RTC_OSC_EN		BIT(24)
378c2ecf20Sopenharmony_ci#define RTC_BATT_EN		BIT(31)
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci#define RTC_CALIB_DEF		0x198233
408c2ecf20Sopenharmony_ci#define RTC_CALIB_MASK		0x1FFFFF
418c2ecf20Sopenharmony_ci#define RTC_ALRM_MASK          BIT(1)
428c2ecf20Sopenharmony_ci#define RTC_MSEC               1000
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_cistruct xlnx_rtc_dev {
458c2ecf20Sopenharmony_ci	struct rtc_device	*rtc;
468c2ecf20Sopenharmony_ci	void __iomem		*reg_base;
478c2ecf20Sopenharmony_ci	int			alarm_irq;
488c2ecf20Sopenharmony_ci	int			sec_irq;
498c2ecf20Sopenharmony_ci	unsigned int		calibval;
508c2ecf20Sopenharmony_ci};
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_cistatic int xlnx_rtc_set_time(struct device *dev, struct rtc_time *tm)
538c2ecf20Sopenharmony_ci{
548c2ecf20Sopenharmony_ci	struct xlnx_rtc_dev *xrtcdev = dev_get_drvdata(dev);
558c2ecf20Sopenharmony_ci	unsigned long new_time;
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_ci	/*
588c2ecf20Sopenharmony_ci	 * The value written will be updated after 1 sec into the
598c2ecf20Sopenharmony_ci	 * seconds read register, so we need to program time +1 sec
608c2ecf20Sopenharmony_ci	 * to get the correct time on read.
618c2ecf20Sopenharmony_ci	 */
628c2ecf20Sopenharmony_ci	new_time = rtc_tm_to_time64(tm) + 1;
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ci	/*
658c2ecf20Sopenharmony_ci	 * Writing into calibration register will clear the Tick Counter and
668c2ecf20Sopenharmony_ci	 * force the next second to be signaled exactly in 1 second period
678c2ecf20Sopenharmony_ci	 */
688c2ecf20Sopenharmony_ci	xrtcdev->calibval &= RTC_CALIB_MASK;
698c2ecf20Sopenharmony_ci	writel(xrtcdev->calibval, (xrtcdev->reg_base + RTC_CALIB_WR));
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ci	writel(new_time, xrtcdev->reg_base + RTC_SET_TM_WR);
728c2ecf20Sopenharmony_ci
738c2ecf20Sopenharmony_ci	/*
748c2ecf20Sopenharmony_ci	 * Clear the rtc interrupt status register after setting the
758c2ecf20Sopenharmony_ci	 * time. During a read_time function, the code should read the
768c2ecf20Sopenharmony_ci	 * RTC_INT_STATUS register and if bit 0 is still 0, it means
778c2ecf20Sopenharmony_ci	 * that one second has not elapsed yet since RTC was set and
788c2ecf20Sopenharmony_ci	 * the current time should be read from SET_TIME_READ register;
798c2ecf20Sopenharmony_ci	 * otherwise, CURRENT_TIME register is read to report the time
808c2ecf20Sopenharmony_ci	 */
818c2ecf20Sopenharmony_ci	writel(RTC_INT_SEC, xrtcdev->reg_base + RTC_INT_STS);
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ci	return 0;
848c2ecf20Sopenharmony_ci}
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_cistatic int xlnx_rtc_read_time(struct device *dev, struct rtc_time *tm)
878c2ecf20Sopenharmony_ci{
888c2ecf20Sopenharmony_ci	u32 status;
898c2ecf20Sopenharmony_ci	unsigned long read_time;
908c2ecf20Sopenharmony_ci	struct xlnx_rtc_dev *xrtcdev = dev_get_drvdata(dev);
918c2ecf20Sopenharmony_ci
928c2ecf20Sopenharmony_ci	status = readl(xrtcdev->reg_base + RTC_INT_STS);
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_ci	if (status & RTC_INT_SEC) {
958c2ecf20Sopenharmony_ci		/*
968c2ecf20Sopenharmony_ci		 * RTC has updated the CURRENT_TIME with the time written into
978c2ecf20Sopenharmony_ci		 * SET_TIME_WRITE register.
988c2ecf20Sopenharmony_ci		 */
998c2ecf20Sopenharmony_ci		read_time = readl(xrtcdev->reg_base + RTC_CUR_TM);
1008c2ecf20Sopenharmony_ci	} else {
1018c2ecf20Sopenharmony_ci		/*
1028c2ecf20Sopenharmony_ci		 * Time written in SET_TIME_WRITE has not yet updated into
1038c2ecf20Sopenharmony_ci		 * the seconds read register, so read the time from the
1048c2ecf20Sopenharmony_ci		 * SET_TIME_WRITE instead of CURRENT_TIME register.
1058c2ecf20Sopenharmony_ci		 * Since we add +1 sec while writing, we need to -1 sec while
1068c2ecf20Sopenharmony_ci		 * reading.
1078c2ecf20Sopenharmony_ci		 */
1088c2ecf20Sopenharmony_ci		read_time = readl(xrtcdev->reg_base + RTC_SET_TM_RD) - 1;
1098c2ecf20Sopenharmony_ci	}
1108c2ecf20Sopenharmony_ci	rtc_time64_to_tm(read_time, tm);
1118c2ecf20Sopenharmony_ci
1128c2ecf20Sopenharmony_ci	return 0;
1138c2ecf20Sopenharmony_ci}
1148c2ecf20Sopenharmony_ci
1158c2ecf20Sopenharmony_cistatic int xlnx_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
1168c2ecf20Sopenharmony_ci{
1178c2ecf20Sopenharmony_ci	struct xlnx_rtc_dev *xrtcdev = dev_get_drvdata(dev);
1188c2ecf20Sopenharmony_ci
1198c2ecf20Sopenharmony_ci	rtc_time64_to_tm(readl(xrtcdev->reg_base + RTC_ALRM), &alrm->time);
1208c2ecf20Sopenharmony_ci	alrm->enabled = readl(xrtcdev->reg_base + RTC_INT_MASK) & RTC_INT_ALRM;
1218c2ecf20Sopenharmony_ci
1228c2ecf20Sopenharmony_ci	return 0;
1238c2ecf20Sopenharmony_ci}
1248c2ecf20Sopenharmony_ci
1258c2ecf20Sopenharmony_cistatic int xlnx_rtc_alarm_irq_enable(struct device *dev, u32 enabled)
1268c2ecf20Sopenharmony_ci{
1278c2ecf20Sopenharmony_ci	struct xlnx_rtc_dev *xrtcdev = dev_get_drvdata(dev);
1288c2ecf20Sopenharmony_ci	unsigned int status;
1298c2ecf20Sopenharmony_ci	ulong timeout;
1308c2ecf20Sopenharmony_ci
1318c2ecf20Sopenharmony_ci	timeout = jiffies + msecs_to_jiffies(RTC_MSEC);
1328c2ecf20Sopenharmony_ci
1338c2ecf20Sopenharmony_ci	if (enabled) {
1348c2ecf20Sopenharmony_ci		while (1) {
1358c2ecf20Sopenharmony_ci			status = readl(xrtcdev->reg_base + RTC_INT_STS);
1368c2ecf20Sopenharmony_ci			if (!((status & RTC_ALRM_MASK) == RTC_ALRM_MASK))
1378c2ecf20Sopenharmony_ci				break;
1388c2ecf20Sopenharmony_ci
1398c2ecf20Sopenharmony_ci			if (time_after_eq(jiffies, timeout)) {
1408c2ecf20Sopenharmony_ci				dev_err(dev, "Time out occur, while clearing alarm status bit\n");
1418c2ecf20Sopenharmony_ci				return -ETIMEDOUT;
1428c2ecf20Sopenharmony_ci			}
1438c2ecf20Sopenharmony_ci			writel(RTC_INT_ALRM, xrtcdev->reg_base + RTC_INT_STS);
1448c2ecf20Sopenharmony_ci		}
1458c2ecf20Sopenharmony_ci
1468c2ecf20Sopenharmony_ci		writel(RTC_INT_ALRM, xrtcdev->reg_base + RTC_INT_EN);
1478c2ecf20Sopenharmony_ci	} else {
1488c2ecf20Sopenharmony_ci		writel(RTC_INT_ALRM, xrtcdev->reg_base + RTC_INT_DIS);
1498c2ecf20Sopenharmony_ci	}
1508c2ecf20Sopenharmony_ci
1518c2ecf20Sopenharmony_ci	return 0;
1528c2ecf20Sopenharmony_ci}
1538c2ecf20Sopenharmony_ci
1548c2ecf20Sopenharmony_cistatic int xlnx_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
1558c2ecf20Sopenharmony_ci{
1568c2ecf20Sopenharmony_ci	struct xlnx_rtc_dev *xrtcdev = dev_get_drvdata(dev);
1578c2ecf20Sopenharmony_ci	unsigned long alarm_time;
1588c2ecf20Sopenharmony_ci
1598c2ecf20Sopenharmony_ci	alarm_time = rtc_tm_to_time64(&alrm->time);
1608c2ecf20Sopenharmony_ci
1618c2ecf20Sopenharmony_ci	writel((u32)alarm_time, (xrtcdev->reg_base + RTC_ALRM));
1628c2ecf20Sopenharmony_ci
1638c2ecf20Sopenharmony_ci	xlnx_rtc_alarm_irq_enable(dev, alrm->enabled);
1648c2ecf20Sopenharmony_ci
1658c2ecf20Sopenharmony_ci	return 0;
1668c2ecf20Sopenharmony_ci}
1678c2ecf20Sopenharmony_ci
1688c2ecf20Sopenharmony_cistatic void xlnx_init_rtc(struct xlnx_rtc_dev *xrtcdev)
1698c2ecf20Sopenharmony_ci{
1708c2ecf20Sopenharmony_ci	u32 rtc_ctrl;
1718c2ecf20Sopenharmony_ci
1728c2ecf20Sopenharmony_ci	/* Enable RTC switch to battery when VCC_PSAUX is not available */
1738c2ecf20Sopenharmony_ci	rtc_ctrl = readl(xrtcdev->reg_base + RTC_CTRL);
1748c2ecf20Sopenharmony_ci	rtc_ctrl |= RTC_BATT_EN;
1758c2ecf20Sopenharmony_ci	writel(rtc_ctrl, xrtcdev->reg_base + RTC_CTRL);
1768c2ecf20Sopenharmony_ci
1778c2ecf20Sopenharmony_ci	/*
1788c2ecf20Sopenharmony_ci	 * Based on crystal freq of 33.330 KHz
1798c2ecf20Sopenharmony_ci	 * set the seconds counter and enable, set fractions counter
1808c2ecf20Sopenharmony_ci	 * to default value suggested as per design spec
1818c2ecf20Sopenharmony_ci	 * to correct RTC delay in frequency over period of time.
1828c2ecf20Sopenharmony_ci	 */
1838c2ecf20Sopenharmony_ci	xrtcdev->calibval &= RTC_CALIB_MASK;
1848c2ecf20Sopenharmony_ci	writel(xrtcdev->calibval, (xrtcdev->reg_base + RTC_CALIB_WR));
1858c2ecf20Sopenharmony_ci}
1868c2ecf20Sopenharmony_ci
1878c2ecf20Sopenharmony_cistatic const struct rtc_class_ops xlnx_rtc_ops = {
1888c2ecf20Sopenharmony_ci	.set_time	  = xlnx_rtc_set_time,
1898c2ecf20Sopenharmony_ci	.read_time	  = xlnx_rtc_read_time,
1908c2ecf20Sopenharmony_ci	.read_alarm	  = xlnx_rtc_read_alarm,
1918c2ecf20Sopenharmony_ci	.set_alarm	  = xlnx_rtc_set_alarm,
1928c2ecf20Sopenharmony_ci	.alarm_irq_enable = xlnx_rtc_alarm_irq_enable,
1938c2ecf20Sopenharmony_ci};
1948c2ecf20Sopenharmony_ci
1958c2ecf20Sopenharmony_cistatic irqreturn_t xlnx_rtc_interrupt(int irq, void *id)
1968c2ecf20Sopenharmony_ci{
1978c2ecf20Sopenharmony_ci	struct xlnx_rtc_dev *xrtcdev = (struct xlnx_rtc_dev *)id;
1988c2ecf20Sopenharmony_ci	unsigned int status;
1998c2ecf20Sopenharmony_ci
2008c2ecf20Sopenharmony_ci	status = readl(xrtcdev->reg_base + RTC_INT_STS);
2018c2ecf20Sopenharmony_ci	/* Check if interrupt asserted */
2028c2ecf20Sopenharmony_ci	if (!(status & (RTC_INT_SEC | RTC_INT_ALRM)))
2038c2ecf20Sopenharmony_ci		return IRQ_NONE;
2048c2ecf20Sopenharmony_ci
2058c2ecf20Sopenharmony_ci	/* Disable RTC_INT_ALRM interrupt only */
2068c2ecf20Sopenharmony_ci	writel(RTC_INT_ALRM, xrtcdev->reg_base + RTC_INT_DIS);
2078c2ecf20Sopenharmony_ci
2088c2ecf20Sopenharmony_ci	if (status & RTC_INT_ALRM)
2098c2ecf20Sopenharmony_ci		rtc_update_irq(xrtcdev->rtc, 1, RTC_IRQF | RTC_AF);
2108c2ecf20Sopenharmony_ci
2118c2ecf20Sopenharmony_ci	return IRQ_HANDLED;
2128c2ecf20Sopenharmony_ci}
2138c2ecf20Sopenharmony_ci
2148c2ecf20Sopenharmony_cistatic int xlnx_rtc_probe(struct platform_device *pdev)
2158c2ecf20Sopenharmony_ci{
2168c2ecf20Sopenharmony_ci	struct xlnx_rtc_dev *xrtcdev;
2178c2ecf20Sopenharmony_ci	int ret;
2188c2ecf20Sopenharmony_ci
2198c2ecf20Sopenharmony_ci	xrtcdev = devm_kzalloc(&pdev->dev, sizeof(*xrtcdev), GFP_KERNEL);
2208c2ecf20Sopenharmony_ci	if (!xrtcdev)
2218c2ecf20Sopenharmony_ci		return -ENOMEM;
2228c2ecf20Sopenharmony_ci
2238c2ecf20Sopenharmony_ci	platform_set_drvdata(pdev, xrtcdev);
2248c2ecf20Sopenharmony_ci
2258c2ecf20Sopenharmony_ci	xrtcdev->rtc = devm_rtc_allocate_device(&pdev->dev);
2268c2ecf20Sopenharmony_ci	if (IS_ERR(xrtcdev->rtc))
2278c2ecf20Sopenharmony_ci		return PTR_ERR(xrtcdev->rtc);
2288c2ecf20Sopenharmony_ci
2298c2ecf20Sopenharmony_ci	xrtcdev->rtc->ops = &xlnx_rtc_ops;
2308c2ecf20Sopenharmony_ci	xrtcdev->rtc->range_max = U32_MAX;
2318c2ecf20Sopenharmony_ci
2328c2ecf20Sopenharmony_ci	xrtcdev->reg_base = devm_platform_ioremap_resource(pdev, 0);
2338c2ecf20Sopenharmony_ci	if (IS_ERR(xrtcdev->reg_base))
2348c2ecf20Sopenharmony_ci		return PTR_ERR(xrtcdev->reg_base);
2358c2ecf20Sopenharmony_ci
2368c2ecf20Sopenharmony_ci	xrtcdev->alarm_irq = platform_get_irq_byname(pdev, "alarm");
2378c2ecf20Sopenharmony_ci	if (xrtcdev->alarm_irq < 0)
2388c2ecf20Sopenharmony_ci		return xrtcdev->alarm_irq;
2398c2ecf20Sopenharmony_ci	ret = devm_request_irq(&pdev->dev, xrtcdev->alarm_irq,
2408c2ecf20Sopenharmony_ci			       xlnx_rtc_interrupt, 0,
2418c2ecf20Sopenharmony_ci			       dev_name(&pdev->dev), xrtcdev);
2428c2ecf20Sopenharmony_ci	if (ret) {
2438c2ecf20Sopenharmony_ci		dev_err(&pdev->dev, "request irq failed\n");
2448c2ecf20Sopenharmony_ci		return ret;
2458c2ecf20Sopenharmony_ci	}
2468c2ecf20Sopenharmony_ci
2478c2ecf20Sopenharmony_ci	xrtcdev->sec_irq = platform_get_irq_byname(pdev, "sec");
2488c2ecf20Sopenharmony_ci	if (xrtcdev->sec_irq < 0)
2498c2ecf20Sopenharmony_ci		return xrtcdev->sec_irq;
2508c2ecf20Sopenharmony_ci	ret = devm_request_irq(&pdev->dev, xrtcdev->sec_irq,
2518c2ecf20Sopenharmony_ci			       xlnx_rtc_interrupt, 0,
2528c2ecf20Sopenharmony_ci			       dev_name(&pdev->dev), xrtcdev);
2538c2ecf20Sopenharmony_ci	if (ret) {
2548c2ecf20Sopenharmony_ci		dev_err(&pdev->dev, "request irq failed\n");
2558c2ecf20Sopenharmony_ci		return ret;
2568c2ecf20Sopenharmony_ci	}
2578c2ecf20Sopenharmony_ci
2588c2ecf20Sopenharmony_ci	ret = of_property_read_u32(pdev->dev.of_node, "calibration",
2598c2ecf20Sopenharmony_ci				   &xrtcdev->calibval);
2608c2ecf20Sopenharmony_ci	if (ret)
2618c2ecf20Sopenharmony_ci		xrtcdev->calibval = RTC_CALIB_DEF;
2628c2ecf20Sopenharmony_ci
2638c2ecf20Sopenharmony_ci	xlnx_init_rtc(xrtcdev);
2648c2ecf20Sopenharmony_ci
2658c2ecf20Sopenharmony_ci	device_init_wakeup(&pdev->dev, 1);
2668c2ecf20Sopenharmony_ci
2678c2ecf20Sopenharmony_ci	return rtc_register_device(xrtcdev->rtc);
2688c2ecf20Sopenharmony_ci}
2698c2ecf20Sopenharmony_ci
2708c2ecf20Sopenharmony_cistatic int xlnx_rtc_remove(struct platform_device *pdev)
2718c2ecf20Sopenharmony_ci{
2728c2ecf20Sopenharmony_ci	xlnx_rtc_alarm_irq_enable(&pdev->dev, 0);
2738c2ecf20Sopenharmony_ci	device_init_wakeup(&pdev->dev, 0);
2748c2ecf20Sopenharmony_ci
2758c2ecf20Sopenharmony_ci	return 0;
2768c2ecf20Sopenharmony_ci}
2778c2ecf20Sopenharmony_ci
2788c2ecf20Sopenharmony_cistatic int __maybe_unused xlnx_rtc_suspend(struct device *dev)
2798c2ecf20Sopenharmony_ci{
2808c2ecf20Sopenharmony_ci	struct xlnx_rtc_dev *xrtcdev = dev_get_drvdata(dev);
2818c2ecf20Sopenharmony_ci
2828c2ecf20Sopenharmony_ci	if (device_may_wakeup(dev))
2838c2ecf20Sopenharmony_ci		enable_irq_wake(xrtcdev->alarm_irq);
2848c2ecf20Sopenharmony_ci	else
2858c2ecf20Sopenharmony_ci		xlnx_rtc_alarm_irq_enable(dev, 0);
2868c2ecf20Sopenharmony_ci
2878c2ecf20Sopenharmony_ci	return 0;
2888c2ecf20Sopenharmony_ci}
2898c2ecf20Sopenharmony_ci
2908c2ecf20Sopenharmony_cistatic int __maybe_unused xlnx_rtc_resume(struct device *dev)
2918c2ecf20Sopenharmony_ci{
2928c2ecf20Sopenharmony_ci	struct xlnx_rtc_dev *xrtcdev = dev_get_drvdata(dev);
2938c2ecf20Sopenharmony_ci
2948c2ecf20Sopenharmony_ci	if (device_may_wakeup(dev))
2958c2ecf20Sopenharmony_ci		disable_irq_wake(xrtcdev->alarm_irq);
2968c2ecf20Sopenharmony_ci	else
2978c2ecf20Sopenharmony_ci		xlnx_rtc_alarm_irq_enable(dev, 1);
2988c2ecf20Sopenharmony_ci
2998c2ecf20Sopenharmony_ci	return 0;
3008c2ecf20Sopenharmony_ci}
3018c2ecf20Sopenharmony_ci
3028c2ecf20Sopenharmony_cistatic SIMPLE_DEV_PM_OPS(xlnx_rtc_pm_ops, xlnx_rtc_suspend, xlnx_rtc_resume);
3038c2ecf20Sopenharmony_ci
3048c2ecf20Sopenharmony_cistatic const struct of_device_id xlnx_rtc_of_match[] = {
3058c2ecf20Sopenharmony_ci	{.compatible = "xlnx,zynqmp-rtc" },
3068c2ecf20Sopenharmony_ci	{ }
3078c2ecf20Sopenharmony_ci};
3088c2ecf20Sopenharmony_ciMODULE_DEVICE_TABLE(of, xlnx_rtc_of_match);
3098c2ecf20Sopenharmony_ci
3108c2ecf20Sopenharmony_cistatic struct platform_driver xlnx_rtc_driver = {
3118c2ecf20Sopenharmony_ci	.probe		= xlnx_rtc_probe,
3128c2ecf20Sopenharmony_ci	.remove		= xlnx_rtc_remove,
3138c2ecf20Sopenharmony_ci	.driver		= {
3148c2ecf20Sopenharmony_ci		.name	= KBUILD_MODNAME,
3158c2ecf20Sopenharmony_ci		.pm	= &xlnx_rtc_pm_ops,
3168c2ecf20Sopenharmony_ci		.of_match_table	= xlnx_rtc_of_match,
3178c2ecf20Sopenharmony_ci	},
3188c2ecf20Sopenharmony_ci};
3198c2ecf20Sopenharmony_ci
3208c2ecf20Sopenharmony_cimodule_platform_driver(xlnx_rtc_driver);
3218c2ecf20Sopenharmony_ci
3228c2ecf20Sopenharmony_ciMODULE_DESCRIPTION("Xilinx Zynq MPSoC RTC driver");
3238c2ecf20Sopenharmony_ciMODULE_AUTHOR("Xilinx Inc.");
3248c2ecf20Sopenharmony_ciMODULE_LICENSE("GPL v2");
325