summaryrefslogtreecommitdiff
path: root/board/asurada/board.c
diff options
context:
space:
mode:
authorEric Yilun Lin <yllin@chromium.org>2020-04-20 09:24:55 +0800
committerCommit Bot <commit-bot@chromium.org>2020-08-04 09:31:14 +0000
commit9a96e4e5c6685966210bbda4aed5f2848fd11d09 (patch)
tree5490f29cd3a4cbbfb973455a835e27b75e78978e /board/asurada/board.c
parent7403ebaee46fa96c47b5ff112f345fb06440c355 (diff)
downloadchrome-ec-9a96e4e5c6685966210bbda4aed5f2848fd11d09.tar.gz
asurada: Enable voltage regulator control.
Enable control of MT6360_LDO3 and MT6360_LDO5 from AP through host commands. BUG=b:149274957 TEST=make buildall TEST=boot asurada from SD card with chromium:2234683 BRANCH=none Change-Id: I23bcefd64b41c36dd62f172a54f56d98243ebb04 Signed-off-by: Pi-Hsun Shih <pihsun@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2100327 Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
Diffstat (limited to 'board/asurada/board.c')
-rw-r--r--board/asurada/board.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/board/asurada/board.c b/board/asurada/board.c
index 0d02a96f2d..1f38b84894 100644
--- a/board/asurada/board.c
+++ b/board/asurada/board.c
@@ -35,6 +35,7 @@
#include "power_button.h"
#include "pwm.h"
#include "pwm_chip.h"
+#include "regulator.h"
#include "spi.h"
#include "switch.h"
#include "tablet_mode.h"
@@ -566,8 +567,45 @@ void lid_angle_peripheral_enable(int enable)
}
#endif
-/* Sensor */
+/* SD Card */
+int board_regulator_get_info(uint32_t index, char *name,
+ uint16_t *num_voltages, uint16_t *voltages_mv)
+{
+ enum mt6360_ldo_id ldo_id = index;
+
+ return mt6360_ldo_get_info(ldo_id, name, num_voltages, voltages_mv);
+}
+
+int board_regulator_enable(uint32_t index, uint8_t enable)
+{
+ enum mt6360_ldo_id ldo_id = index;
+ return mt6360_ldo_enable(ldo_id, enable);
+}
+
+int board_regulator_is_enabled(uint32_t index, uint8_t *enabled)
+{
+ enum mt6360_ldo_id ldo_id = index;
+
+ return mt6360_ldo_is_enabled(ldo_id, enabled);
+}
+
+int board_regulator_set_voltage(uint32_t index, uint32_t min_mv,
+ uint32_t max_mv)
+{
+ enum mt6360_ldo_id ldo_id = index;
+
+ return mt6360_ldo_set_voltage(ldo_id, min_mv, max_mv);
+}
+
+int board_regulator_get_voltage(uint32_t index, uint32_t *voltage_mv)
+{
+ enum mt6360_ldo_id ldo_id = index;
+
+ return mt6360_ldo_get_voltage(ldo_id, voltage_mv);
+}
+
+/* Sensor */
static struct mutex g_base_mutex;
static struct mutex g_lid_mutex;