From patchwork Sat Oct 8 10:07:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 118526 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 9258FB70C5 for ; Sat, 8 Oct 2011 21:16:42 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DCD23292DE; Sat, 8 Oct 2011 12:08:36 +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 5YPeby083lms; Sat, 8 Oct 2011 12:08:36 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 09F4829363; Sat, 8 Oct 2011 12:08:03 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A85F1292B7 for ; Sat, 8 Oct 2011 12:07:51 +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 IDJPIXKjt0yq for ; Sat, 8 Oct 2011 12:07:51 +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 smtpi4.ngi.it (smtpi4.ngi.it [88.149.128.104]) by theia.denx.de (Postfix) with ESMTP id B2B9E292BC for ; Sat, 8 Oct 2011 12:07:32 +0200 (CEST) Received: from paperina.lan (unknown [88.149.182.160]) by smtpi4.ngi.it (Postfix) with ESMTP id 272A142812; Sat, 8 Oct 2011 12:07:32 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by paperina.lan (Postfix) with ESMTP id ED2D9140A0DE; Sat, 8 Oct 2011 12:07:31 +0200 (CEST) Received: from paperina.lan ([127.0.0.1]) by localhost (paperina.lan [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vbZrwkPr+WWs; Sat, 8 Oct 2011 12:07:29 +0200 (CEST) Received: from papero.lan (papero.lan [192.168.2.105]) by paperina.lan (Postfix) with ESMTP id 283D9140A121; Sat, 8 Oct 2011 12:07:20 +0200 (CEST) From: Stefano Babic To: u-boot@lists.denx.de Date: Sat, 8 Oct 2011 12:07:04 +0200 Message-Id: <1318068428-3453-8-git-send-email-sbabic@denx.de> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1318068428-3453-1-git-send-email-sbabic@denx.de> References: <1318068428-3453-1-git-send-email-sbabic@denx.de> Cc: Jason Liu Subject: [U-Boot] [PATCH 07/11] MX5: mx53evk: use new pmic driver X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Switch to new pmic generic driver. Signed-off-by: Stefano Babic CC: Jason Liu Acked-by: Jason Liu --- board/freescale/mx53evk/mx53evk.c | 15 +++++++++------ include/configs/mx53evk.h | 5 +++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/board/freescale/mx53evk/mx53evk.c b/board/freescale/mx53evk/mx53evk.c index fd821c0..af0948f 100644 --- a/board/freescale/mx53evk/mx53evk.c +++ b/board/freescale/mx53evk/mx53evk.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -124,12 +125,13 @@ static void setup_i2c(unsigned int port_number) void power_init(void) { unsigned int val; + struct pmic *p = get_pmic(); /* Set VDDA to 1.25V */ - val = pmic_reg_read(REG_SW_2); + pmic_reg_read(p, REG_SW_2, &val); val &= ~SWX_OUT_MASK; val |= SWX_OUT_1_25; - pmic_reg_write(REG_SW_2, val); + pmic_reg_write(p, REG_SW_2, val); /* * Need increase VCC and VDDA to 1.3V @@ -137,16 +139,16 @@ void power_init(void) */ if (is_soc_rev(CHIP_REV_2_0) == 0) { /* Set VCC to 1.3V for TO2 */ - val = pmic_reg_read(REG_SW_1); + pmic_reg_read(p, REG_SW_1, &val); val &= ~SWX_OUT_MASK; val |= SWX_OUT_1_30; - pmic_reg_write(REG_SW_1, val); + pmic_reg_write(p, REG_SW_1, val); /* Set VDDA to 1.3V for TO2 */ - val = pmic_reg_read(REG_SW_2); + pmic_reg_read(p, REG_SW_2, &val); val &= ~SWX_OUT_MASK; val |= SWX_OUT_1_30; - pmic_reg_write(REG_SW_2, val); + pmic_reg_write(p, REG_SW_2, val); } } @@ -364,6 +366,7 @@ int board_init(void) int board_late_init(void) { setup_i2c(1); + pmic_init(); power_init(); return 0; diff --git a/include/configs/mx53evk.h b/include/configs/mx53evk.h index b127b06..dfe07bf 100644 --- a/include/configs/mx53evk.h +++ b/include/configs/mx53evk.h @@ -59,8 +59,9 @@ #define CONFIG_SYS_I2C_SLAVE 0xfe /* PMIC Configs */ -#define CONFIG_FSL_PMIC -#define CONFIG_FSL_PMIC_I2C +#define CONFIG_PMIC +#define CONFIG_PMIC_I2C +#define CONFIG_PMIC_FSL #define CONFIG_SYS_FSL_PMIC_I2C_ADDR 8 /* MMC Configs */