diff options
author | Ćukasz Majewski <l.majewski@samsung.com> | 2012-04-25 23:30:18 +0000 |
---|---|---|
committer | Albert ARIBAUD <albert.u.boot@aribaud.net> | 2012-07-07 14:07:25 +0200 |
commit | a0f5b5a3a28e5ba82515e58bf6a2209f6b7cb684 (patch) | |
tree | 4e66bb61534cb360bdb33e781399f8f558332240 /board/samsung/trats | |
parent | c20545691a3861ece0319cf5ad257714f1b502fd (diff) | |
download | u-boot-imx-a0f5b5a3a28e5ba82515e58bf6a2209f6b7cb684.zip u-boot-imx-a0f5b5a3a28e5ba82515e58bf6a2209f6b7cb684.tar.gz u-boot-imx-a0f5b5a3a28e5ba82515e58bf6a2209f6b7cb684.tar.bz2 |
misc:pmic:trats: Correct procedure of enabling/disabling USB regulators
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>
Diffstat (limited to 'board/samsung/trats')
-rw-r--r-- | board/samsung/trats/trats.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/board/samsung/trats/trats.c b/board/samsung/trats/trats.c index 08ca63d..a8b2b11 100644 --- a/board/samsung/trats/trats.c +++ b/board/samsung/trats/trats.c @@ -220,6 +220,7 @@ int board_mmc_init(bd_t *bis) static int s5pc210_phy_control(int on) { int ret = 0; + u32 val = 0; struct pmic *p = get_pmic(); if (pmic_probe(p)) @@ -228,11 +229,17 @@ static int s5pc210_phy_control(int 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); } else { - 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); } |