linux/include/linux/mfd/wm8350/rtc.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * rtc.h  --  RTC driver for Wolfson WM8350 PMIC
 *
 * Copyright 2007 Wolfson Microelectronics PLC
 */

#ifndef __LINUX_MFD_WM8350_RTC_H
#define __LINUX_MFD_WM8350_RTC_H

#include <linux/platform_device.h>

/*
 * Register values.
 */
#define WM8350_RTC_SECONDS_MINUTES
#define WM8350_RTC_HOURS_DAY
#define WM8350_RTC_DATE_MONTH
#define WM8350_RTC_YEAR
#define WM8350_ALARM_SECONDS_MINUTES
#define WM8350_ALARM_HOURS_DAY
#define WM8350_ALARM_DATE_MONTH
#define WM8350_RTC_TIME_CONTROL

/*
 * R16 (0x10) - RTC Seconds/Minutes
 */
#define WM8350_RTC_MINS_MASK
#define WM8350_RTC_MINS_SHIFT
#define WM8350_RTC_SECS_MASK
#define WM8350_RTC_SECS_SHIFT

/*
 * R17 (0x11) - RTC Hours/Day
 */
#define WM8350_RTC_DAY_MASK
#define WM8350_RTC_DAY_SHIFT
#define WM8350_RTC_HPM_MASK
#define WM8350_RTC_HPM_SHIFT
#define WM8350_RTC_HRS_MASK
#define WM8350_RTC_HRS_SHIFT

/* Bit values for R21 (0x15) */
#define WM8350_RTC_DAY_SUN
#define WM8350_RTC_DAY_MON
#define WM8350_RTC_DAY_TUE
#define WM8350_RTC_DAY_WED
#define WM8350_RTC_DAY_THU
#define WM8350_RTC_DAY_FRI
#define WM8350_RTC_DAY_SAT

#define WM8350_RTC_HPM_AM
#define WM8350_RTC_HPM_PM

/*
 * R18 (0x12) - RTC Date/Month
 */
#define WM8350_RTC_MTH_MASK
#define WM8350_RTC_MTH_SHIFT
#define WM8350_RTC_DATE_MASK
#define WM8350_RTC_DATE_SHIFT

/* Bit values for R22 (0x16) */
#define WM8350_RTC_MTH_JAN
#define WM8350_RTC_MTH_FEB
#define WM8350_RTC_MTH_MAR
#define WM8350_RTC_MTH_APR
#define WM8350_RTC_MTH_MAY
#define WM8350_RTC_MTH_JUN
#define WM8350_RTC_MTH_JUL
#define WM8350_RTC_MTH_AUG
#define WM8350_RTC_MTH_SEP
#define WM8350_RTC_MTH_OCT
#define WM8350_RTC_MTH_NOV
#define WM8350_RTC_MTH_DEC
#define WM8350_RTC_MTH_JAN_BCD
#define WM8350_RTC_MTH_FEB_BCD
#define WM8350_RTC_MTH_MAR_BCD
#define WM8350_RTC_MTH_APR_BCD
#define WM8350_RTC_MTH_MAY_BCD
#define WM8350_RTC_MTH_JUN_BCD
#define WM8350_RTC_MTH_JUL_BCD
#define WM8350_RTC_MTH_AUG_BCD
#define WM8350_RTC_MTH_SEP_BCD
#define WM8350_RTC_MTH_OCT_BCD
#define WM8350_RTC_MTH_NOV_BCD
#define WM8350_RTC_MTH_DEC_BCD

/*
 * R19 (0x13) - RTC Year
 */
#define WM8350_RTC_YHUNDREDS_MASK
#define WM8350_RTC_YHUNDREDS_SHIFT
#define WM8350_RTC_YUNITS_MASK
#define WM8350_RTC_YUNITS_SHIFT

/*
 * R20 (0x14) - Alarm Seconds/Minutes
 */
#define WM8350_RTC_ALMMINS_MASK
#define WM8350_RTC_ALMMINS_SHIFT
#define WM8350_RTC_ALMSECS_MASK
#define WM8350_RTC_ALMSECS_SHIFT

/* Bit values for R20 (0x14) */
#define WM8350_RTC_ALMMINS_DONT_CARE
#define WM8350_RTC_ALMSECS_DONT_CARE

/*
 * R21 (0x15) - Alarm Hours/Day
 */
#define WM8350_RTC_ALMDAY_MASK
#define WM8350_RTC_ALMDAY_SHIFT
#define WM8350_RTC_ALMHPM_MASK
#define WM8350_RTC_ALMHPM_SHIFT
#define WM8350_RTC_ALMHRS_MASK
#define WM8350_RTC_ALMHRS_SHIFT

/* Bit values for R21 (0x15) */
#define WM8350_RTC_ALMDAY_DONT_CARE
#define WM8350_RTC_ALMDAY_SUN
#define WM8350_RTC_ALMDAY_MON
#define WM8350_RTC_ALMDAY_TUE
#define WM8350_RTC_ALMDAY_WED
#define WM8350_RTC_ALMDAY_THU
#define WM8350_RTC_ALMDAY_FRI
#define WM8350_RTC_ALMDAY_SAT

#define WM8350_RTC_ALMHPM_AM
#define WM8350_RTC_ALMHPM_PM

#define WM8350_RTC_ALMHRS_DONT_CARE

