#include <linux/kernel.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/platform_data/cros_ec_commands.h>
#include <linux/platform_data/cros_ec_proto.h>
#include <linux/platform_device.h>
#include <linux/rtc.h>
#include <linux/slab.h>
#define DRV_NAME …
#define SECS_PER_DAY …
struct cros_ec_rtc { … };
static int cros_ec_rtc_get(struct cros_ec_device *cros_ec, u32 command,
u32 *response)
{ … }
static int cros_ec_rtc_set(struct cros_ec_device *cros_ec, u32 command,
u32 param)
{ … }
static int cros_ec_rtc_read_time(struct device *dev, struct rtc_time *tm)
{ … }
static int cros_ec_rtc_set_time(struct device *dev, struct rtc_time *tm)
{ … }
static int cros_ec_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
{ … }
static int cros_ec_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
{ … }
static int cros_ec_rtc_alarm_irq_enable(struct device *dev,
unsigned int enabled)
{ … }
static int cros_ec_rtc_event(struct notifier_block *nb,
unsigned long queued_during_suspend,
void *_notify)
{ … }
static const struct rtc_class_ops cros_ec_rtc_ops = …;
#ifdef CONFIG_PM_SLEEP
static int cros_ec_rtc_suspend(struct device *dev)
{ … }
static int cros_ec_rtc_resume(struct device *dev)
{ … }
#endif
static SIMPLE_DEV_PM_OPS(cros_ec_rtc_pm_ops, cros_ec_rtc_suspend,
cros_ec_rtc_resume);
static int cros_ec_rtc_probe(struct platform_device *pdev)
{ … }
static void cros_ec_rtc_remove(struct platform_device *pdev)
{ … }
static const struct platform_device_id cros_ec_rtc_id[] = …;
MODULE_DEVICE_TABLE(platform, cros_ec_rtc_id);
static struct platform_driver cros_ec_rtc_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;