From patchwork Sat Oct 8 10:07:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 118519 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 395FFB70C7 for ; Sat, 8 Oct 2011 21:08:33 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 373DB293E6; Sat, 8 Oct 2011 12:08:20 +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 5flZT6IN-+ZH; Sat, 8 Oct 2011 12:08:19 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 66CDF29329; Sat, 8 Oct 2011 12:07:44 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EA6B9292D0 for ; Sat, 8 Oct 2011 12:07:33 +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 2BfV4mZ8basD for ; Sat, 8 Oct 2011 12:07:29 +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 ACB4929287 for ; Sat, 8 Oct 2011 12:07:29 +0200 (CEST) Received: from paperina.lan (unknown [88.149.182.160]) by smtpi4.ngi.it (Postfix) with ESMTP id 5F7AE42472; Sat, 8 Oct 2011 12:07:29 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by paperina.lan (Postfix) with ESMTP id 245B4140A0DE; Sat, 8 Oct 2011 12:07:29 +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 0fmU57qES3Hi; Sat, 8 Oct 2011 12:07:26 +0200 (CEST) Received: from papero.lan (papero.lan [192.168.2.105]) by paperina.lan (Postfix) with ESMTP id 14230140A11F; 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:02 +0200 Message-Id: <1318068428-3453-6-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> Subject: [U-Boot] [PATCH 05/11] MX35: mx35pdk: 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 --- board/freescale/mx35pdk/mx35pdk.c | 18 ++++++++++++------ include/configs/mx35pdk.h | 5 +++-- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/board/freescale/mx35pdk/mx35pdk.c b/board/freescale/mx35pdk/mx35pdk.c index 9eefe5e..f6da51a 100644 --- a/board/freescale/mx35pdk/mx35pdk.c +++ b/board/freescale/mx35pdk/mx35pdk.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -204,9 +205,10 @@ int board_init(void) static inline int pmic_detect(void) { - int id; + unsigned int id; + struct pmic *p = get_pmic(); - id = pmic_reg_read(REG_IDENTIFICATION); + pmic_reg_read(p, REG_IDENTIFICATION, &id); id = (id >> 6) & 0x7; if (id == 0x7) @@ -227,15 +229,19 @@ int board_late_init(void) { u8 val; u32 pmic_val; + struct pmic *p; + pmic_init(); if (pmic_detect()) { + p = get_pmic(); mxc_request_iomux(MX35_PIN_WATCHDOG_RST, MUX_CONFIG_SION | MUX_CONFIG_ALT1); - pmic_val = pmic_reg_read(REG_SETTING_0); - pmic_reg_write(REG_SETTING_0, pmic_val | VO_1_30V | VO_1_50V); - pmic_val = pmic_reg_read(REG_MODE_0); - pmic_reg_write(REG_MODE_0, pmic_val | VGEN3EN); + pmic_reg_read(p, REG_SETTING_0, &pmic_val); + pmic_reg_write(p, REG_SETTING_0, + pmic_val | VO_1_30V | VO_1_50V); + pmic_reg_read(p, REG_MODE_0, &pmic_val); + pmic_reg_write(p, REG_MODE_0, pmic_val | VGEN3EN); mxc_request_iomux(MX35_PIN_COMPARE, MUX_CONFIG_GPIO); mxc_iomux_set_input(MUX_IN_GPIO1_IN_5, INPUT_CTL_PATH0); diff --git a/include/configs/mx35pdk.h b/include/configs/mx35pdk.h index 4e9022d..946e64b 100644 --- a/include/configs/mx35pdk.h +++ b/include/configs/mx35pdk.h @@ -69,8 +69,9 @@ /* * 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 0x08 /*