#include <linux/of.h>
#include <linux/module.h>
#include <linux/nvmem-consumer.h>
#include <linux/init.h>
#include <linux/rtc.h>
#include <linux/platform_device.h>
#include <linux/pm.h>
#include <linux/pm_wakeirq.h>
#include <linux/regmap.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/unaligned.h>
#define PM8xxx_RTC_ENABLE …
#define PM8xxx_RTC_ALARM_CLEAR …
#define PM8xxx_RTC_ALARM_ENABLE …
#define NUM_8_BIT_RTC_REGS …
struct pm8xxx_rtc_regs { … };
struct pm8xxx_rtc { … };
static int pm8xxx_rtc_read_nvmem_offset(struct pm8xxx_rtc *rtc_dd)
{ … }
static int pm8xxx_rtc_write_nvmem_offset(struct pm8xxx_rtc *rtc_dd, u32 offset)
{ … }
static int pm8xxx_rtc_read_offset(struct pm8xxx_rtc *rtc_dd)
{ … }
static int pm8xxx_rtc_read_raw(struct pm8xxx_rtc *rtc_dd, u32 *secs)
{ … }
static int pm8xxx_rtc_update_offset(struct pm8xxx_rtc *rtc_dd, u32 secs)
{ … }
static int __pm8xxx_rtc_set_time(struct pm8xxx_rtc *rtc_dd, u32 secs)
{ … }
static int pm8xxx_rtc_set_time(struct device *dev, struct rtc_time *tm)
{ … }
static int pm8xxx_rtc_read_time(struct device *dev, struct rtc_time *tm)
{ … }
static int pm8xxx_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm)
{ … }
static int pm8xxx_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm)
{ … }
static int pm8xxx_rtc_alarm_irq_enable(struct device *dev, unsigned int enable)
{ … }
static const struct rtc_class_ops pm8xxx_rtc_ops = …;
static irqreturn_t pm8xxx_alarm_trigger(int irq, void *dev_id)
{ … }
static int pm8xxx_rtc_enable(struct pm8xxx_rtc *rtc_dd)
{ … }
static const struct pm8xxx_rtc_regs pm8921_regs = …;
static const struct pm8xxx_rtc_regs pm8058_regs = …;
static const struct pm8xxx_rtc_regs pm8941_regs = …;
static const struct pm8xxx_rtc_regs pmk8350_regs = …;
static const struct of_device_id pm8xxx_id_table[] = …;
MODULE_DEVICE_TABLE(of, pm8xxx_id_table);
static int pm8xxx_rtc_probe(struct platform_device *pdev)
{ … }
static void pm8xxx_remove(struct platform_device *pdev)
{ … }
static struct platform_driver pm8xxx_rtc_driver = …;
module_platform_driver(…) …;
MODULE_ALIAS(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;