From patchwork Sat Nov 1 10:35:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 405781 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 165B814013F for ; Sat, 1 Nov 2014 21:36:37 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 503DA4BB99; Sat, 1 Nov 2014 11:36:33 +0100 (CET) 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 uSLDxrHhqWVH; Sat, 1 Nov 2014 11:36:32 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A6FA94BB9A; Sat, 1 Nov 2014 11:36:32 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A32A34BB9A for ; Sat, 1 Nov 2014 11:36:27 +0100 (CET) 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 u0OU9hNBSMHS for ; Sat, 1 Nov 2014 11:36:27 +0100 (CET) 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 gagarine.paulk.fr (gagarine.paulk.fr [109.190.93.129]) by theia.denx.de (Postfix) with ESMTPS id 7BF0D4BB99 for ; Sat, 1 Nov 2014 11:36:24 +0100 (CET) Received: by gagarine.paulk.fr (Postfix, from userid 65534) id 24E8647D02; Sat, 1 Nov 2014 11:36:23 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on gagarine.paulk.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable version=3.3.2 Received: from localhost.localdomain (collins [192.168.1.129]) by gagarine.paulk.fr (Postfix) with ESMTP id 7944447BF6; Sat, 1 Nov 2014 11:36:17 +0100 (CET) From: Paul Kocialkowski To: u-boot@lists.denx.de Date: Sat, 1 Nov 2014 11:35:43 +0100 Message-Id: <1414838144-4270-1-git-send-email-contact@paulk.fr> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1414517144-2183-1-git-send-email-contact@paulk.fr> References: <1414517144-2183-1-git-send-email-contact@paulk.fr> Subject: [U-Boot] [PATCH v2 1/2] mmc: Board-specific MMC power initializations X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 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 Some devices may use non-standard combinations of regulators to power MMC: this allows these devices to provide a board-specific MMC power init function to set everything up in their own way. Signed-off-by: Paul Kocialkowski --- drivers/mmc/mmc.c | 8 ++++++++ include/mmc.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 44a4feb..125f347 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -1277,6 +1277,12 @@ block_dev_desc_t *mmc_get_dev(int dev) } #endif +/* board-specific MMC power initializations. */ +__weak int board_mmc_power_init(void) +{ + return -1; +} + int mmc_start_init(struct mmc *mmc) { int err; @@ -1293,6 +1299,8 @@ int mmc_start_init(struct mmc *mmc) if (mmc->has_init) return 0; + board_mmc_power_init(); + /* made sure it's not NULL earlier */ err = mmc->cfg->ops->init(mmc); diff --git a/include/mmc.h b/include/mmc.h index 7f5f9bc..577e269 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -388,6 +388,8 @@ int mmc_legacy_init(int verbose); int board_mmc_init(bd_t *bis); int cpu_mmc_init(bd_t *bis); +int board_mmc_power_init(void); + /* Set block count limit because of 16 bit register limit on some hardware*/ #ifndef CONFIG_SYS_MMC_MAX_BLK_COUNT #define CONFIG_SYS_MMC_MAX_BLK_COUNT 65535