linux/include/uapi/linux/rtc.h

/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
 * Generic RTC interface.
 * This version contains the part of the user interface to the Real Time Clock
 * service. It is used with both the legacy mc146818 and also  EFI
 * Struct rtc_time and first 12 ioctl by Paul Gortmaker, 1996 - separated out
 * from <linux/mc146818rtc.h> to this file for 2.4 kernels.
 *
 * Copyright (C) 1999 Hewlett-Packard Co.
 * Copyright (C) 1999 Stephane Eranian <[email protected]>
 */
#ifndef _UAPI_LINUX_RTC_H_
#define _UAPI_LINUX_RTC_H_

#include <linux/const.h>
#include <linux/ioctl.h>
#include <linux/types.h>

/*
 * The struct used to pass data via the following ioctl. Similar to the
 * struct tm in <time.h>, but it needs to be here so that the kernel
 * source is self contained, allowing cross-compiles, etc. etc.
 */

struct rtc_time {};

/*
 * This data structure is inspired by the EFI (v0.92) wakeup
 * alarm API.
 */
struct rtc_wkalrm {};

/*
 * Data structure to control PLL correction some better RTC feature
 * pll_value is used to get or set current value of correction,
 * the rest of the struct is used to query HW capabilities.
 * This is modeled after the RTC used in Q40/Q60 computers but
 * should be sufficiently flexible for other devices
 *
 * +ve pll_value means clock will run faster by
 *   pll_value*pll_posmult/pll_clock
 * -ve pll_value means clock will run slower by
 *   pll_value*pll_negmult/pll_clock
 */

struct rtc_pll_info {};

struct rtc_param {};

/*
 * ioctl calls that are permitted to the /dev/rtc interface, if
 * any of the RTC drivers are enabled.
 */

#define RTC_AIE_ON
#define RTC_AIE_OFF
#define RTC_UIE_ON
#define RTC_UIE_OFF
#define RTC_PIE_ON
#define RTC_PIE_OFF
#define RTC_WIE_ON
#define RTC_WIE_OFF

#define RTC_ALM_SET
#define RTC_ALM_READ
#define RTC_RD_TIME
#define RTC_SET_TIME
#define RTC_IRQP_READ
#define RTC_IRQP_SET
#define RTC_EPOCH_READ
#define RTC_EPOCH_SET

#define RTC_WKALM_SET
#define RTC_WKALM_RD

#define RTC_PLL_GET
#define RTC_PLL_SET

#define RTC_PARAM_GET
#define RTC_PARAM_SET

#define RTC_VL_DATA_INVALID
#define RTC_VL_BACKUP_LOW
#define RTC_VL_BACKUP_EMPTY
#define RTC_VL_ACCURACY_LOW
#define RTC_VL_BACKUP_SWITCH

#define RTC_VL_READ
#define RTC_VL_CLR

/* interrupt flags */
#define RTC_IRQF
#define RTC_PF
#define RTC_AF
#define RTC_UF

/* feature list */
#define RTC_FEATURE_ALARM
#define RTC_FEATURE_ALARM_RES_MINUTE
#define RTC_FEATURE_NEED_WEEK_DAY
#define RTC_FEATURE_ALARM_RES_2S
#define RTC_FEATURE_UPDATE_INTERRUPT
#define RTC_FEATURE_CORRECTION
#define RTC_FEATURE_BACKUP_SWITCH_MODE
#define RTC_FEATURE_ALARM_WAKEUP_ONLY
#define RTC_FEATURE_CNT

/* parameter list */
#define RTC_PARAM_FEATURES
#define RTC_PARAM_CORRECTION
#define RTC_PARAM_BACKUP_SWITCH_MODE

#define RTC_BSM_DISABLED
#define RTC_BSM_DIRECT
#define RTC_BSM_LEVEL
#define RTC_BSM_STANDBY

#define RTC_MAX_FREQ


#endif /* _UAPI_LINUX_RTC_H_ */