hancock: add support for da9063 registers >0x100
This commit is contained in:
parent
7227528d40
commit
68329cfb6d
|
|
@ -35,7 +35,11 @@ int da9063_get_reg(int reg, u8* val)
|
||||||
|
|
||||||
/* TODO: Use CONFIG_PMIC_I2C_ADDR+1 if reg > 0xFF */
|
/* TODO: Use CONFIG_PMIC_I2C_ADDR+1 if reg > 0xFF */
|
||||||
*val = 0;
|
*val = 0;
|
||||||
ret = i2c_read(CONFIG_PMIC_I2C_ADDR, reg, 1, &temp, 1);
|
if (reg < 0x100) {
|
||||||
|
ret = i2c_read(CONFIG_PMIC_I2C_ADDR, reg & 0xFF, 1, &temp, 1);
|
||||||
|
} else {
|
||||||
|
ret = i2c_read(CONFIG_PMIC_I2C_ADDR+1, reg & 0xFF, 1, &temp, 1);
|
||||||
|
}
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
*val = temp;
|
*val = temp;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@
|
||||||
#define PMIC_REG_BUCK_ILIM_B 0x9B
|
#define PMIC_REG_BUCK_ILIM_B 0x9B
|
||||||
#define PMIC_REG_BUCK_ILIM_C 0x9C
|
#define PMIC_REG_BUCK_ILIM_C 0x9C
|
||||||
|
|
||||||
|
#define PMIC_REG_CONFIG_ID 0x184 /* OTP Config ID <ver.rev> */
|
||||||
|
|
||||||
|
|
||||||
extern void da9063_init(int i2c_bus);
|
extern void da9063_init(int i2c_bus);
|
||||||
extern int da9063_get_reg(int reg, u8* val);
|
extern int da9063_get_reg(int reg, u8* val);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue