linux/drivers/rtc/rtc-tps6594.c

// SPDX-License-Identifier: GPL-2.0
/*
 * RTC driver for tps6594 PMIC
 *
 * Copyright (C) 2023 BayLibre Incorporated - https://www.baylibre.com/
 */

#include <linux/bcd.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/limits.h>
#include <linux/math64.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/mod_devicetable.h>
#include <linux/property.h>
#include <linux/rtc.h>
#include <linux/types.h>
#include <linux/units.h>

#include <linux/mfd/tps6594.h>

// Total number of RTC registers needed to set time
#define NUM_TIME_REGS

// Total number of RTC alarm registers
#define NUM_TIME_ALARM_REGS

/*
 * Min and max values supported by 'offset' interface (swapped sign).
 * After conversion, the values do not exceed the range [-32767, 33767]
 * which COMP_REG must conform to.
 */
#define MIN_OFFSET
#define MAX_OFFSET

// Number of ticks per hour
#define TICKS_PER_HOUR

// Multiplier for ppb conversions
#define PPB_MULT

struct tps6594_rtc {};

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

/* Pulse GET_TIME field of RTC_CTRL_1 to store a timestamp in shadow registers. */
static int tps6594_rtc_shadow_timestamp(struct device *dev, struct tps6594 *tps)
{}

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

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

static int tps6594_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm)
{}

static int tps6594_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm)
{}

static int tps6594_rtc_set_calibration(struct device *dev, int calibration)
{}

static int tps6594_rtc_get_calibration(struct device *dev, int *calibration)
{}

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

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

static irqreturn_t tps6594_rtc_interrupt(int irq, void *data)
{}

static const struct rtc_class_ops tps6594_rtc_ops =;

static int tps6594_rtc_probe(struct platform_device *pdev)
{}

static int tps6594_rtc_resume(struct device *dev)
{}

static int tps6594_rtc_suspend(struct device *dev)
{}

static DEFINE_SIMPLE_DEV_PM_OPS(tps6594_rtc_pm_ops, tps6594_rtc_suspend, tps6594_rtc_resume);

static const struct platform_device_id tps6594_rtc_id_table[] =;
MODULE_DEVICE_TABLE(platform, tps6594_rtc_id_table);

static struct platform_driver tps6594_rtc_driver =;

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