linux/drivers/rtc/rtc-pcf85063.c

// SPDX-License-Identifier: GPL-2.0
/*
 * An I2C driver for the PCF85063 RTC
 * Copyright 2014 Rose Technology
 *
 * Author: Søren Andersen <[email protected]>
 * Maintainers: http://www.nslu2-linux.org/
 *
 * Copyright (C) 2019 Micro Crystal AG
 * Author: Alexandre Belloni <[email protected]>
 */
#include <linux/clk-provider.h>
#include <linux/i2c.h>
#include <linux/bcd.h>
#include <linux/rtc.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/pm_wakeirq.h>
#include <linux/regmap.h>

/*
 * Information for this driver was pulled from the following datasheets.
 *
 *  https://www.nxp.com/docs/en/data-sheet/PCF85063A.pdf
 *  https://www.nxp.com/docs/en/data-sheet/PCF85063TP.pdf
 *
 *  PCF85063A -- Rev. 7 — 30 March 2018
 *  PCF85063TP -- Rev. 4 — 6 May 2015
 *
 *  https://www.microcrystal.com/fileadmin/Media/Products/RTC/App.Manual/RV-8263-C7_App-Manual.pdf
 *  RV8263 -- Rev. 1.0 — January 2019
 */

#define PCF85063_REG_CTRL1
#define PCF85063_REG_CTRL1_CAP_SEL
#define PCF85063_REG_CTRL1_STOP
#define PCF85063_REG_CTRL1_EXT_TEST

#define PCF85063_REG_CTRL2
#define PCF85063_CTRL2_AF
#define PCF85063_CTRL2_AIE

#define PCF85063_REG_OFFSET
#define PCF85063_OFFSET_SIGN_BIT
#define PCF85063_OFFSET_MODE
#define PCF85063_OFFSET_STEP0
#define PCF85063_OFFSET_STEP1

#define PCF85063_REG_CLKO_F_MASK
#define PCF85063_REG_CLKO_F_32768HZ
#define PCF85063_REG_CLKO_F_OFF

#define PCF85063_REG_RAM

#define PCF85063_REG_SC
#define PCF85063_REG_SC_OS

#define PCF85063_REG_ALM_S
#define PCF85063_AEN

struct pcf85063_config {};

struct pcf85063 {};

static int pcf85063_rtc_read_time(struct device *dev, struct rtc_time *tm)
{}

static int pcf85063_rtc_set_time(struct device *dev, struct rtc_time *tm)
{}

static int pcf85063_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
{}

static int pcf85063_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
{}

static int pcf85063_rtc_alarm_irq_enable(struct device *dev,
					 unsigned int enabled)
{}

static irqreturn_t pcf85063_rtc_handle_irq(int irq, void *dev_id)
{}

static int pcf85063_read_offset(struct device *dev, long *offset)
{}

static int pcf85063_set_offset(struct device *dev, long offset)
{}

static int pcf85063_ioctl(struct device *dev, unsigned int cmd,
			  unsigned long arg)
{}

static const struct rtc_class_ops pcf85063_rtc_ops =;

static int pcf85063_nvmem_read(void *priv, unsigned int offset,
			       void *val, size_t bytes)
{}

static int pcf85063_nvmem_write(void *priv, unsigned int offset,
				void *val, size_t bytes)
{}

static int pcf85063_load_capacitance(struct pcf85063 *pcf85063,
				     const struct device_node *np,
				     unsigned int force_cap)
{}

#ifdef CONFIG_COMMON_CLK
/*
 * Handling of the clkout
 */

#define clkout_hw_to_pcf85063(_hw)

static int clkout_rates[] =;

static unsigned long pcf85063_clkout_recalc_rate(struct clk_hw *hw,
						 unsigned long parent_rate)
{}

static long pcf85063_clkout_round_rate(struct clk_hw *hw, unsigned long rate,
				       unsigned long *prate)
{}

static int pcf85063_clkout_set_rate(struct clk_hw *hw, unsigned long rate,
				    unsigned long parent_rate)
{}

static int pcf85063_clkout_control(struct clk_hw *hw, bool enable)
{}

static int pcf85063_clkout_prepare(struct clk_hw *hw)
{}

static void pcf85063_clkout_unprepare(struct clk_hw *hw)
{}

static int pcf85063_clkout_is_prepared(struct clk_hw *hw)
{}

static const struct clk_ops pcf85063_clkout_ops =;

static struct clk *pcf85063_clkout_register_clk(struct pcf85063 *pcf85063)
{}
#endif

static const struct pcf85063_config config_pcf85063 =;

static const struct pcf85063_config config_pcf85063tp =;

static const struct pcf85063_config config_pcf85063a =;

static const struct pcf85063_config config_rv8263 =;

static int pcf85063_probe(struct i2c_client *client)
{}

static const struct i2c_device_id pcf85063_ids[] =;
MODULE_DEVICE_TABLE(i2c, pcf85063_ids);

#ifdef CONFIG_OF
static const struct of_device_id pcf85063_of_match[] =;
MODULE_DEVICE_TABLE(of, pcf85063_of_match);
#endif

static struct i2c_driver pcf85063_driver =;

module_i2c_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();