From patchwork Wed Mar 22 15:00:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Jacques Hiblot X-Patchwork-Id: 742135 X-Patchwork-Delegate: jh80.chung@samsung.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3vpCcG1xpZz9s7H for ; Thu, 23 Mar 2017 02:03:26 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="y302m1hW"; dkim-atps=neutral Received: by lists.denx.de (Postfix, from userid 105) id E251DC21D47; Wed, 22 Mar 2017 15:01:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 3D80DC21CF5; Wed, 22 Mar 2017 15:00:51 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id CB5E9C21C62; Wed, 22 Mar 2017 15:00:47 +0000 (UTC) Received: from fllnx210.ext.ti.com (fllnx210.ext.ti.com [198.47.19.17]) by lists.denx.de (Postfix) with ESMTPS id C6830C21CEC for ; Wed, 22 Mar 2017 15:00:43 +0000 (UTC) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id v2MF0fAa020957; Wed, 22 Mar 2017 10:00:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1490194841; bh=L3xvR8LFPX08mf/3hP1LtYVlztMDYrDooV9035rCroE=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=y302m1hWGMmWJdWn7l5XrefwGTHmVsG7r1fMyL036M9Z6mZaYsmonIV7AjC8vx/NV 2j0wr57DD53eDvO/qEVRDn9/lBI95jbuyDp2LZK5Dm89N7OxGyDH6Eor1IQ1qya49J X4DPBpCX1A5eFS2AXzOBEZI3Igm8I4AfAIm6tHZ8= Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id v2MF0fUQ031936; Wed, 22 Mar 2017 10:00:41 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.294.0; Wed, 22 Mar 2017 10:00:40 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id v2MF0eBw015653; Wed, 22 Mar 2017 10:00:40 -0500 From: Jean-Jacques Hiblot To: , Date: Wed, 22 Mar 2017 16:00:34 +0100 Message-ID: <1490194834-12450-5-git-send-email-jjhiblot@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1490194834-12450-1-git-send-email-jjhiblot@ti.com> References: <1490194834-12450-1-git-send-email-jjhiblot@ti.com> MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 4/4] drivers: omap_hsmmc: add support for CONFIG_BLK X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Signed-off-by: Jean-Jacques Hiblot Reviewed-by: Tom Rini --- drivers/mmc/omap_hsmmc.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c index 104129f..83dda09 100644 --- a/drivers/mmc/omap_hsmmc.c +++ b/drivers/mmc/omap_hsmmc.c @@ -58,6 +58,7 @@ DECLARE_GLOBAL_DATA_PTR; struct omap_hsmmc_plat { struct mmc_config cfg; + struct mmc mmc; }; struct omap_hsmmc_data { @@ -814,6 +815,15 @@ static int omap_hsmmc_ofdata_to_platdata(struct udevice *dev) return 0; } +#ifdef CONFIG_BLK + +static int omap_hsmmc_bind(struct udevice *dev) +{ + struct omap_hsmmc_plat *plat = dev_get_platdata(dev); + + return mmc_bind(dev, &plat->mmc, &plat->cfg); +} +#endif static int omap_hsmmc_probe(struct udevice *dev) { struct omap_hsmmc_plat *plat = dev_get_platdata(dev); @@ -825,9 +835,13 @@ static int omap_hsmmc_probe(struct udevice *dev) cfg->name = "OMAP SD/MMC"; cfg->ops = &omap_hsmmc_ops; +#ifdef CONFIG_BLK + mmc = &plat->mmc; +#else mmc = mmc_create(cfg, priv); if (mmc == NULL) return -1; +#endif #ifdef OMAP_HSMMC_USE_GPIO gpio_request_by_name(dev, "cd-gpios", 0, &priv->cd_gpio, GPIOD_IS_IN); @@ -852,6 +866,9 @@ U_BOOT_DRIVER(omap_hsmmc) = { .id = UCLASS_MMC, .of_match = omap_hsmmc_ids, .ofdata_to_platdata = omap_hsmmc_ofdata_to_platdata, +#ifdef CONFIG_BLK + .bind = omap_hsmmc_bind, +#endif .probe = omap_hsmmc_probe, .priv_auto_alloc_size = sizeof(struct omap_hsmmc_data), .platdata_auto_alloc_size = sizeof(struct omap_hsmmc_plat),