6 #include <soc/mt6360.h>
10 #define MT6691_I2C_NUM 7
48 "[%d] MT6880 is not controlled by SW.\n", regulator);
64 if (
CONFIG(BOARD_GOOGLE_CHERRY)) {
67 uint32_t voltage_mv = voltage_uv / 1000;
71 "Failed to set voltage by ec: %d\n", regulator);
101 if (
CONFIG(BOARD_GOOGLE_CHERRY)) {
107 "Failed to get voltage by ec: %d\n", regulator);
110 return voltage_mv * 1000;
140 if (
CONFIG(BOARD_GOOGLE_CHERRY)) {
146 "Failed to enable regulator by ec: %d\n", regulator);
167 if (
CONFIG(BOARD_GOOGLE_CHERRY)) {
173 "Failed to retrieve is_enabled by ec; assuming disabled\n");
181 printk(
BIOS_ERR,
"Invalid regulator ID: %d\n; assuming disabled", regulator);
void mainboard_set_regulator_vol(enum mtk_regulator regulator, uint32_t voltage_uv)
uint32_t mainboard_get_regulator_vol(enum mtk_regulator regulator)
int mainboard_enable_regulator(enum mtk_regulator regulator, uint8_t enable)
uint8_t mainboard_regulator_is_enabled(enum mtk_regulator regulator)
static int get_mt6359p_regulator_id(enum mtk_regulator regulator)
static int get_mt6360_regulator_id(enum mtk_regulator regulator)
static int check_regulator_control(enum mtk_regulator regulator)
static int get_mt6691_regulator_id(enum mtk_regulator regulator)
#define printk(level,...)
int google_chromeec_regulator_is_enabled(uint32_t index, uint8_t *enabled)
Query if the regulator is enabled.
int google_chromeec_regulator_set_voltage(uint32_t index, uint32_t min_mv, uint32_t max_mv)
Set voltage for the voltage regulator within the range specified.
int google_chromeec_regulator_enable(uint32_t index, uint8_t enable)
Configure the regulator as enabled / disabled.
int google_chromeec_regulator_get_voltage(uint32_t index, uint32_t *voltage_mv)
Get the currently configured voltage for the voltage regulator.
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
#define BIOS_WARNING
BIOS_WARNING - Bad configuration.
u32 mt6359p_buck_get_voltage(u32 buck_id)
void mt6359p_buck_set_voltage(u32 buck_id, u32 buck_uv)
int mt6691_get_voltage(uint8_t i2c_num)
int mt6691_set_voltage(uint8_t i2c_num, unsigned int volt_uv)
u32 mt6360_get_voltage(enum mt6360_regulator_id id)
uint8_t mt6360_is_enabled(enum mt6360_regulator_id id)
void mt6360_set_voltage(enum mt6360_regulator_id id, u32 voltage_uv)
void mt6360_enable(enum mt6360_regulator_id id, uint8_t enable)