coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <console/console.h>
#include <device/mmio.h>
#include <device/i2c_simple.h>
#include "max77686.h"
Go to the source code of this file.
Enumerations | |
enum | { REG_BBAT = 0x7e , BBAT_BBCHOSTEN_MASK = 1 << 0 , BBAT_BBCVS_SHIFT = 3 , BBAT_BBCVS_MASK = 3 << BBAT_BBCVS_SHIFT } |
Functions | |
static int | max77686_i2c_write (unsigned int bus, unsigned char chip_addr, unsigned int reg, unsigned char val) |
static int | max77686_i2c_read (unsigned int bus, unsigned char chip_addr, unsigned int reg, unsigned char *val) |
static int | max77686_enablereg (unsigned int bus, enum max77686_regnum reg, int enable) |
int | max77686_volsetting (unsigned int bus, enum max77686_regnum reg, unsigned int volt, int enable, int volt_units) |
Set the required voltage level of pmic. More... | |
int | max77686_enable_32khz_cp (unsigned int bus) |
This function enables the 32KHz coprocessor clock. More... | |
int | max77686_disable_backup_batt (unsigned int bus) |
Disable charging of the RTC backup battery. More... | |
Variables | |
struct max77686_para | max77686_param [] |
anonymous enum |
Enumerator | |
---|---|
REG_BBAT | |
BBAT_BBCHOSTEN_MASK | |
BBAT_BBCVS_SHIFT | |
BBAT_BBCVS_MASK |
Definition at line 10 of file max77686.c.
int max77686_disable_backup_batt | ( | unsigned int | bus | ) |
Disable charging of the RTC backup battery.
bus | i2c bus |
Definition at line 190 of file max77686.c.
References BBAT_BBCHOSTEN_MASK, BBAT_BBCVS_MASK, BIOS_DEBUG, MAX77686_I2C_ADDR, max77686_i2c_read(), max77686_i2c_write(), printk, REG_BBAT, and val.
Referenced by setup_power().
int max77686_enable_32khz_cp | ( | unsigned int | bus | ) |
This function enables the 32KHz coprocessor clock.
bus | i2c bus |
Return 0 if ok, else -1
Definition at line 185 of file max77686.c.
References max77686_enablereg(), PMIC_EN32KHZ_CP, and REG_ENABLE.
Referenced by setup_power().
|
static |
Definition at line 102 of file max77686.c.
References BIOS_DEBUG, clrbits8, clrsetbits8, MAX77686_I2C_ADDR, max77686_i2c_read(), max77686_i2c_write(), max77686_param, printk, REG_DISABLE, max77686_para::reg_enaddr, max77686_para::reg_enbitmask, max77686_para::reg_enbiton, and max77686_para::reg_enbitpos.
Referenced by max77686_enable_32khz_cp(), and max77686_volsetting().
|
inlinestatic |
Definition at line 86 of file max77686.c.
References i2c_readb(), and val.
Referenced by max77686_disable_backup_batt(), max77686_enablereg(), and max77686_volsetting().
|
inlinestatic |
Definition at line 72 of file max77686.c.
References i2c_writeb(), and val.
Referenced by max77686_disable_backup_batt(), max77686_enablereg(), and max77686_volsetting().
int max77686_volsetting | ( | unsigned int | bus, |
enum max77686_regnum | reg, | ||
unsigned int | volt, | ||
int | enable, | ||
int | volt_units | ||
) |
Set the required voltage level of pmic.
bus | i2c bus |
reg | register number of buck/ldo to be set |
volt | voltage level to be set |
enable | enable or disable bit |
volt_units | MAX77686_MV or MAX77686_UV, unit of the voltage parameters |
Definition at line 136 of file max77686.c.
References BIOS_DEBUG, clrsetbits8, max77686_enablereg(), MAX77686_I2C_ADDR, max77686_i2c_read(), max77686_i2c_write(), max77686_param, MAX77686_UV, printk, max77686_para::vol_addr, max77686_para::vol_bitmask, max77686_para::vol_bitpos, max77686_para::vol_div, and max77686_para::vol_min.
Referenced by setup_power().
struct max77686_para max77686_param[] |
Definition at line 1 of file max77686.c.
Referenced by max77686_enablereg(), and max77686_volsetting().