![]() |
coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <console/console.h>
#include <device/i2c_simple.h>
#include <soc/mt6360.h>
#include <stdbool.h>
Go to the source code of this file.
Macros | |
#define | CRC8_TABLE_SIZE 256 |
Variables | |
static struct mt6360_i2c_data | i2c_data [] |
static const uint32_t | mt6360_ldo1_vsel_table [0x10] |
static const uint32_t | mt6360_ldo3_vsel_table [0x10] |
static const uint32_t | mt6360_ldo5_vsel_table [0x10] |
static const struct mt6360_data | regulator_data [MT6360_REGULATOR_COUNT] |
static u8 | crc8_table [MT6360_INDEX_COUNT][CRC8_TABLE_SIZE] |
Definition at line 57 of file mt6360.c.
Referenced by mt6360_i2c_read_byte(), and mt6360_i2c_write_byte().
Definition at line 67 of file mt6360.c.
References CRC8_TABLE_SIZE.
Referenced by mt6360_init().
|
static |
Definition at line 175 of file mt6360.c.
References BIOS_ERR, MT6360_LDO1, MT6360_LDO2, MT6360_LDO3, MT6360_LDO5, and printk.
Referenced by mt6360_enable(), mt6360_get_voltage(), mt6360_is_enabled(), mt6360_ldo_enable(), mt6360_ldo_get_voltage(), mt6360_ldo_is_enabled(), mt6360_ldo_set_voltage(), and mt6360_set_voltage().
|
static |
Definition at line 186 of file mt6360.c.
References BIOS_ERR, MT6360_BUCK1, MT6360_BUCK2, MT6360_LDO6, MT6360_LDO7, and printk.
Referenced by mt6360_enable(), mt6360_get_voltage(), mt6360_is_enabled(), mt6360_pmic_enable(), mt6360_pmic_get_voltage(), mt6360_pmic_is_enabled(), mt6360_pmic_set_voltage(), and mt6360_set_voltage().
Definition at line 158 of file mt6360.c.
References BIOS_ERR, mask, mt6360_i2c_read_byte(), mt6360_i2c_write_byte(), printk, and val.
Referenced by mt6360_init(), mt6360_ldo_enable(), mt6360_ldo_set_voltage(), mt6360_pmic_enable(), and mt6360_pmic_set_voltage().
void mt6360_enable | ( | enum mt6360_regulator_id | id, |
uint8_t | enable | ||
) |
Definition at line 406 of file mt6360.c.
References is_valid_ldo(), is_valid_pmic(), mt6360_ldo_enable(), and mt6360_pmic_enable().
Referenced by mainboard_enable_regulator().
u32 mt6360_get_voltage | ( | enum mt6360_regulator_id | id | ) |
Definition at line 432 of file mt6360.c.
References is_valid_ldo(), is_valid_pmic(), mt6360_ldo_get_voltage(), and mt6360_pmic_get_voltage().
Referenced by mainboard_get_regulator_vol().
Definition at line 107 of file mt6360.c.
References mt6360_i2c_data::addr, BIOS_ERR, buf, mt6360_i2c_data::bus, crc8(), crc8_table, i2c_data, i2c_read_bytes(), and printk.
Referenced by mt6360_config_interface(), and mt6360_read_interface().
Definition at line 82 of file mt6360.c.
References mt6360_i2c_data::addr, BIOS_ERR, mt6360_i2c_data::bus, crc8(), crc8_table, i2c_data, i2c_write_raw(), and printk.
Referenced by mt6360_config_interface().
Definition at line 382 of file mt6360.c.
References BIOS_DEBUG, mt6360_i2c_data::bus, crc8_populate_msb(), crc8_table, i2c_data, mt6360_config_interface(), MT6360_INDEX_LDO, MT6360_INDEX_PMIC, mt6360_read_interface(), and printk.
Referenced by mtk_msdc_configure_sdcard(), and platform_romstage_main().
uint8_t mt6360_is_enabled | ( | enum mt6360_regulator_id | id | ) |
Definition at line 414 of file mt6360.c.
References is_valid_ldo(), is_valid_pmic(), mt6360_ldo_is_enabled(), and mt6360_pmic_is_enabled().
Referenced by mainboard_regulator_is_enabled().
|
static |
Definition at line 197 of file mt6360.c.
References mt6360_data::enable_mask, mt6360_data::enable_reg, is_valid_ldo(), mt6360_config_interface(), MT6360_INDEX_LDO, mt6360_read_interface(), regulator_data, and val.
Referenced by mt6360_enable().
|
static |
Definition at line 272 of file mt6360.c.
References BIOS_ERR, is_valid_ldo(), MIN, MT6360_INDEX_LDO, mt6360_read_interface(), printk, regulator_data, val, mt6360_data::vsel_reg, and mt6360_data::vsel_table.
Referenced by mt6360_get_voltage().
|
static |
Definition at line 218 of file mt6360.c.
References mt6360_data::enable_mask, mt6360_data::enable_reg, is_valid_ldo(), MT6360_INDEX_LDO, mt6360_read_interface(), regulator_data, and val.
Referenced by mt6360_is_enabled().
|
static |
Definition at line 234 of file mt6360.c.
References BIOS_ERR, is_valid_ldo(), MIN, mt6360_config_interface(), MT6360_INDEX_LDO, printk, regulator_data, val, mt6360_data::vsel_reg, mt6360_data::vsel_table, and mt6360_data::vsel_table_len.
Referenced by mt6360_set_voltage().
|
static |
Definition at line 299 of file mt6360.c.
References mt6360_data::enable_mask, mt6360_data::enable_reg, is_valid_pmic(), mt6360_config_interface(), MT6360_INDEX_PMIC, mt6360_read_interface(), regulator_data, and val.
Referenced by mt6360_enable().
|
static |
Definition at line 357 of file mt6360.c.
References is_valid_pmic(), MIN, MT6360_BUCK1, MT6360_BUCK2, MT6360_INDEX_PMIC, MT6360_LDO6, MT6360_LDO7, mt6360_read_interface(), regulator_data, val, and mt6360_data::vsel_reg.
Referenced by mt6360_get_voltage().
|
static |
Definition at line 320 of file mt6360.c.
References mt6360_data::enable_mask, mt6360_data::enable_reg, is_valid_pmic(), MT6360_INDEX_PMIC, mt6360_read_interface(), regulator_data, and val.
Referenced by mt6360_is_enabled().
|
static |
Definition at line 336 of file mt6360.c.
References is_valid_pmic(), MT6360_BUCK1, MT6360_BUCK2, mt6360_config_interface(), MT6360_INDEX_PMIC, MT6360_LDO6, MT6360_LDO7, regulator_data, val, and mt6360_data::vsel_reg.
Referenced by mt6360_set_voltage().
Definition at line 142 of file mt6360.c.
References BIOS_ERR, mask, mt6360_i2c_read_byte(), printk, and val.
Referenced by mt6360_init(), mt6360_ldo_enable(), mt6360_ldo_get_voltage(), mt6360_ldo_is_enabled(), mt6360_pmic_enable(), mt6360_pmic_get_voltage(), and mt6360_pmic_is_enabled().
void mt6360_set_voltage | ( | enum mt6360_regulator_id | id, |
u32 | voltage_uv | ||
) |
Definition at line 424 of file mt6360.c.
References is_valid_ldo(), is_valid_pmic(), mt6360_ldo_set_voltage(), and mt6360_pmic_set_voltage().
Referenced by mainboard_set_regulator_vol().
|
static |
Definition at line 55 of file mt6360.c.
Referenced by mt6360_i2c_read_byte(), mt6360_i2c_write_byte(), and mt6360_init().
|
static |
Definition at line 1 of file mt6360.c.
Referenced by mt6360_i2c_read_byte(), mt6360_i2c_write_byte(), and mt6360_init().
|
static |
|
static |
|
static |
|
static |
Definition at line 37 of file mt6360.c.
Referenced by mt6360_ldo_enable(), mt6360_ldo_get_voltage(), mt6360_ldo_is_enabled(), mt6360_ldo_set_voltage(), mt6360_pmic_enable(), mt6360_pmic_get_voltage(), mt6360_pmic_is_enabled(), and mt6360_pmic_set_voltage().