All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Murphy <dmurphy@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [[PATCH v2 2/6] ARM: OMAP5: Power: Add USB LDO9 enable interface
Date: Wed, 10 Jul 2013 15:05:05 -0500	[thread overview]
Message-ID: <1373486709-13015-3-git-send-email-dmurphy@ti.com> (raw)
In-Reply-To: <1373486709-13015-1-git-send-email-dmurphy@ti.com>

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(+)

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 */
-- 
1.7.9.5

  parent reply	other threads:[~2013-07-10 20:05 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-10 20:05 [U-Boot] OMAP5 USB EHCI Dan Murphy
2013-07-10 20:05 ` [U-Boot] [[PATCH v2 1/6] omap5: uevm: Change the board name to correct name Dan Murphy
2013-07-10 23:48   ` Nishanth Menon
2013-07-10 20:05 ` Dan Murphy [this message]
2013-07-11  7:56   ` [U-Boot] [[PATCH v2 2/6] ARM: OMAP5: Power: Add USB LDO9 enable interface Roger Quadros
2013-07-11 13:44     ` Dan Murphy
2013-07-10 20:05 ` [U-Boot] [[PATCH v2 3/6] ARM: OMAP5: USB: Add OMAP5 common USB EHCI information Dan Murphy
2013-07-11  3:51   ` Lokesh Vutla
2013-07-11  7:58     ` Roger Quadros
2013-07-11  8:35       ` Sricharan R
2013-07-11  8:55         ` Roger Quadros
2013-07-11  9:31           ` Sricharan R
2013-07-11 13:48             ` Dan Murphy
2013-07-11 14:37           ` Tom Rini
2013-07-10 20:05 ` [U-Boot] [[PATCH v2 4/6] ARM: OMAP: USB: Fix linker error when ULPI is not defined Dan Murphy
2013-07-10 20:05 ` [U-Boot] [[PATCH v2 5/6] USB: ehci: Add a weak function for resetting devices Dan Murphy
2013-07-10 22:20   ` Marek Vasut
2013-07-10 23:16     ` Dan Murphy
2013-07-11  8:11       ` Roger Quadros
2013-07-11 12:35         ` Marek Vasut
2013-07-11 14:23           ` Roger Quadros
2013-07-11 15:29             ` Dan Murphy
2013-07-15  3:19               ` Marek Vasut
2013-07-16 20:19                 ` Dan Murphy
2013-07-11 16:06             ` Marek Vasut
2013-07-10 20:05 ` [U-Boot] [[PATCH v2 6/6] ARM: OMAP5-uevm: Add USB ehci support for the uEVM Dan Murphy
2013-07-11 14:46   ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1373486709-13015-3-git-send-email-dmurphy@ti.com \
    --to=dmurphy@ti.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.