1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright 2013-2016 Freescale Semiconductor Inc.
4 * Copyright 2016-2018 NXP
10 /* Data Path Real Time Counter API
11 * Contains initialization APIs and runtime control APIs for RTC
19 #define DPRTC_MAX_IRQ_NUM 1
20 #define DPRTC_IRQ_INDEX 0
23 * Interrupt event masks:
27 * Interrupt event mask indicating alarm event had occurred
29 #define DPRTC_EVENT_ALARM 0x40000000
31 * Interrupt event mask indicating periodic pulse event had occurred
33 #define DPRTC_EVENT_PPS 0x08000000
35 int dprtc_open(struct fsl_mc_io *mc_io,
40 int dprtc_close(struct fsl_mc_io *mc_io,
45 * struct dprtc_cfg - Structure representing DPRTC configuration
46 * @options: place holder
52 int dprtc_create(struct fsl_mc_io *mc_io,
55 const struct dprtc_cfg *cfg,
58 int dprtc_destroy(struct fsl_mc_io *mc_io,
63 int dprtc_enable(struct fsl_mc_io *mc_io,
67 int dprtc_disable(struct fsl_mc_io *mc_io,
71 int dprtc_is_enabled(struct fsl_mc_io *mc_io,
76 int dprtc_reset(struct fsl_mc_io *mc_io,
80 int dprtc_set_clock_offset(struct fsl_mc_io *mc_io,
85 int dprtc_set_freq_compensation(struct fsl_mc_io *mc_io,
88 u32 freq_compensation);
90 int dprtc_get_freq_compensation(struct fsl_mc_io *mc_io,
93 u32 *freq_compensation);
95 int dprtc_get_time(struct fsl_mc_io *mc_io,
100 int dprtc_set_time(struct fsl_mc_io *mc_io,
105 int dprtc_set_alarm(struct fsl_mc_io *mc_io,
110 int dprtc_set_irq_enable(struct fsl_mc_io *mc_io,
116 int dprtc_get_irq_enable(struct fsl_mc_io *mc_io,
122 int dprtc_set_irq_mask(struct fsl_mc_io *mc_io,
128 int dprtc_get_irq_mask(struct fsl_mc_io *mc_io,
134 int dprtc_get_irq_status(struct fsl_mc_io *mc_io,
140 int dprtc_clear_irq_status(struct fsl_mc_io *mc_io,
147 * struct dprtc_attr - Structure representing DPRTC attributes
148 * @id: DPRTC object ID
154 int dprtc_get_attributes(struct fsl_mc_io *mc_io,
157 struct dprtc_attr *attr);
159 int dprtc_get_api_version(struct fsl_mc_io *mc_io,
164 #endif /* __FSL_DPRTC_H */