#include <linux/bcd.h>
#include <linux/clk-provider.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/rtc.h>
#include <linux/slab.h>
#define NCT3018Y_REG_SC …
#define NCT3018Y_REG_SCA …
#define NCT3018Y_REG_MN …
#define NCT3018Y_REG_MNA …
#define NCT3018Y_REG_HR …
#define NCT3018Y_REG_HRA …
#define NCT3018Y_REG_DW …
#define NCT3018Y_REG_DM …
#define NCT3018Y_REG_MO …
#define NCT3018Y_REG_YR …
#define NCT3018Y_REG_CTRL …
#define NCT3018Y_REG_ST …
#define NCT3018Y_REG_CLKO …
#define NCT3018Y_REG_PART …
#define NCT3018Y_BIT_AF …
#define NCT3018Y_BIT_ST …
#define NCT3018Y_BIT_DM …
#define NCT3018Y_BIT_HF …
#define NCT3018Y_BIT_DSM …
#define NCT3018Y_BIT_AIE …
#define NCT3018Y_BIT_OFIE …
#define NCT3018Y_BIT_CIE …
#define NCT3018Y_BIT_TWO …
#define NCT3018Y_REG_BAT_MASK …
#define NCT3018Y_REG_CLKO_F_MASK …
#define NCT3018Y_REG_CLKO_CKE …
#define NCT3018Y_REG_PART_NCT3018Y …
struct nct3018y { … };
static int nct3018y_set_alarm_mode(struct i2c_client *client, bool on)
{ … }
static int nct3018y_get_alarm_mode(struct i2c_client *client, unsigned char *alarm_enable,
unsigned char *alarm_flag)
{ … }
static irqreturn_t nct3018y_irq(int irq, void *dev_id)
{ … }
static int nct3018y_rtc_read_time(struct device *dev, struct rtc_time *tm)
{ … }
static int nct3018y_rtc_set_time(struct device *dev, struct rtc_time *tm)
{ … }
static int nct3018y_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *tm)
{ … }
static int nct3018y_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *tm)
{ … }
static int nct3018y_irq_enable(struct device *dev, unsigned int enabled)
{ … }
static int nct3018y_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
{ … }
#ifdef CONFIG_COMMON_CLK
#define clkout_hw_to_nct3018y(_hw) …
static const int clkout_rates[] = …;
static unsigned long nct3018y_clkout_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate)
{ … }
static long nct3018y_clkout_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *prate)
{ … }
static int nct3018y_clkout_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate)
{ … }
static int nct3018y_clkout_control(struct clk_hw *hw, bool enable)
{ … }
static int nct3018y_clkout_prepare(struct clk_hw *hw)
{ … }
static void nct3018y_clkout_unprepare(struct clk_hw *hw)
{ … }
static int nct3018y_clkout_is_prepared(struct clk_hw *hw)
{ … }
static const struct clk_ops nct3018y_clkout_ops = …;
static struct clk *nct3018y_clkout_register_clk(struct nct3018y *nct3018y)
{ … }
#endif
static const struct rtc_class_ops nct3018y_rtc_ops = …;
static int nct3018y_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id nct3018y_id[] = …;
MODULE_DEVICE_TABLE(i2c, nct3018y_id);
static const struct of_device_id nct3018y_of_match[] = …;
MODULE_DEVICE_TABLE(of, nct3018y_of_match);
static struct i2c_driver nct3018y_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;