12 #if CONFIG_PMIC_BUS < 0
13 #error "PMIC_BUS must be set in mainboard's Kconfig."
16 #define RK808_ADDR 0x1b
22 #define LDO_ONSEL(i) (0x39 + 2 * i)
23 #define LDO_SLPSEL(i) (0x3a + 2 * i)
25 #define RTC_SECOND 0x00
26 #define RTC_MINUTE 0x01
29 #define RTC_MONTH 0x04
31 #define RTC_WEEKS 0x06
33 #define RTC_STATUS 0x11
35 #define RTC_CTRL_STOP_RTC (1 << 0)
36 #define RTC_CTRL_GET_TIME (1 << 6)
37 #define RTC_CTRL_RTC_READSEL (1 << 7)
39 #define DCDC_UV_ACT 0x28
40 #define DCDC_ILMAX 0x90
62 assert(sw == 1 || sw == 2);
91 die(
"Unknown LDO index!");
109 buck_reg =
BUCK1SEL + 4 * (buck - 1);
117 die(
"Unknown buck index!");
#define assert(statement)
static uint8_t bin2bcd(uint8_t val)
static uint8_t bcd2bin(uint8_t val)
#define DIV_ROUND_UP(x, y)
#define printk(level,...)
void __noreturn die(const char *fmt,...)
static int i2c_writeb(unsigned int bus, uint8_t slave, uint8_t reg, uint8_t data)
Write a byte with one segment in one frame.
static int i2c_readb(unsigned int bus, uint8_t slave, uint8_t reg, uint8_t *data)
Read a byte with two segments in one frame.
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
#define RTC_CTRL_STOP_RTC
void rk808_configure_switch(int sw, int enabled)
#define RTC_CTRL_RTC_READSEL
static void rk808rtc_stop(void)
static int rk808_write(uint8_t reg, uint8_t value)
int rtc_set(const struct rtc_time *time)
static int rk808_read(uint8_t reg, uint8_t *value)
#define RTC_CTRL_GET_TIME
static void rk808_clrsetbits(uint8_t reg, uint8_t clr, uint8_t set)
int rtc_get(struct rtc_time *time)
void rk808_configure_buck(int buck, int millivolts)
static void rk808rtc_start(void)
void rk808_configure_ldo(int ldo, int millivolts)