aboutsummaryrefslogtreecommitdiff
path: root/src/ec/google/chromeec/ec.h
diff options
context:
space:
mode:
authorYidi Lin <yidi.lin@mediatek.com>2020-10-23 16:02:59 +0800
committerHung-Te Lin <hungte@chromium.org>2020-11-18 06:13:12 +0000
commit99e6dd9f74c4d35189b078eda756575e642ca2c7 (patch)
tree8c7d25ec12687a3ec5d661c7e0eda307a3b56026 /src/ec/google/chromeec/ec.h
parent9ee02095fa1b5c532f758e287401423138687b56 (diff)
ec/google/chromeec: Add more wrappers for regulator control
google_chromeec_regulator_enable is for enabling/disabling the regulator. google_chromeec_regulator_is_enabled is for querying if the regulator is enabled. BUG=b:168863056,b:147789962 BRANCH=none TEST=emerge-asurada coreboot Signed-off-by: Yidi Lin <yidi.lin@mediatek.com> Change-Id: Ia804242042b0026af19025a0c4a74b3ab8475dab Reviewed-on: https://review.coreboot.org/c/coreboot/+/46686 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.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/ec/google/chromeec/ec.h b/src/ec/google/chromeec/ec.h
index bed8594a8b..c3c456ff14 100644
--- a/src/ec/google/chromeec/ec.h
+++ b/src/ec/google/chromeec/ec.h
@@ -354,7 +354,26 @@ int google_chromeec_get_keybd_config(struct ec_response_keybd_config *keybd);
int google_chromeec_ap_reset(void);
/**
+ * Configure the regulator as enabled / disabled.
+ *
+ * @param index Regulator ID
+ * @param enable Set to enable / disable the regulator
+ * @return 0 on success, -1 on error
+ */
+int google_chromeec_regulator_enable(uint32_t index, uint8_t enable);
+
+/**
+ * Query if the regulator is enabled.
+ *
+ * @param index Regulator ID
+ * @param *enabled If successful, enabled indicates enable/disable status.
+ * @return 0 on success, -1 on error
+ */
+int google_chromeec_regulator_is_enabled(uint32_t index, uint8_t *enabled);
+
+/**
* Set voltage for the voltage regulator within the range specified.
+ *
* @param index Regulator ID
* @param min_mv Minimum voltage
* @param max_mv Maximum voltage
@@ -365,6 +384,7 @@ int google_chromeec_regulator_set_voltage(uint32_t index, uint32_t min_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