Patchwork [U-Boot] misc:pmic:trats: Correct procedure of enabling/disabling USB regulators

login
register
mail settings
Submitter Łukasz Majewski
Date April 26, 2012, 9:30 a.m.
Message ID <1335432618-20721-1-git-send-email-l.majewski@samsung.com>
Download mbox | patch
Permalink /patch/155204/
State Accepted
Commit a0f5b5a3a28e5ba82515e58bf6a2209f6b7cb684
Delegated to: Minkyu Kang
Headers show

Comments

Łukasz Majewski - April 26, 2012, 9:30 a.m.
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>
Cc: Minkyu Kang <mk7.kang@samsung.com>
---
 board/samsung/trats/trats.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
Minkyu Kang - May 3, 2012, 1:20 a.m.
Dear Marek Vasut,

On 26 April 2012 18:30, Lukasz Majewski <l.majewski@samsung.com> wrote:
> 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>
> Cc: Minkyu Kang <mk7.kang@samsung.com>
> ---
>  board/samsung/trats/trats.c |   15 +++++++++++----
>  1 files changed, 11 insertions(+), 4 deletions(-)

On the patchwork, this Lukasz's patch is delegated to you and state is
"Change Request".
(http://patchwork.ozlabs.org/patch/155204/)
Is it mistake? or I missed something?
Please let me know. :)

Thanks.
Minkyu Kang.
Minkyu Kang - May 3, 2012, 4:11 a.m.
On 26 April 2012 18:30, Lukasz Majewski <l.majewski@samsung.com> wrote:
> 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>
> Cc: Minkyu Kang <mk7.kang@samsung.com>
> ---
>  board/samsung/trats/trats.c |   15 +++++++++++----
>  1 files changed, 11 insertions(+), 4 deletions(-)

applied to u-boot-samsung.

Thanks.
Minkyu Kang.

Patch

diff --git a/board/samsung/trats/trats.c b/board/samsung/trats/trats.c
index 10cf5b3..a20268d 100644
--- a/board/samsung/trats/trats.c
+++ b/board/samsung/trats/trats.c
@@ -218,6 +218,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))
@@ -226,11 +227,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);
 	}