diff options
author | Dino Li <Dino.Li@ite.com.tw> | 2021-06-29 22:05:56 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-07-06 03:40:11 +0000 |
commit | 9c219a90250c3899ea649164a18544d5d24577a3 (patch) | |
tree | ec7125f1c311d74dd9ccee59fcc53e040e7a8231 /baseboard/asurada/regulator.c | |
parent | 960267aa67c85e7b00a9ea9a6b58db2d018343ca (diff) | |
download | chrome-ec-9c219a90250c3899ea649164a18544d5d24577a3.tar.gz |
asurada: move regulator code into a separate file
With this CL, cros ec and zephyr are both able to build the code.
BUG=none
BRANCH=none
TEST=boot asurada and there is no error on regulator host commands
(0x12c~0x130)
Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
Change-Id: I2cc34891d5d1118ed90d976d404bab1f7b5ce5e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3004126
Reviewed-by: Ting Shen <phoenixshen@chromium.org>
Diffstat (limited to 'baseboard/asurada/regulator.c')
-rw-r--r-- | baseboard/asurada/regulator.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/baseboard/asurada/regulator.c b/baseboard/asurada/regulator.c new file mode 100644 index 0000000000..9809e2a607 --- /dev/null +++ b/baseboard/asurada/regulator.c @@ -0,0 +1,46 @@ +/* Copyright 2021 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#include "common.h" +#include "driver/bc12/mt6360.h" + +/* SD Card */ +int board_regulator_get_info(uint32_t index, char *name, + uint16_t *num_voltages, uint16_t *voltages_mv) +{ + enum mt6360_regulator_id id = index; + + return mt6360_regulator_get_info(id, name, num_voltages, + voltages_mv); +} + +int board_regulator_enable(uint32_t index, uint8_t enable) +{ + enum mt6360_regulator_id id = index; + + return mt6360_regulator_enable(id, enable); +} + +int board_regulator_is_enabled(uint32_t index, uint8_t *enabled) +{ + enum mt6360_regulator_id id = index; + + return mt6360_regulator_is_enabled(id, enabled); +} + +int board_regulator_set_voltage(uint32_t index, uint32_t min_mv, + uint32_t max_mv) +{ + enum mt6360_regulator_id id = index; + + return mt6360_regulator_set_voltage(id, min_mv, max_mv); +} + +int board_regulator_get_voltage(uint32_t index, uint32_t *voltage_mv) +{ + enum mt6360_regulator_id id = index; + + return mt6360_regulator_get_voltage(id, voltage_mv); +} |