From patchwork Wed Apr 8 13:17:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 6179511 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 20F169F349 for ; Wed, 8 Apr 2015 13:18:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3ADF320373 for ; Wed, 8 Apr 2015 13:18:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4839B20328 for ; Wed, 8 Apr 2015 13:18:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932066AbbDHNSM (ORCPT ); Wed, 8 Apr 2015 09:18:12 -0400 Received: from mail-vn0-f51.google.com ([209.85.216.51]:34640 "EHLO mail-vn0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754366AbbDHNSL (ORCPT ); Wed, 8 Apr 2015 09:18:11 -0400 Received: by vnbf190 with SMTP id f190so15000872vnb.1 for ; Wed, 08 Apr 2015 06:18:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=S7JCtLYY3ZjEAegsrUEKISgiQ5UuxxOGKGogPSSPCxo=; b=p4PKR26nM8kAiveFegK3ZOometfTCJnZmOVfe9qzQeASUD6DqWpTv+nMMer1xXCHHM t/9nu+jdLmTKNMReJFpUiI7HiY1SPkidKcgjDhRHEu+AYN2dSmQusAwlHx80h90EelBZ HPjKLGLlyqi44q2GyOc3LsQZpnqraCezPxrkggD1GswfpTdlAUPJ/8mwutCXe6d2QPOL exup7WJJlnV2eUrvMoOJkpavfddUFtJsCf1QMWloi/x7wyiXp9Sph62TITu+gkLBOVPF VwF8RPFDRA5OXAJOmyRZNMqHvM6jChor3i4popDH6C6Rld4nUW3InRPfzNvC4dEmQ9++ 3tYQ== X-Received: by 10.236.63.99 with SMTP id z63mr21240327yhc.58.1428499090675; Wed, 08 Apr 2015 06:18:10 -0700 (PDT) Received: from localhost.localdomain ([177.194.99.89]) by mx.google.com with ESMTPSA id 21sm8988918yhf.24.2015.04.08.06.18.07 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Apr 2015 06:18:09 -0700 (PDT) From: Fabio Estevam To: ulf.hansson@linaro.org Cc: linux-mmc@vger.kernel.org, linux@arm.linux.org.uk, kernel@pengutronix.de, otavio@ossystems.com.br, linux-arm-kernel@lists.infradead.org, b29396@freescale.com, Fabio Estevam Subject: [PATCH v3] mmc: sdhci-esdhc-imx: Call mmc_of_parse() Date: Wed, 8 Apr 2015 10:17:44 -0300 Message-Id: <1428499065-25544-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Fabio Estevam Currently it is not possible to use 'mmc-pwrseq-simple' property with this driver because mmc_of_parse() is never called. mmc_of_parse() calls mmc_pwrseq_alloc() that manages MMC power sequence and allows passing GPIOs in the devicetree to properly power/reset the Wifi chipset. When using mmc_of_parse() we no longer need to have custom code to request card-detect and write-protect pins, as this can now be handled by the mmc core. Tested on a imx6sl-warp board where BT/Wifi is functional and also on a imx6q-sabresd. Signed-off-by: Fabio Estevam --- Change since v2: - Use mmc_of_parse() and remove custom code to retrieve CD/WP GPIOs. drivers/mmc/host/sdhci-esdhc-imx.c | 38 ++++++-------------------------------- 1 file changed, 6 insertions(+), 32 deletions(-) diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index 7ee8312..82f512d 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -1013,40 +1013,9 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev) host->mmc->parent->platform_data); } - /* write_protect */ - if (boarddata->wp_type == ESDHC_WP_GPIO) { - err = mmc_gpio_request_ro(host->mmc, boarddata->wp_gpio); - if (err) { - dev_err(mmc_dev(host->mmc), - "failed to request write-protect gpio!\n"); - goto disable_clk; - } - host->mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH; - } - /* card_detect */ - switch (boarddata->cd_type) { - case ESDHC_CD_GPIO: - err = mmc_gpio_request_cd(host->mmc, boarddata->cd_gpio, 0); - if (err) { - dev_err(mmc_dev(host->mmc), - "failed to request card-detect gpio!\n"); - goto disable_clk; - } - /* fall through */ - - case ESDHC_CD_CONTROLLER: - /* we have a working card_detect back */ + if (boarddata->cd_type == ESDHC_CD_CONTROLLER) host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION; - break; - - case ESDHC_CD_PERMANENT: - host->mmc->caps |= MMC_CAP_NONREMOVABLE; - break; - - case ESDHC_CD_NONE: - break; - } switch (boarddata->max_bus_width) { case 8: @@ -1079,6 +1048,11 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev) host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V; } + /* call to generic mmc_of_parse to support additional capabilities */ + err = mmc_of_parse(host->mmc); + if (err) + goto disable_clk; + err = sdhci_add_host(host); if (err) goto disable_clk;