coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
mt6691.c File Reference
#include <console/console.h>
#include <device/i2c_simple.h>
#include <soc/mt6691.h>
Include dependency graph for mt6691.c:

Go to the source code of this file.

Macros

#define MT6691_MIN_VOLTAGE   300000
 
#define MT6691_MAX_VOLTAGE   1300000
 
#define MT6691_STEP_UV   5000
 

Enumerations

enum  { MT6691_SLAVE_ADDR = 0x51 }
 

Functions

int mt6691_set_voltage (uint8_t i2c_num, unsigned int volt_uv)
 
int mt6691_get_voltage (uint8_t i2c_num)
 
static uint8_t get_mt6691_chip_id (uint8_t i2c_num)
 
void mt6691_probe (uint8_t i2c_num)
 

Macro Definition Documentation

◆ MT6691_MAX_VOLTAGE

#define MT6691_MAX_VOLTAGE   1300000

Definition at line 8 of file mt6691.c.

◆ MT6691_MIN_VOLTAGE

#define MT6691_MIN_VOLTAGE   300000

Definition at line 7 of file mt6691.c.

◆ MT6691_STEP_UV

#define MT6691_STEP_UV   5000

Definition at line 9 of file mt6691.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
MT6691_SLAVE_ADDR 

Definition at line 11 of file mt6691.c.

Function Documentation

◆ get_mt6691_chip_id()

static uint8_t get_mt6691_chip_id ( uint8_t  i2c_num)
static

Definition at line 51 of file mt6691.c.

References BIOS_ERR, i2c_read_field(), MT6691_MONITOR, MT6691_PGOOD_SHIFT, MT6691_SLAVE_ADDR, and printk.

Referenced by mt6691_probe().

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

◆ mt6691_get_voltage()

int mt6691_get_voltage ( uint8_t  i2c_num)

Definition at line 30 of file mt6691.c.

References BIOS_ERR, i2c_read_field(), MT6691_MAX_VOLTAGE, MT6691_MIN_VOLTAGE, MT6691_SLAVE_ADDR, MT6691_STEP_UV, MT6691_VSEL0, and printk.

Referenced by mainboard_get_regulator_vol().

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

◆ mt6691_probe()

void mt6691_probe ( uint8_t  i2c_num)

Definition at line 64 of file mt6691.c.

References BIOS_ERR, get_mt6691_chip_id(), i2c_write_field(), MT6691_CTRL2, MT6691_DN_SR_MASK, MT6691_DN_SR_SHIFT, MT6691_SLAVE_ADDR, and printk.

Here is the call graph for this function:

◆ mt6691_set_voltage()

int mt6691_set_voltage ( uint8_t  i2c_num,
unsigned int  volt_uv 
)

Definition at line 15 of file mt6691.c.

References BIOS_ERR, DIV_ROUND_UP, i2c_write_field(), MT6691_MAX_VOLTAGE, MT6691_MIN_VOLTAGE, MT6691_SLAVE_ADDR, MT6691_STEP_UV, MT6691_VSEL0, and printk.

Referenced by mainboard_set_regulator_vol().

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