coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
mt6360.h File Reference
#include <stdint.h>
Include dependency graph for mt6360.h:

Go to the source code of this file.

Data Structures

struct  mt6360_i2c_data
 
struct  mt6360_data
 

Macros

#define MT6360_LDO_I2C_ADDR   0x64
 
#define MT6360_PMIC_I2C_ADDR   0x1a
 
#define MT6360_DATA(_enreg, _enmask, _vreg, _vmask, _table)
 

Enumerations

enum  { MT6360_INDEX_LDO = 0 , MT6360_INDEX_PMIC , MT6360_INDEX_COUNT }
 
enum  mt6360_regulator_id {
  MT6360_LDO3 = 0 , MT6360_LDO5 , MT6360_LDO6 , MT6360_LDO7 ,
  MT6360_BUCK1 , MT6360_BUCK2 , MT6360_REGULATOR_COUNT , MT6360_LDO3 = 0 ,
  MT6360_LDO5 , MT6360_LDO6 , MT6360_LDO7 , MT6360_BUCK1 ,
  MT6360_BUCK2 , MT6360_LDO1 , MT6360_LDO2 , MT6360_REGULATOR_COUNT
}
 

Functions

void mt6360_init (uint8_t bus)
 
void mt6360_enable (enum mt6360_regulator_id id, uint8_t enable)
 
uint8_t mt6360_is_enabled (enum mt6360_regulator_id id)
 
void mt6360_set_voltage (enum mt6360_regulator_id id, u32 voltage_uv)
 
u32 mt6360_get_voltage (enum mt6360_regulator_id id)
 

Macro Definition Documentation

◆ MT6360_DATA

#define MT6360_DATA (   _enreg,
  _enmask,
  _vreg,
  _vmask,
  _table 
)
Value:
{ \
.enable_reg = _enreg, \
.enable_mask = _enmask, \
.vsel_reg = _vreg, \
.vsel_mask = _vmask, \
.vsel_table = _table, \
.vsel_table_len = ARRAY_SIZE(_table), \
}
#define ARRAY_SIZE(a)
Definition: helpers.h:12

Definition at line 11 of file mt6360.h.

◆ MT6360_LDO_I2C_ADDR

#define MT6360_LDO_I2C_ADDR   0x64

Definition at line 8 of file mt6360.h.

◆ MT6360_PMIC_I2C_ADDR

#define MT6360_PMIC_I2C_ADDR   0x1a

Definition at line 9 of file mt6360.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
MT6360_INDEX_LDO 
MT6360_INDEX_PMIC 
MT6360_INDEX_COUNT 

Definition at line 21 of file mt6360.h.

◆ mt6360_regulator_id

Enumerator
MT6360_LDO3 
MT6360_LDO5 
MT6360_LDO6 
MT6360_LDO7 
MT6360_BUCK1 
MT6360_BUCK2 
MT6360_REGULATOR_COUNT 
MT6360_LDO3 
MT6360_LDO5 
MT6360_LDO6 
MT6360_LDO7 
MT6360_BUCK1 
MT6360_BUCK2 
MT6360_LDO1 
MT6360_LDO2 
MT6360_REGULATOR_COUNT 

Definition at line 31 of file mt6360.h.

Function Documentation

◆ mt6360_enable()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mt6360_get_voltage()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mt6360_init()

void mt6360_init ( uint8_t  bus)

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mt6360_is_enabled()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mt6360_set_voltage()

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().

Here is the call graph for this function:
Here is the caller graph for this function: