summaryrefslogtreecommitdiff
path: root/src/mainboard/google/cherry
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard/google/cherry')
-rw-r--r--src/mainboard/google/cherry/regulator.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mainboard/google/cherry/regulator.c b/src/mainboard/google/cherry/regulator.c
index 12de049e98..61f53d1eaf 100644
--- a/src/mainboard/google/cherry/regulator.c
+++ b/src/mainboard/google/cherry/regulator.c
@@ -123,7 +123,7 @@ uint32_t mainboard_get_regulator_voltage(enum mtk_regulator regulator)
return 0;
}
-int mainboard_enable_regulator(enum mtk_regulator regulator, uint8_t enable)
+int mainboard_enable_regulator(enum mtk_regulator regulator, bool enable)
{
if (check_regulator_control(regulator) < 0)
return 0;
@@ -154,17 +154,17 @@ int mainboard_enable_regulator(enum mtk_regulator regulator, uint8_t enable)
return -1;
}
-uint8_t mainboard_regulator_is_enabled(enum mtk_regulator regulator)
+bool mainboard_regulator_is_enabled(enum mtk_regulator regulator)
{
if (check_regulator_control(regulator) < 0)
- return 0;
+ return false;
int id;
id = get_mt6360_regulator_id(regulator);
if (id >= 0) {
if (CONFIG(BOARD_GOOGLE_CHERRY)) {
- return mt6360_is_enabled(id);
+ return !!mt6360_is_enabled(id);
} else {
uint8_t enabled;
if (google_chromeec_regulator_is_enabled(id, &enabled) < 0) {
@@ -172,12 +172,12 @@ uint8_t mainboard_regulator_is_enabled(enum mtk_regulator regulator)
"Failed to retrieve is_enabled by ec; assuming disabled\n");
return 0;
}
- return enabled;
+ return !!enabled;
}
}
printk(BIOS_ERR, "Invalid regulator ID: %d\n; assuming disabled", regulator);
- return 0;
+ return false;
}