coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
da9212.h File Reference
#include <stdint.h>
Include dependency graph for da9212.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  {
  DA9212_REG_PAGE_CON = 0x0 , DA9212_REG_BUCKA_CONT = 0x5D , DA9212_REG_BUCKB_CONT = 0x5E , DA9212_REG_BUCKA_CONF = 0xD1 ,
  DA9212_REG_BUCKB_CONF = 0xD2
}
 
enum  { DA9212_REG_PAGE_SHIFT = 0 , DA9212_REG_PAGE_MASK = 0xf }
 
enum  {
  DA9212_REG_PAGE0 = 0 , DA9212_REG_PAGE2 = 2 , DA9212_REG_PAGE4 = 4 , DA9212_PAGE_WRITE_MODE = 0x0 ,
  DA9212_REPEAT_WRITE_MODE = 0x40 , DA9212_PAGE_REVERT = 0x80
}
 
enum  {
  DA9212_BUCK_EN_SHIFT = 0 , DA9212_BUCK_OFF = 0x0 , DA9212_BUCK_ON = 0x1 , DA9212_BUCK_GPI_SHIFT = 1 ,
  DA9212_BUCK_GPI_MASK = 0x3 , DA9212_BUCK_GPI_OFF = 0x0 , DA9212_BUCK_GPI_GPIO0 = 0x1 , DA9212_BUCK_GPI_GPIO1 = 0x2 ,
  DA9212_BUCK_GPI_GPIO4 = 0x3 , DA9212_VBUCK_SEL_SHIFT = 4 , DA9212_VBUCK_SEL_MASK = 0x1 , DA9212_VBUCK_SEL_A = 0x0 ,
  DA9212_VBUCK_SEL_B = 0x1
}
 
enum  {
  DA9212_BUCK_MODE_SHIFT = 0 , DA9212_BUCK_MODE_MASK = 0x3 , DA9212_BUCK_MODE_MANUAL = 0x0 , DA9212_BUCK_MODE_PFM = 0x1 ,
  DA9212_BUCK_MODE_PWM = 0x2 , DA9212_BUCK_MODE_AUTO = 0x3
}
 
enum  {
  DA9212_REG_DEVICE_ID = 0x1 , DA9212_ID = 0x22 , DA9213_ID = 0x23 , DA9212_REG_VARIANT_ID = 0x2 ,
  DA9212_VARIANT_ID_AB = 0x10 , DA9212_VARIANT_ID_AC = 0x20
}
 

Functions

void da9212_probe (uint8_t i2c_num)
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
DA9212_REG_PAGE_CON 
DA9212_REG_BUCKA_CONT 
DA9212_REG_BUCKB_CONT 
DA9212_REG_BUCKA_CONF 
DA9212_REG_BUCKB_CONF 

Definition at line 10 of file da9212.h.

◆ anonymous enum

anonymous enum
Enumerator
DA9212_REG_PAGE_SHIFT 
DA9212_REG_PAGE_MASK 

Definition at line 22 of file da9212.h.

◆ anonymous enum

anonymous enum
Enumerator
DA9212_REG_PAGE0 
DA9212_REG_PAGE2 
DA9212_REG_PAGE4 
DA9212_PAGE_WRITE_MODE 
DA9212_REPEAT_WRITE_MODE 
DA9212_PAGE_REVERT 

Definition at line 27 of file da9212.h.

◆ anonymous enum

anonymous enum
Enumerator
DA9212_BUCK_EN_SHIFT 
DA9212_BUCK_OFF 
DA9212_BUCK_ON 
DA9212_BUCK_GPI_SHIFT 
DA9212_BUCK_GPI_MASK 
DA9212_BUCK_GPI_OFF 
DA9212_BUCK_GPI_GPIO0 
DA9212_BUCK_GPI_GPIO1 
DA9212_BUCK_GPI_GPIO4 
DA9212_VBUCK_SEL_SHIFT 
DA9212_VBUCK_SEL_MASK 
DA9212_VBUCK_SEL_A 
DA9212_VBUCK_SEL_B 

Definition at line 37 of file da9212.h.

◆ anonymous enum

anonymous enum
Enumerator
DA9212_BUCK_MODE_SHIFT 
DA9212_BUCK_MODE_MASK 
DA9212_BUCK_MODE_MANUAL 
DA9212_BUCK_MODE_PFM 
DA9212_BUCK_MODE_PWM 
DA9212_BUCK_MODE_AUTO 

Definition at line 54 of file da9212.h.

◆ anonymous enum

anonymous enum
Enumerator
DA9212_REG_DEVICE_ID 
DA9212_ID 
DA9213_ID 
DA9212_REG_VARIANT_ID 
DA9212_VARIANT_ID_AB 
DA9212_VARIANT_ID_AC 

Definition at line 64 of file da9212.h.

Function Documentation

◆ da9212_probe()

void da9212_probe ( uint8_t  i2c_num)

Definition at line 53 of file da9212.c.

References BIOS_ERR, BIOS_INFO, da9212_hw_init(), DA9212_ID, DA9212_REG_DEVICE_ID, DA9212_REG_PAGE4, DA9212_REG_PAGE_CON, DA9212_REG_PAGE_SHIFT, DA9212_REG_VARIANT_ID, DA9212_SLAVE_ADDR, i2c_read_field(), i2c_write_field(), and printk.

Referenced by configure_ext_buck().

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