diff options
Diffstat (limited to 'src/soc/rockchip/rk3288/rk808.c')
-rw-r--r-- | src/soc/rockchip/rk3288/rk808.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/soc/rockchip/rk3288/rk808.c b/src/soc/rockchip/rk3288/rk808.c index 0d629ca041..50df96d591 100644 --- a/src/soc/rockchip/rk3288/rk808.c +++ b/src/soc/rockchip/rk3288/rk808.c @@ -26,6 +26,7 @@ #define RK808_ADDR 0x1b +#define DCDC_EN 0x23 #define LDO_EN 0x24 #define LDO_ONSEL(i) (0x39 + 2 * i) #define LDO_SLPSEL(i) (0x3a + 2 * i) @@ -39,6 +40,12 @@ static void rk808_clrsetbits(uint8_t bus, uint8_t reg, uint8_t clr, uint8_t set) printk(BIOS_ERR, "ERROR: Cannot set Rk808[%#x]!\n", reg); } +void rk808_configure_switch(uint8_t bus, int sw, int enabled) +{ + assert(sw == 1 || sw == 2); + rk808_clrsetbits(bus, DCDC_EN, 1 << (sw + 4), !!enabled << (sw + 4)); +} + void rk808_configure_ldo(uint8_t bus, int ldo, int millivolts) { uint8_t vsel; |