In the MAX8997, LDO regulators needs to preserve previously set voltage
values.
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
static int s5pc210_phy_control(int on)
{
int ret = 0;
static int s5pc210_phy_control(int on)
{
int ret = 0;
struct pmic *p = get_pmic();
if (pmic_probe(p))
struct pmic *p = get_pmic();
if (pmic_probe(p))
if (on) {
ret |= pmic_set_output(p, MAX8997_REG_SAFEOUTCTRL,
ENSAFEOUT1, LDO_ON);
if (on) {
ret |= pmic_set_output(p, MAX8997_REG_SAFEOUTCTRL,
ENSAFEOUT1, LDO_ON);
- ret |= pmic_reg_write(p, MAX8997_REG_LDO3CTRL, EN_LDO);
- ret |= pmic_reg_write(p, MAX8997_REG_LDO8CTRL, EN_LDO);
+ ret |= pmic_reg_read(p, MAX8997_REG_LDO3CTRL, &val);
+ ret |= pmic_reg_write(p, MAX8997_REG_LDO3CTRL, EN_LDO | val);
+
+ ret |= pmic_reg_read(p, MAX8997_REG_LDO8CTRL, &val);
+ ret |= pmic_reg_write(p, MAX8997_REG_LDO8CTRL, EN_LDO | val);
- ret |= pmic_reg_write(p, MAX8997_REG_LDO8CTRL, DIS_LDO);
- ret |= pmic_reg_write(p, MAX8997_REG_LDO3CTRL, DIS_LDO);
+ ret |= pmic_reg_read(p, MAX8997_REG_LDO8CTRL, &val);
+ ret |= pmic_reg_write(p, MAX8997_REG_LDO8CTRL, DIS_LDO | val);
+
+ ret |= pmic_reg_read(p, MAX8997_REG_LDO3CTRL, &val);
+ ret |= pmic_reg_write(p, MAX8997_REG_LDO3CTRL, DIS_LDO | val);
ret |= pmic_set_output(p, MAX8997_REG_SAFEOUTCTRL,
ENSAFEOUT1, LDO_OFF);
}
ret |= pmic_set_output(p, MAX8997_REG_SAFEOUTCTRL,
ENSAFEOUT1, LDO_OFF);
}