1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #ifndef __DRIVERS_I2C_RV3028C7_CHIP_H__
4 #define __DRIVERS_I2C_RV3028C7_CHIP_H__
9 * The RTC has three different modes in how the backup voltage is used:
10 * - OFF: Backup voltage not used
11 * - DIRECT: Switch to backup voltage if it is higher than VDD
12 * - LEVEL: Switch to backup voltage if VDD is < 2 V and VBACKUP > 2 V
21 * The RTC can be used to charge a capacitor on VBACKUP.
22 * There are the following modes:
23 * - OFF: Do not charge the backup capacitor via VDD
24 * - VIA_3K: Connect the backup capacitor via 3 k resistor with VDD
25 * - VIA_5K: Connect the backup capacitor via 5 k resistor with VDD
26 * - VIA_9K: Connect the backup capacitor via 9 k resistor with VDD
27 * - VIA_15K: Connect the backup capacitor via 15 k resistor with VDD
37 struct drivers_i2c_rv3028c7_config
{
38 unsigned int bus_speed
; /* Bus clock in Hz */
39 unsigned char user_weekday
; /* User day of the week to set */
40 unsigned char user_day
; /* User day to set */
41 unsigned char user_month
; /* User month to set */
42 unsigned char user_year
; /* User year to set (2-digit) */
43 unsigned char set_user_date
; /* Use user date from devicetree */
44 enum sw_mode bckup_sw_mode
; /* Mode for switching between VDD and VBACKUP */
45 enum charge_mode cap_charge
; /* Mode for capacitor charging */
48 #endif /* __DRIVERS_I2C_RV3028C7_CHIP_H__ */