summaryrefslogtreecommitdiff
path: root/src/ec/google/chromeec/ec.h
diff options
context:
space:
mode:
authorYidi Lin <yidi.lin@mediatek.com>2020-09-21 20:25:54 +0800
committerHung-Te Lin <hungte@chromium.org>2020-10-20 06:58:11 +0000
commit79a812e5366586eaacb36b09d592adfaace3dafc (patch)
treedb2c3a1ee2ebcb3d534755233962fa149aac7566 /src/ec/google/chromeec/ec.h
parent5611cfd55f6ad558a000a02e84e65af42316edd5 (diff)
downloadcoreboot-79a812e5366586eaacb36b09d592adfaace3dafc.tar.xz
ec/google/chromeec: Add wrappers to get/set the voltage
Add APIs to get and set the voltage for the target regulator. BUG=b:147789962 BRANCH=none TEST=emerge-asurada coreboot Change-Id: I0e56df45fc3309c387b9949534334eadefb616b2 Signed-off-by: Yidi Lin <yidi.lin@mediatek.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/46404 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Diffstat (limited to 'src/ec/google/chromeec/ec.h')
-rw-r--r--src/ec/google/chromeec/ec.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/ec/google/chromeec/ec.h b/src/ec/google/chromeec/ec.h
index ad3768c025..c2ceff831f 100644
--- a/src/ec/google/chromeec/ec.h
+++ b/src/ec/google/chromeec/ec.h
@@ -353,6 +353,24 @@ int google_chromeec_get_keybd_config(struct ec_response_keybd_config *keybd);
*/
int google_chromeec_ap_reset(void);
+/**
+ * Set voltage for the voltage regulator within the range specified.
+ * @param index Regulator ID
+ * @param min_mv Minimum voltage
+ * @param max_mv Maximum voltage
+ * @return 0 on success, -1 on error
+ */
+int google_chromeec_regulator_set_voltage(uint32_t index, uint32_t min_mv,
+ uint32_t max_mv);
+
+/**
+ * Get the currently configured voltage for the voltage regulator.
+ * @param index Regulator ID
+ * @param *voltage_mv If successful, voltage_mv is filled with current voltage
+ * @return 0 on success, -1 on error
+ */
+int google_chromeec_regulator_get_voltage(uint32_t index, uint32_t *voltage_mv);
+
#if CONFIG(HAVE_ACPI_TABLES)
/**
* Writes USB Type-C PD related information to the SSDT