From patchwork Tue Apr 2 00:04:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 232844 X-Patchwork-Delegate: promsoft@gmail.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 A23D82C012A for ; Tue, 2 Apr 2013 11:06:44 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 321704A11B; Tue, 2 Apr 2013 02:06:35 +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 Eo9oT5qfEsaV; Tue, 2 Apr 2013 02:06:34 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EC23B4A126; Tue, 2 Apr 2013 02:06:22 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8CD1F4A101 for ; Tue, 2 Apr 2013 02:06:18 +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 doQXsbn4aPFG for ; Tue, 2 Apr 2013 02:06:16 +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 mail-fa0-f74.google.com (mail-fa0-f74.google.com [209.85.161.74]) by theia.denx.de (Postfix) with ESMTPS id 439234A10F for ; Tue, 2 Apr 2013 02:06:12 +0200 (CEST) Received: by mail-fa0-f74.google.com with SMTP id p1so202164fap.1 for ; Mon, 01 Apr 2013 17:06:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:mime-version:content-type:content-transfer-encoding :x-gm-message-state; bh=Axmslq2UOaw6K+geDerKqf3+olS84+40Bcg64aewzk8=; b=n8Qc6LgeXuhOza9zVG87xRdcwJ+/+MydGeIgCoI6Ds6Tpzk6RV2Jfs8NhkMYLXGM+2 Scp5pgEuK/xfgWCOPK04AYUsi0wFrLwya9xK+1dR+whuARgHrpRm6BAzFjjdY3BDF2yp sjjLv3G069SjSi8e42pgGrGFHOctZy9NIfieIUFFyRaETFnXegzt++YkzXiuO+48NhA+ prD3D8HfSJqE2d1JUfPC7n1oPUzf/OupqGzfSf548iwMMVQ+cA5pBrv44cgbyboWmW2f Bs0TONnPi2GRHol8qMkSf60xQSBcYP8wAlPE6lxPiM/bQSl/vhQtWC6im/1BfnQjkcwF W43Q== X-Received: by 10.15.44.6 with SMTP id y6mr17673790eev.3.1364861172461; Mon, 01 Apr 2013 17:06:12 -0700 (PDT) Received: from corp2gmr1-2.eem.corp.google.com (corp2gmr1-2.eem.corp.google.com [172.25.138.117]) by gmr-mx.google.com with ESMTPS id 47si4067472eeh.1.2013.04.01.17.06.12 (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Mon, 01 Apr 2013 17:06:12 -0700 (PDT) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.83.1]) by corp2gmr1-2.eem.corp.google.com (Postfix) with ESMTP id 399241E41B3; Mon, 1 Apr 2013 17:06:12 -0700 (PDT) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id 8D00916105E; Mon, 1 Apr 2013 17:06:11 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Mon, 1 Apr 2013 17:04:15 -0700 Message-Id: <1364861055-21670-5-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.8.1.3 In-Reply-To: <1364861055-21670-1-git-send-email-sjg@chromium.org> References: <1364861055-21670-1-git-send-email-sjg@chromium.org> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQlkk3/syfBdKZLdRx7aT9zoDH/JQPlq2u4C8/cY8srN7hrXJ4uhQd/v8RQfXtn4vlZtEupPQzN+BubgEWrjp0eRWLMaznaUMxh7luOyhRDD6/lc2wt1pj8XqVNgpAOmxmEBuY/okecW6fDZL4HjhwsOJlmKlpK6pygoLGWyhd9Fh18OvWZBK3Ts9O76qG/bHROF933T Cc: u-boot-review@google.com, Aaron Durbin , Rajeshwari Shinde , Tom Rini Subject: [U-Boot] [PATCH 4/4] exynos5: support tps65090 pmic 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 From: Aaron Durbin The TSP65090 is a PMIC on some exynos5 boards. The init function is called for the TPS65090 pmic. If that device is not a part of the device tree (returns -ENODEV) then continue. Otherwise return a failure. Signed-off-by: Aaron Durbin Signed-off-by: Simon Glass Reviewed-by: Simon Glass --- board/samsung/smdk5250/smdk5250.c | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/board/samsung/smdk5250/smdk5250.c b/board/samsung/smdk5250/smdk5250.c index 217c6df..06f9ea6 100644 --- a/board/samsung/smdk5250/smdk5250.c +++ b/board/samsung/smdk5250/smdk5250.c @@ -37,6 +37,7 @@ #include #include #include +#include #include DECLARE_GLOBAL_DATA_PTR; @@ -155,17 +156,10 @@ static int pmic_reg_update(struct pmic *p, int reg, uint regval) return 0; } -int power_init_board(void) +int max77686_init(void) { struct pmic *p; - set_ps_hold_ctrl(); - - i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); - - if (pmic_init(I2C_PMIC)) - return -1; - p = pmic_get("MAX77686_PMIC"); if (!p) return -ENODEV; @@ -250,6 +244,29 @@ int power_init_board(void) return 0; } + +int power_init_board(void) +{ + int ret; + + set_ps_hold_ctrl(); + + i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); + + if (pmic_init(I2C_PMIC)) + return -1; + + if (max77686_init()) + return -1; + + /* The TPS65090 may not be in the device tree. If so, it is not + * an error. */ + ret = tps65090_init(); + if (ret == 0 || ret == -ENODEV) + return 0; + + return -1; +} #endif void dram_init_banksize(void)