summaryrefslogtreecommitdiff
path: root/baseboard
diff options
context:
space:
mode:
authorDino Li <Dino.Li@ite.com.tw>2021-06-29 22:05:56 +0800
committerCommit Bot <commit-bot@chromium.org>2021-07-06 03:40:11 +0000
commit9c219a90250c3899ea649164a18544d5d24577a3 (patch)
treeec7125f1c311d74dd9ccee59fcc53e040e7a8231 /baseboard
parent960267aa67c85e7b00a9ea9a6b58db2d018343ca (diff)
downloadchrome-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')
-rw-r--r--baseboard/asurada/baseboard.c39
-rw-r--r--baseboard/asurada/build.mk1
-rw-r--r--baseboard/asurada/regulator.c46
3 files changed, 47 insertions, 39 deletions
diff --git a/baseboard/asurada/baseboard.c b/baseboard/asurada/baseboard.c
index 65a2327f55..8780297939 100644
--- a/baseboard/asurada/baseboard.c
+++ b/baseboard/asurada/baseboard.c
@@ -124,45 +124,6 @@ const struct cc_para_t *board_get_cc_tuning_parameter(enum usbpd_port port)
return &cc_parameter[port];
}
-/* 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);
-}
-
/* Lid */
#ifndef TEST_BUILD
/* This callback disables keyboard when convertibles are fully open */
diff --git a/baseboard/asurada/build.mk b/baseboard/asurada/build.mk
index 77c49c7e67..5fed63924b 100644
--- a/baseboard/asurada/build.mk
+++ b/baseboard/asurada/build.mk
@@ -9,5 +9,6 @@
baseboard-y=baseboard.o
baseboard-y+=board_chipset.o
baseboard-y+=board_id.o
+baseboard-y+=regulator.o
baseboard-y+=usbc_config.o
baseboard-$(CONFIG_USB_POWER_DELIVERY)+=usb_pd_policy.o
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);
+}