1 /* SPDX-License-Identifier: GPL-2.0 */ << 2 #ifndef __LINUX_SPI_DS1305_H 1 #ifndef __LINUX_SPI_DS1305_H 3 #define __LINUX_SPI_DS1305_H 2 #define __LINUX_SPI_DS1305_H 4 3 5 /* 4 /* 6 * One-time configuration for ds1305 and ds130 5 * One-time configuration for ds1305 and ds1306 RTC chips. 7 * 6 * 8 * Put a pointer to this in spi_board_info.pla 7 * Put a pointer to this in spi_board_info.platform_data if you want to 9 * be sure that Linux (re)initializes this as 8 * be sure that Linux (re)initializes this as needed ... after losing 10 * backup power, and potentially on the first 9 * backup power, and potentially on the first boot. 11 */ 10 */ 12 struct ds1305_platform_data { 11 struct ds1305_platform_data { 13 12 14 /* Trickle charge configuration: it's 13 /* Trickle charge configuration: it's OK to leave out the MAGIC 15 * bitmask; mask in either DS1 or DS2, 14 * bitmask; mask in either DS1 or DS2, and then one of 2K/4k/8K. 16 */ 15 */ 17 #define DS1305_TRICKLE_MAGIC 0xa0 16 #define DS1305_TRICKLE_MAGIC 0xa0 18 #define DS1305_TRICKLE_DS2 0x08 /* two 17 #define DS1305_TRICKLE_DS2 0x08 /* two diodes */ 19 #define DS1305_TRICKLE_DS1 0x04 /* one 18 #define DS1305_TRICKLE_DS1 0x04 /* one diode */ 20 #define DS1305_TRICKLE_2K 0x01 /* 2 K 19 #define DS1305_TRICKLE_2K 0x01 /* 2 KOhm resistance */ 21 #define DS1305_TRICKLE_4K 0x02 /* 4 K 20 #define DS1305_TRICKLE_4K 0x02 /* 4 KOhm resistance */ 22 #define DS1305_TRICKLE_8K 0x03 /* 8 K 21 #define DS1305_TRICKLE_8K 0x03 /* 8 KOhm resistance */ 23 u8 trickle; 22 u8 trickle; 24 23 25 /* set only on ds1306 parts */ 24 /* set only on ds1306 parts */ 26 bool is_ds1306; 25 bool is_ds1306; 27 26 28 /* ds1306 only: enable 1 Hz output */ 27 /* ds1306 only: enable 1 Hz output */ 29 bool en_1hz; 28 bool en_1hz; 30 29 31 /* REVISIT: the driver currently expe 30 /* REVISIT: the driver currently expects nINT0 to be wired 32 * as the alarm IRQ. ALM1 may also ne 31 * as the alarm IRQ. ALM1 may also need to be set up ... 33 */ 32 */ 34 }; 33 }; 35 34 36 #endif /* __LINUX_SPI_DS1305_H */ 35 #endif /* __LINUX_SPI_DS1305_H */ 37 36
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.