#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/sys_soc.h>
#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/rtc.h>
#define REG_K3RTC_S_CNT_LSW …
#define REG_K3RTC_S_CNT_MSW …
#define REG_K3RTC_COMP …
#define REG_K3RTC_ON_OFF_S_CNT_LSW …
#define REG_K3RTC_ON_OFF_S_CNT_MSW …
#define REG_K3RTC_SCRATCH0 …
#define REG_K3RTC_SCRATCH7 …
#define REG_K3RTC_GENERAL_CTL …
#define REG_K3RTC_IRQSTATUS_RAW_SYS …
#define REG_K3RTC_IRQSTATUS_SYS …
#define REG_K3RTC_IRQENABLE_SET_SYS …
#define REG_K3RTC_IRQENABLE_CLR_SYS …
#define REG_K3RTC_SYNCPEND …
#define REG_K3RTC_KICK0 …
#define REG_K3RTC_KICK1 …
#define K3RTC_CNT_FMODE_S_CNT_VALUE …
#define K3RTC_KICK0_UNLOCK_VALUE …
#define K3RTC_KICK1_UNLOCK_VALUE …
#define K3RTC_PPB_MULT …
#define K3RTC_MIN_OFFSET …
#define K3RTC_MAX_OFFSET …
static const struct regmap_config ti_k3_rtc_regmap_config = …;
enum ti_k3_rtc_fields { … };
static const struct reg_field ti_rtc_reg_fields[] = …;
struct ti_k3_rtc { … };
static int k3rtc_field_read(struct ti_k3_rtc *priv, enum ti_k3_rtc_fields f)
{ … }
static void k3rtc_field_write(struct ti_k3_rtc *priv, enum ti_k3_rtc_fields f, u32 val)
{ … }
static int k3rtc_fence(struct ti_k3_rtc *priv)
{ … }
static inline int k3rtc_check_unlocked(struct ti_k3_rtc *priv)
{ … }
static int k3rtc_unlock_rtc(struct ti_k3_rtc *priv)
{ … }
static const struct soc_device_attribute has_erratum_i2327[] = …;
static int k3rtc_configure(struct device *dev)
{ … }
static int ti_k3_rtc_read_time(struct device *dev, struct rtc_time *tm)
{ … }
static int ti_k3_rtc_set_time(struct device *dev, struct rtc_time *tm)
{ … }
static int ti_k3_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
{ … }
static int ti_k3_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm)
{ … }
static int ti_k3_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm)
{ … }
static int ti_k3_rtc_read_offset(struct device *dev, long *offset)
{ … }
static int ti_k3_rtc_set_offset(struct device *dev, long offset)
{ … }
static irqreturn_t ti_k3_rtc_interrupt(s32 irq, void *dev_id)
{ … }
static const struct rtc_class_ops ti_k3_rtc_ops = …;
static int ti_k3_rtc_scratch_read(void *priv_data, unsigned int offset,
void *val, size_t bytes)
{ … }
static int ti_k3_rtc_scratch_write(void *priv_data, unsigned int offset,
void *val, size_t bytes)
{ … }
static struct nvmem_config ti_k3_rtc_nvmem_config = …;
static int k3rtc_get_32kclk(struct device *dev, struct ti_k3_rtc *priv)
{ … }
static int k3rtc_get_vbusclk(struct device *dev, struct ti_k3_rtc *priv)
{ … }
static int ti_k3_rtc_probe(struct platform_device *pdev)
{ … }
static const struct of_device_id ti_k3_rtc_of_match_table[] = …;
MODULE_DEVICE_TABLE(of, ti_k3_rtc_of_match_table);
static int __maybe_unused ti_k3_rtc_suspend(struct device *dev)
{ … }
static int __maybe_unused ti_k3_rtc_resume(struct device *dev)
{ … }
static SIMPLE_DEV_PM_OPS(ti_k3_rtc_pm_ops, ti_k3_rtc_suspend, ti_k3_rtc_resume);
static struct platform_driver ti_k3_rtc_driver = …;
module_platform_driver(…) …;
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;