linux/drivers/rtc/rtc-pcf85363.c

// SPDX-License-Identifier: GPL-2.0
/*
 * drivers/rtc/rtc-pcf85363.c
 *
 * Driver for NXP PCF85363 real-time clock.
 *
 * Copyright (C) 2017 Eric Nelson
 */
#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/rtc.h>
#include <linux/init.h>
#include <linux/err.h>
#include <linux/errno.h>
#include <linux/bcd.h>
#include <linux/of.h>
#include <linux/regmap.h>

/*
 * Date/Time registers
 */
#define DT_100THS
#define DT_SECS
#define DT_MINUTES
#define DT_HOURS
#define DT_DAYS
#define DT_WEEKDAYS
#define DT_MONTHS
#define DT_YEARS

/*
 * Alarm registers
 */
#define DT_SECOND_ALM1
#define DT_MINUTE_ALM1
#define DT_HOUR_ALM1
#define DT_DAY_ALM1
#define DT_MONTH_ALM1
#define DT_MINUTE_ALM2
#define DT_HOUR_ALM2
#define DT_WEEKDAY_ALM2
#define DT_ALARM_EN

/*
 * Time stamp registers
 */
#define DT_TIMESTAMP1
#define DT_TIMESTAMP2
#define DT_TIMESTAMP3
#define DT_TS_MODE

/*
 * control registers
 */
#define CTRL_OFFSET
#define CTRL_OSCILLATOR
#define CTRL_BATTERY
#define CTRL_PIN_IO
#define CTRL_FUNCTION
#define CTRL_INTA_EN
#define CTRL_INTB_EN
#define CTRL_FLAGS
#define CTRL_RAMBYTE
#define CTRL_WDOG
#define CTRL_STOP_EN
#define CTRL_RESETS
#define CTRL_RAM

#define ALRM_SEC_A1E
#define ALRM_MIN_A1E
#define ALRM_HR_A1E
#define ALRM_DAY_A1E
#define ALRM_MON_A1E
#define ALRM_MIN_A2E
#define ALRM_HR_A2E
#define ALRM_DAY_A2E

#define INT_WDIE
#define INT_BSIE
#define INT_TSRIE
#define INT_A2IE
#define INT_A1IE
#define INT_OIE
#define INT_PIE
#define INT_ILP

#define FLAGS_TSR1F
#define FLAGS_TSR2F
#define FLAGS_TSR3F
#define FLAGS_BSF
#define FLAGS_WDF
#define FLAGS_A1F
#define FLAGS_A2F
#define FLAGS_PIF

#define PIN_IO_INTAPM
#define PIN_IO_INTA_CLK
#define PIN_IO_INTA_BAT
#define PIN_IO_INTA_OUT
#define PIN_IO_INTA_HIZ

#define OSC_CAP_SEL
#define OSC_CAP_6000
#define OSC_CAP_12500

#define STOP_EN_STOP

#define RESET_CPR

#define NVRAM_SIZE

struct pcf85363 {};

struct pcf85x63_config {};

static int pcf85363_load_capacitance(struct pcf85363 *pcf85363, struct device_node *node)
{}

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

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

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

static int _pcf85363_rtc_alarm_irq_enable(struct pcf85363 *pcf85363, unsigned
					  int enabled)
{}

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

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

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

static const struct rtc_class_ops rtc_ops =;

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

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

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

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

static const struct pcf85x63_config pcf_85263_config =;

static const struct pcf85x63_config pcf_85363_config =;

static int pcf85363_probe(struct i2c_client *client)
{}

static const __maybe_unused struct of_device_id dev_ids[] =;
MODULE_DEVICE_TABLE(of, dev_ids);

static struct i2c_driver pcf85363_driver =;

module_i2c_driver();

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