linux/drivers/rtc/rtc-max77686.c

// SPDX-License-Identifier: GPL-2.0+
//
// RTC driver for Maxim MAX77686 and MAX77802
//
// Copyright (C) 2012 Samsung Electronics Co.Ltd
//
//  based on rtc-max8997.c

#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/rtc.h>
#include <linux/delay.h>
#include <linux/mutex.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/mfd/max77686-private.h>
#include <linux/irqdomain.h>
#include <linux/regmap.h>

#define MAX77686_I2C_ADDR_RTC
#define MAX77620_I2C_ADDR_RTC
#define MAX77714_I2C_ADDR_RTC
#define MAX77686_INVALID_I2C_ADDR

/* Define non existing register */
#define MAX77686_INVALID_REG

/* RTC Control Register */
#define BCD_EN_SHIFT
#define BCD_EN_MASK
#define MODEL24_SHIFT
#define MODEL24_MASK
/* RTC Update Register1 */
#define RTC_UDR_SHIFT
#define RTC_UDR_MASK
#define RTC_RBUDR_SHIFT
#define RTC_RBUDR_MASK
/* RTC Alarm Enable */
#define ALARM_ENABLE_SHIFT
#define ALARM_ENABLE_MASK

#define REG_RTC_NONE

/*
 * MAX77802 has separate register (RTCAE1) for alarm enable instead
 * using 1 bit from registers RTC{SEC,MIN,HOUR,DAY,MONTH,YEAR,DATE}
 * as in done in MAX77686.
 */
#define MAX77802_ALARM_ENABLE_VALUE

enum {};

/**
 * struct max77686_rtc_driver_data - model-specific configuration
 * @delay: Minimum usecs needed for a RTC update
 * @mask: Mask used to read RTC registers value
 * @map: Registers offset to I2C addresses map
 * @alarm_enable_reg: Has a separate alarm enable register?
 * @rtc_i2c_addr: I2C address for RTC block
 * @rtc_irq_from_platform: RTC interrupt via platform resource
 * @alarm_pending_status_reg: Pending alarm status register
 * @rtc_irq_chip: RTC IRQ CHIP for regmap
 * @regmap_config: regmap configuration for the chip
 */
struct max77686_rtc_driver_data {};

struct max77686_rtc_info {};

enum MAX77686_RTC_OP {};

/* These are not registers but just offsets that are mapped to addresses */
enum max77686_rtc_reg_offset {};

/* Maps RTC registers offset to the MAX77686 register addresses */
static const unsigned int max77686_map[REG_RTC_END] =;

static const struct regmap_irq max77686_rtc_irqs[] =;

static const struct regmap_irq_chip max77686_rtc_irq_chip =;

static const struct regmap_config max77686_rtc_regmap_config =;

static const struct max77686_rtc_driver_data max77686_drv_data =;

static const struct regmap_irq_chip max77714_rtc_irq_chip =;

static const struct max77686_rtc_driver_data max77714_drv_data =;

static const struct regmap_config max77620_rtc_regmap_config =;

static const struct max77686_rtc_driver_data max77620_drv_data =;

static const unsigned int max77802_map[REG_RTC_END] =;

static const struct regmap_irq_chip max77802_rtc_irq_chip =;

static const struct max77686_rtc_driver_data max77802_drv_data =;

static void max77686_rtc_data_to_tm(u8 *data, struct rtc_time *tm,
				    struct max77686_rtc_info *info)
{}

static int max77686_rtc_tm_to_data(struct rtc_time *tm, u8 *data,
				   struct max77686_rtc_info *info)
{}

static int max77686_rtc_update(struct max77686_rtc_info *info,
			       enum MAX77686_RTC_OP op)
{}

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

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

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

static int max77686_rtc_stop_alarm(struct max77686_rtc_info *info)
{}

static int max77686_rtc_start_alarm(struct max77686_rtc_info *info)
{}

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

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

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

static const struct rtc_class_ops max77686_rtc_ops =;

static int max77686_rtc_init_reg(struct max77686_rtc_info *info)
{}

static int max77686_init_rtc_regmap(struct max77686_rtc_info *info)
{}

static int max77686_rtc_probe(struct platform_device *pdev)
{}

static void max77686_rtc_remove(struct platform_device *pdev)
{}

#ifdef CONFIG_PM_SLEEP
static int max77686_rtc_suspend(struct device *dev)
{}

static int max77686_rtc_resume(struct device *dev)
{}
#endif

static SIMPLE_DEV_PM_OPS(max77686_rtc_pm_ops,
			 max77686_rtc_suspend, max77686_rtc_resume);

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

static struct platform_driver max77686_rtc_driver =;

module_platform_driver();

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