summaryrefslogtreecommitdiff
path: root/src/soc
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc')
-rw-r--r--src/soc/rockchip/rk3288/rk808.c7
-rw-r--r--src/soc/rockchip/rk3288/rk808.h1
2 files changed, 8 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;
diff --git a/src/soc/rockchip/rk3288/rk808.h b/src/soc/rockchip/rk3288/rk808.h
index a6ba67c538..00520751b5 100644
--- a/src/soc/rockchip/rk3288/rk808.h
+++ b/src/soc/rockchip/rk3288/rk808.h
@@ -20,6 +20,7 @@
#ifndef __SOC_ROCKCHIP_RK3288_PMIC_H__
#define __SOC_ROCKCHIP_RK3288_PMIC_H__
+void rk808_configure_switch(uint8_t bus, int sw, int enabled);
void rk808_configure_ldo(uint8_t bus, int ldo, int millivolts);
#endif