summaryrefslogtreecommitdiff
path: root/src/soc/mediatek/common
diff options
context:
space:
mode:
authorYidi Lin <yidi.lin@mediatek.com>2020-09-22 19:45:41 +0800
committerHung-Te Lin <hungte@chromium.org>2020-10-22 02:12:14 +0000
commitcbbdcb330d7885824623014e6e589a4eebe9d9d4 (patch)
treef1719453a128842146f6cb47d44e95b0ab4698f4 /src/soc/mediatek/common
parent3502960e50c5380af875c7d43e51040a8ed25623 (diff)
soc/mediatek/mt8192: Add board-specific regulator APIs
To enable DVFS, DRAM driver needs to access four different regulators that SoC can't access directly and need board-specific implementations. To support that we need to define the getter and setter APIs for those regulators. BUG=b:147789962 BRANCH=none TEST=verified with DRAM driver Signed-off-by: Yidi Lin <yidi.lin@mediatek.com> Change-Id: I0c2d471a7f8628735af90c5b5a5ab3012831e442 Reviewed-on: https://review.coreboot.org/c/coreboot/+/46405 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/mediatek/common')
-rw-r--r--src/soc/mediatek/common/include/soc/regulator.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/soc/mediatek/common/include/soc/regulator.h b/src/soc/mediatek/common/include/soc/regulator.h
new file mode 100644
index 0000000000..258d5503f1
--- /dev/null
+++ b/src/soc/mediatek/common/include/soc/regulator.h
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef SOC_MEDIATEK_COMMON_REGULATOR_H
+#define SOC_MEDIATEK_COMMON_REGULATOR_H
+
+#include <stdint.h>
+
+enum mtk_regulator {
+ MTK_REGULATOR_VDD1,
+ MTK_REGULATOR_VDD2,
+ MTK_REGULATOR_VDDQ,
+ MTK_REGULATOR_VMDDR,
+};
+
+void mainboard_set_regulator_vol(enum mtk_regulator regulator,
+ uint32_t voltage_uv);
+uint32_t mainboard_get_regulator_vol(enum mtk_regulator regulator);
+
+#endif /* SOC_MEDIATEK_COMMON_REGULATOR_H */