#include <linux/clk-provider.h>
#include <linux/i2c.h>
#include <linux/bcd.h>
#include <linux/rtc.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/err.h>
#define PCF8563_REG_ST1 …
#define PCF8563_REG_ST2 …
#define PCF8563_BIT_AIE …
#define PCF8563_BIT_AF …
#define PCF8563_BITS_ST2_N …
#define PCF8563_REG_SC …
#define PCF8563_REG_MN …
#define PCF8563_REG_HR …
#define PCF8563_REG_DM …
#define PCF8563_REG_DW …
#define PCF8563_REG_MO …
#define PCF8563_REG_YR …
#define PCF8563_REG_AMN …
#define PCF8563_REG_CLKO …
#define PCF8563_REG_CLKO_FE …
#define PCF8563_REG_CLKO_F_MASK …
#define PCF8563_REG_CLKO_F_32768HZ …
#define PCF8563_REG_CLKO_F_1024HZ …
#define PCF8563_REG_CLKO_F_32HZ …
#define PCF8563_REG_CLKO_F_1HZ …
#define PCF8563_REG_TMRC …
#define PCF8563_TMRC_ENABLE …
#define PCF8563_TMRC_4096 …
#define PCF8563_TMRC_64 …
#define PCF8563_TMRC_1 …
#define PCF8563_TMRC_1_60 …
#define PCF8563_TMRC_MASK …
#define PCF8563_REG_TMR …
#define PCF8563_SC_LV …
#define PCF8563_MO_C …
static struct i2c_driver pcf8563_driver;
struct pcf8563 { … };
static int pcf8563_read_block_data(struct i2c_client *client, unsigned char reg,
unsigned char length, unsigned char *buf)
{ … }
static int pcf8563_write_block_data(struct i2c_client *client,
unsigned char reg, unsigned char length,
unsigned char *buf)
{ … }
static int pcf8563_set_alarm_mode(struct i2c_client *client, bool on)
{ … }
static int pcf8563_get_alarm_mode(struct i2c_client *client, unsigned char *en,
unsigned char *pen)
{ … }
static irqreturn_t pcf8563_irq(int irq, void *dev_id)
{ … }
static int pcf8563_rtc_read_time(struct device *dev, struct rtc_time *tm)
{ … }
static int pcf8563_rtc_set_time(struct device *dev, struct rtc_time *tm)
{ … }
static int pcf8563_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
{ … }
static int pcf8563_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *tm)
{ … }
static int pcf8563_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *tm)
{ … }
static int pcf8563_irq_enable(struct device *dev, unsigned int enabled)
{ … }
#ifdef CONFIG_COMMON_CLK
#define clkout_hw_to_pcf8563(_hw) …
static const int clkout_rates[] = …;
static unsigned long pcf8563_clkout_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate)
{ … }
static long pcf8563_clkout_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *prate)
{ … }
static int pcf8563_clkout_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate)
{ … }
static int pcf8563_clkout_control(struct clk_hw *hw, bool enable)
{ … }
static int pcf8563_clkout_prepare(struct clk_hw *hw)
{ … }
static void pcf8563_clkout_unprepare(struct clk_hw *hw)
{ … }
static int pcf8563_clkout_is_prepared(struct clk_hw *hw)
{ … }
static const struct clk_ops pcf8563_clkout_ops = …;
static struct clk *pcf8563_clkout_register_clk(struct pcf8563 *pcf8563)
{ … }
#endif
static const struct rtc_class_ops pcf8563_rtc_ops = …;
static int pcf8563_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id pcf8563_id[] = …;
MODULE_DEVICE_TABLE(i2c, pcf8563_id);
#ifdef CONFIG_OF
static const struct of_device_id pcf8563_of_match[] = …;
MODULE_DEVICE_TABLE(of, pcf8563_of_match);
#endif
static struct i2c_driver pcf8563_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;