Patchwork [U-Boot,[PATCH,v2,2/6] ARM: OMAP5: Power: Add USB LDO9 enable interface

login
register
mail settings
Submitter Dan Murphy
Date July 10, 2013, 8:05 p.m.
Message ID <1373486709-13015-3-git-send-email-dmurphy@ti.com>
Download mbox | patch
Permalink /patch/258227/
State Superseded
Delegated to: Tom Rini
Headers show

Comments

Dan Murphy - July 10, 2013, 8:05 p.m.
Add an interface to the palmas driver to enable the
LDO9 power supply for the USB hub IC.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
 drivers/power/palmas.c |   34 ++++++++++++++++++++++++++++++++++
 include/palmas.h       |    1 +
 2 files changed, 35 insertions(+)
Roger Quadros - July 11, 2013, 7:56 a.m.
Dan,

On 07/10/2013 11:05 PM, Dan Murphy wrote:
> Add an interface to the palmas driver to enable the
> LDO9 power supply for the USB hub IC.

As per rev.C1 uEVM schematics, LDO9 is for SDIO card and not for USB hub.

USB hub seems to be powered by DC_5V directly.

Which version are you referring to?

> 
> Signed-off-by: Dan Murphy <dmurphy@ti.com>
> ---
>  drivers/power/palmas.c |   34 ++++++++++++++++++++++++++++++++++
>  include/palmas.h       |    1 +
>  2 files changed, 35 insertions(+)

cheers,
-roger
Dan Murphy - July 11, 2013, 1:44 p.m.
On 07/11/2013 02:56 AM, Roger Quadros wrote:
> Dan,
>
> On 07/10/2013 11:05 PM, Dan Murphy wrote:
>> Add an interface to the palmas driver to enable the
>> LDO9 power supply for the USB hub IC.
> As per rev.C1 uEVM schematics, LDO9 is for SDIO card and not for USB hub.
>
> USB hub seems to be powered by DC_5V directly.
>
> Which version are you referring to?
You are correct I will remove this patch.

It is not needed
>> Signed-off-by: Dan Murphy <dmurphy@ti.com>
>> ---
>>  drivers/power/palmas.c |   34 ++++++++++++++++++++++++++++++++++
>>  include/palmas.h       |    1 +
>>  2 files changed, 35 insertions(+)
> cheers,
> -roger
>

Patch

diff --git a/drivers/power/palmas.c b/drivers/power/palmas.c
index 2d275a7..b800dd4 100644
--- a/drivers/power/palmas.c
+++ b/drivers/power/palmas.c
@@ -143,6 +143,40 @@  int twl603x_audio_power(u8 on)
 }
 #endif
 
+#ifdef CONFIG_PALMAS_USBPWR
+int palmas_usb_poweron_ldo(void)
+{
+	u8 val = 0;
+	int err;
+
+	/* TURN ON LDO's needed */
+	val = RSC_STAT_ON | RSC_MODE_SLEEP | RSC_MODE_ACTIVE;
+	err = palmas_i2c_write_u8(TWL603X_CHIP_P1, SYSEN2_CTRL, val);
+	if (err) {
+		printf("palmas: could not turn 3v3 %s: err = %d\n",
+		       val ? "on" : "off", err);
+		return err;
+	}
+
+	/* set to 3.3V */
+	val = LDO9_BYPASS;
+	err = palmas_i2c_write_u8(TWL603X_CHIP_P1, LDOUSB_VOLTAGE, val);
+	if (err) {
+		printf("palmas: could not set 3v3 %s: err = %d\n",
+		       val ? "on" : "off", err);
+		return err;
+	}
+
+	/* enable LDO USB */
+	err = palmas_i2c_write_u8(TWL603X_CHIP_P1, LDOUSB_CTRL, val);
+	if (err) {
+		printf("palmas: could not enable 3v3 %s: err = %d\n",
+		       val ? "on" : "off", err);
+		return err;
+	}
+}
+#endif
+
 /*
  * Enable/disable back-up battery (or super cap) charging on TWL6035/37.
  * Please use defined BB_xxx values.
diff --git a/include/palmas.h b/include/palmas.h
index aff48b5..43887c2 100644
--- a/include/palmas.h
+++ b/include/palmas.h
@@ -130,5 +130,6 @@  int palmas_mmc1_poweron_ldo(void);
 int twl603x_mmc1_set_ldo9(u8 vsel);
 int twl603x_audio_power(u8 on);
 int twl603x_enable_bb_charge(u8 bb_fields);
+int palmas_usb_poweron_ldo(void);
 
 #endif /* PALMAS_H */