Lines Matching +full:interrupts +full:- +full:extended
3 * DS1685/DS1687-series RTC chips.
7 * include larger, battery-backed NV-SRAM, burst-mode access, and an RTC
10 * Copyright (C) 2011-2014 Joshua Kinard <kumba@gentoo.org>.
11 * Copyright (C) 2009 Matthias Fuchs <matthias.fuchs@esd-electronics.com>.
14 * DS1685/DS1687 3V/5V Real-Time Clocks, 19-5215, Rev 4/10.
15 * DS17x85/DS17x87 3V/5V Real-Time Clocks, 19-5222, Rev 4/10.
16 * DS1689/DS1693 3V/5V Serialized Real-Time Clocks, Rev 112105.
17 * Application Note 90, Using the Multiplex Bus RTC Extended Features.
32 * struct ds1685_priv - DS1685 private data structure.
41 * @prepare_poweroff: pointer to platform pre-poweroff function.
43 * @post_ram_clear: pointer to platform post ram-clear function.
67 * struct ds1685_rtc_platform_data - platform data structure.
68 * @plat_prepare_poweroff: platform-specific pre-poweroff function.
69 * @plat_wake_alarm: platform-specific wake alarm function.
70 * @plat_post_ram_clear: platform-specific post ram-clear function.
73 * registers, or uses one or more of the extended interrupts and needs special
94 #define RTC_SECS 0x00 /* Seconds 00-59 */
95 #define RTC_SECS_ALARM 0x01 /* Alarm Seconds 00-59 */
96 #define RTC_MINS 0x02 /* Minutes 00-59 */
97 #define RTC_MINS_ALARM 0x03 /* Alarm Minutes 00-59 */
98 #define RTC_HRS 0x04 /* Hours 01-12 AM/PM || 00-23 */
99 #define RTC_HRS_ALARM 0x05 /* Alarm Hours 01-12 AM/PM || 00-23 */
100 #define RTC_WDAY 0x06 /* Day of Week 01-07 */
101 #define RTC_MDAY 0x07 /* Day of Month 01-31 */
102 #define RTC_MONTH 0x08 /* Month 01-12 */
103 #define RTC_YEAR 0x09 /* Year 00-99 */
104 #define RTC_CENTURY 0x48 /* Century 00-99 */
105 #define RTC_MDAY_ALARM 0x49 /* Alarm Day of Month 01-31 */
111 #define RTC_SECS_BCD_MASK 0x7f /* - x x x x x x x */
112 #define RTC_MINS_BCD_MASK 0x7f /* - x x x x x x x */
113 #define RTC_HRS_12_BCD_MASK 0x1f /* - - - x x x x x */
114 #define RTC_HRS_24_BCD_MASK 0x3f /* - - x x x x x x */
115 #define RTC_MDAY_BCD_MASK 0x3f /* - - x x x x x x */
116 #define RTC_MONTH_BCD_MASK 0x1f /* - - - x x x x x */
122 #define RTC_SECS_BIN_MASK 0x3f /* - - x x x x x x */
123 #define RTC_MINS_BIN_MASK 0x3f /* - - x x x x x x */
124 #define RTC_HRS_12_BIN_MASK 0x0f /* - - - - x x x x */
125 #define RTC_HRS_24_BIN_MASK 0x1f /* - - - x x x x x */
126 #define RTC_MDAY_BIN_MASK 0x1f /* - - - x x x x x */
127 #define RTC_MONTH_BIN_MASK 0x0f /* - - - - x x x x */
128 #define RTC_YEAR_BIN_MASK 0x7f /* - x x x x x x x */
133 #define RTC_WDAY_MASK 0x07 /* - - - - - x x x */
147 #define RTC_EXT_CTRL_4A 0x4a /* Extended Control Register 4A */
148 #define RTC_EXT_CTRL_4B 0x4b /* Extended Control Register 4B */
158 #define RTC_CTRL_A_RS2 BIT(2) /* Rate-Selection Bit 2 */
159 #define RTC_CTRL_A_RS3 BIT(3) /* Rate-Selection Bit 3 */
160 #define RTC_CTRL_A_RS1 BIT(1) /* Rate-Selection Bit 1 */
161 #define RTC_CTRL_A_RS0 BIT(0) /* Rate-Selection Bit 0 */
168 #define RTC_CTRL_B_PIE BIT(6) /* Periodic-Interrupt Enable */
169 #define RTC_CTRL_B_AIE BIT(5) /* Alarm-Interrupt Enable */
170 #define RTC_CTRL_B_UIE BIT(4) /* Update-Ended Interrupt-Enable */
171 #define RTC_CTRL_B_SQWE BIT(3) /* Square-Wave Enable */
173 #define RTC_CTRL_B_2412 BIT(1) /* 12-Hr/24-Hr Mode */
184 #define RTC_CTRL_C_IRQF BIT(7) /* Interrupt-Request Flag */
185 #define RTC_CTRL_C_PF BIT(6) /* Periodic-Interrupt Flag */
186 #define RTC_CTRL_C_AF BIT(5) /* Alarm-Interrupt Flag */
187 #define RTC_CTRL_C_UF BIT(4) /* Update-Ended Interrupt Flag */
201 * Bit names in Extended Control Register 4A.
207 * On the DS17x85/DS17x87, BIT(5) is Burst-Mode Enable (BME), and allows
208 * access to the extended NV-SRAM by automatically incrementing the address
212 #define RTC_CTRL_4A_INCR BIT(6) /* Increment-in-Progress Status */
213 #define RTC_CTRL_4A_PAB BIT(3) /* Power-Active Bar Control */
214 #define RTC_CTRL_4A_RF BIT(2) /* RAM-Clear Flag */
215 #define RTC_CTRL_4A_WF BIT(1) /* Wake-Up Alarm Flag */
218 #define RTC_CTRL_4A_BME BIT(5) /* Burst-Mode Enable */
224 * Bit names in Extended Control Register 4B.
229 #define RTC_CTRL_4B_RCE BIT(4) /* RAM Clear-Enable */
230 #define RTC_CTRL_4B_PRS BIT(3) /* PAB Reset-Select */
231 #define RTC_CTRL_4B_RIE BIT(2) /* RAM Clear-Interrupt Enable */
232 #define RTC_CTRL_4B_WIE BIT(1) /* Wake-Up Alarm-Interrupt Enable */
233 #define RTC_CTRL_4B_KSE BIT(0) /* Kickstart Interrupt-Enable */
241 * to become available, including Extended Control Registers 4A & 4B.
251 #define RTC_BANK1_RAM_DATA_PORT 0x53 /* Extended RAM Data Port */
255 * Model-specific registers in Bank 1.
261 * DS1685/DS1687 - Extended NV-SRAM address (LSB only).
262 * DS1689/DS1693 - Vcc, Vbat, Pwr Cycle Counters & Customer-specific S/N.
263 * DS17x85/DS17x87 - Extended NV-SRAM addresses (MSB & LSB) & Write counter.
266 #define RTC_BANK1_RAM_ADDR 0x50 /* NV-SRAM Addr */
274 #define RTC_BANK1_UNIQ_SN 0x60 /* Customer-specific S/N */
276 #define RTC_BANK1_RAM_ADDR_LSB 0x50 /* NV-SRAM Addr (LSB) */
277 #define RTC_BANK1_RAM_ADDR_MSB 0x51 /* NV-SRAM Addr (MSB) */
297 * Periodic Interrupt Rates / Square-Wave Output Frequency
299 * Periodic rates are selected by setting the RS3-RS0 bits in Control
300 * Register A and enabled via either the E32K bit in Extended Control
303 * E32K overrides the settings of RS3-RS0 and outputs a frequency of 32768Hz
305 * the 1-of-16 decoder is only able to divide the base 32768Hz signal into 13
309 * When E32K is set to a logic 1, periodic interrupts are disabled and reading
310 * /dev/rtc will return -EINVAL. This also applies if the periodic interrupt
313 * Not currently used by the rtc-ds1685 driver because the RTC core removed
314 * support for hardware-generated periodic-interrupts in favour of
315 * hrtimer-generated interrupts. But these defines are kept around for use
317 * hardware-generated periodic interrupts are ever added back.
334 #define RTC_SQW_32768HZ 32768 /* 1 - - - - */
340 * - 50 bytes of NVRAM are available just past the clock registers.
341 * - 64 additional bytes are available in Bank0.
343 * Extended, battery-backed NV-SRAM:
344 * - DS1685/DS1687 - 128 bytes.
345 * - DS1689/DS1693 - 0 bytes.
346 * - DS17285/DS17287 - 2048 bytes.
347 * - DS17485/DS17487 - 4096 bytes.
348 * - DS17885/DS17887 - 8192 bytes.