From patchwork Wed Jul 10 20:05:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 258227 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 363A82C02E9 for ; Thu, 11 Jul 2013 06:06:23 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D370D4A176; Wed, 10 Jul 2013 22:06:08 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ivlB-rxglm1t; Wed, 10 Jul 2013 22:06:08 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 13D324A18A; Wed, 10 Jul 2013 22:05:41 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 45FF44A181 for ; Wed, 10 Jul 2013 22:05:38 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CWccCn2bWJpo for ; Wed, 10 Jul 2013 22:05:33 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by theia.denx.de (Postfix) with ESMTPS id 197324A16E for ; Wed, 10 Jul 2013 22:05:19 +0200 (CEST) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id r6AK5EGC018822; Wed, 10 Jul 2013 15:05:14 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r6AK5EgJ021512; Wed, 10 Jul 2013 15:05:14 -0500 Received: from dlelxv24.itg.ti.com (172.17.1.199) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.2.342.3; Wed, 10 Jul 2013 15:05:14 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlelxv24.itg.ti.com (8.13.8/8.13.8) with ESMTP id r6AK5EMe002722; Wed, 10 Jul 2013 15:05:14 -0500 Received: from localhost (h0-147.vpn.ti.com [172.24.0.147]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id r6AK5Et21576; Wed, 10 Jul 2013 15:05:14 -0500 (CDT) From: Dan Murphy To: , , Date: Wed, 10 Jul 2013 15:05:05 -0500 Message-ID: <1373486709-13015-3-git-send-email-dmurphy@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1373486709-13015-1-git-send-email-dmurphy@ti.com> References: <1373486709-13015-1-git-send-email-dmurphy@ti.com> MIME-Version: 1.0 Cc: rogerq@ti.com Subject: [U-Boot] [[PATCH v2 2/6] ARM: OMAP5: Power: Add USB LDO9 enable interface X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Add an interface to the palmas driver to enable the LDO9 power supply for the USB hub IC. Signed-off-by: Dan Murphy --- 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 */