linux/drivers/rtc/rtc-meson.c

// SPDX-License-Identifier: GPL-2.0
/*
 * RTC driver for the interal RTC block in the Amlogic Meson6, Meson8,
 * Meson8b and Meson8m2 SoCs.
 *
 * The RTC is split in to two parts, the AHB front end and a simple serial
 * connection to the actual registers. This driver manages both parts.
 *
 * Copyright (c) 2018 Martin Blumenstingl <[email protected]>
 * Copyright (c) 2015 Ben Dooks <[email protected]> for Codethink Ltd
 * Based on origin by Carlo Caione <[email protected]>
 */

#include <linux/bitfield.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/nvmem-provider.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
#include <linux/reset.h>
#include <linux/rtc.h>

/* registers accessed from cpu bus */
#define RTC_ADDR0
	#define RTC_ADDR0_LINE_SCLK
	#define RTC_ADDR0_LINE_SEN
	#define RTC_ADDR0_LINE_SDI
	#define RTC_ADDR0_START_SER
	#define RTC_ADDR0_WAIT_SER
	#define RTC_ADDR0_DATA

#define RTC_ADDR1
	#define RTC_ADDR1_SDO
	#define RTC_ADDR1_S_READY

#define RTC_ADDR2
#define RTC_ADDR3

#define RTC_REG4
	#define RTC_REG4_STATIC_VALUE

/* rtc registers accessed via rtc-serial interface */
#define RTC_COUNTER
#define RTC_SEC_ADJ
#define RTC_REGMEM_0
#define RTC_REGMEM_1
#define RTC_REGMEM_2
#define RTC_REGMEM_3

#define RTC_ADDR_BITS
#define RTC_DATA_BITS

#define MESON_STATIC_BIAS_CUR
#define MESON_STATIC_VOLTAGE
#define MESON_STATIC_DEFAULT

struct meson_rtc {};

static const struct regmap_config meson_rtc_peripheral_regmap_config =;

/* RTC front-end serialiser controls */

static void meson_rtc_sclk_pulse(struct meson_rtc *rtc)
{}

static void meson_rtc_send_bit(struct meson_rtc *rtc, unsigned int bit)
{}

static void meson_rtc_send_bits(struct meson_rtc *rtc, u32 data,
				unsigned int nr)
{}

static void meson_rtc_set_dir(struct meson_rtc *rtc, u32 mode)
{}

static u32 meson_rtc_get_data(struct meson_rtc *rtc)
{}

static int meson_rtc_get_bus(struct meson_rtc *rtc)
{}

static int meson_rtc_serial_bus_reg_read(void *context, unsigned int reg,
					 unsigned int *data)
{}

static int meson_rtc_serial_bus_reg_write(void *context, unsigned int reg,
					  unsigned int data)
{}

static const struct regmap_bus meson_rtc_serial_bus =;

static const struct regmap_config meson_rtc_serial_regmap_config =;

static int meson_rtc_write_static(struct meson_rtc *rtc, u32 data)
{}

/* RTC interface layer functions */

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

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

static const struct rtc_class_ops meson_rtc_ops =;

/* NVMEM interface layer functions */

static int meson_rtc_regmem_read(void *context, unsigned int offset,
				 void *buf, size_t bytes)
{}

static int meson_rtc_regmem_write(void *context, unsigned int offset,
				  void *buf, size_t bytes)
{}

static int meson_rtc_probe(struct platform_device *pdev)
{}

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

static struct platform_driver meson_rtc_driver =;
module_platform_driver();

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