/*
 * R22 (0x16) - Alarm Date/Month
 */
#define WM8350_RTC_ALMMTH_MASK
#define WM8350_RTC_ALMMTH_SHIFT
#define WM8350_RTC_ALMDATE_MASK
#define WM8350_RTC_ALMDATE_SHIFT

/* Bit values for R22 (0x16) */
#define WM8350_RTC_ALMDATE_DONT_CARE

#define WM8350_RTC_ALMMTH_DONT_CARE
#define WM8350_RTC_ALMMTH_JAN
#define WM8350_RTC_ALMMTH_FEB
#define WM8350_RTC_ALMMTH_MAR
#define WM8350_RTC_ALMMTH_APR
#define WM8350_RTC_ALMMTH_MAY
#define WM8350_RTC_ALMMTH_JUN
#define WM8350_RTC_ALMMTH_JUL
#define WM8350_RTC_ALMMTH_AUG
#define WM8350_RTC_ALMMTH_SEP
#define WM8350_RTC_ALMMTH_OCT
#define WM8350_RTC_ALMMTH_NOV
#define WM8350_RTC_ALMMTH_DEC
#define WM8350_RTC_ALMMTH_JAN_BCD
#define WM8350_RTC_ALMMTH_FEB_BCD
#define WM8350_RTC_ALMMTH_MAR_BCD
#define WM8350_RTC_ALMMTH_APR_BCD
#define WM8350_RTC_ALMMTH_MAY_BCD
#define WM8350_RTC_ALMMTH_JUN_BCD
#define WM8350_RTC_ALMMTH_JUL_BCD
#define WM8350_RTC_ALMMTH_AUG_BCD
#define WM8350_RTC_ALMMTH_SEP_BCD
#define WM8350_RTC_ALMMTH_OCT_BCD
#define WM8350_RTC_ALMMTH_NOV_BCD
#define WM8350_RTC_ALMMTH_DEC_BCD

/*
 * R23 (0x17) - RTC Time Control
 */
#define WM8350_RTC_BCD
#define WM8350_RTC_BCD_MASK
#define WM8350_RTC_BCD_SHIFT
#define WM8350_RTC_12HR
#define WM8350_RTC_12HR_MASK
#define WM8350_RTC_12HR_SHIFT
#define WM8350_RTC_DST
#define WM8350_RTC_DST_MASK
#define WM8350_RTC_DST_SHIFT
#define WM8350_RTC_SET
#define WM8350_RTC_SET_MASK
#define WM8350_RTC_SET_SHIFT
#define WM8350_RTC_STS
#define WM8350_RTC_STS_MASK
#define WM8350_RTC_STS_SHIFT
#define WM8350_RTC_ALMSET
#define WM8350_RTC_ALMSET_MASK
#define WM8350_RTC_ALMSET_SHIFT
#define WM8350_RTC_ALMSTS
#define WM8350_RTC_ALMSTS_MASK
#define WM8350_RTC_ALMSTS_SHIFT
#define WM8350_RTC_PINT
#define WM8350_RTC_PINT_MASK
#define WM8350_RTC_PINT_SHIFT
#define WM8350_RTC_DSW
#define WM8350_RTC_DSW_MASK
#define WM8350_RTC_DSW_SHIFT

/* Bit values for R23 (0x17) */
#define WM8350_RTC_BCD_BINARY
#define WM8350_RTC_BCD_BCD

#define WM8350_RTC_12HR_24HR
#define WM8350_RTC_12HR_12HR

#define WM8350_RTC_DST_DISABLED
#define WM8350_RTC_DST_ENABLED

#define WM8350_RTC_SET_RUN
#define WM8350_RTC_SET_SET

#define WM8350_RTC_STS_RUNNING
#define WM8350_RTC_STS_STOPPED

#define WM8350_RTC_ALMSET_RUN
#define WM8350_RTC_ALMSET_SET

#define WM8350_RTC_ALMSTS_RUNNING
#define WM8350_RTC_ALMSTS_STOPPED

#define WM8350_RTC_PINT_DISABLED
#define WM8350_RTC_PINT_SECS
#define WM8350_RTC_PINT_MINS
#define WM8350_RTC_PINT_HRS
#define WM8350_RTC_PINT_DAYS
#define WM8350_RTC_PINT_MTHS

#define WM8350_RTC_DSW_DISABLED
#define WM8350_RTC_DSW_1HZ
#define WM8350_RTC_DSW_2HZ
#define WM8350_RTC_DSW_4HZ
#define WM8350_RTC_DSW_8HZ
#define WM8350_RTC_DSW_16HZ
#define WM8350_RTC_DSW_32HZ
#define WM8350_RTC_DSW_64HZ
#define WM8350_RTC_DSW_128HZ
#define WM8350_RTC_DSW_256HZ
#define WM8350_RTC_DSW_512HZ
#define WM8350_RTC_DSW_1024HZ

/*
 * R218 (0xDA) - RTC Tick Control
 */
#define WM8350_RTC_TICKSTS
#define WM8350_RTC_CLKSRC
#define WM8350_RTC_TRIM_MASK

/*
 * RTC Interrupts.
 */
#define WM8350_IRQ_RTC_PER
#define WM8350_IRQ_RTC_SEC
#define WM8350_IRQ_RTC_ALM

struct wm8350_rtc {};

#endif