From patchwork Fri Sep 7 11:45:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lauri Hintsala X-Patchwork-Id: 1421771 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 2E7483FC85 for ; Fri, 7 Sep 2012 11:50:00 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T9x1i-0004mb-Au; Fri, 07 Sep 2012 11:47:10 +0000 Received: from bluegiga.fi ([194.100.31.45] helo=blue-gw.bluegiga.fi) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1T9x1e-0004lz-8t for linux-arm-kernel@lists.infradead.org; Fri, 07 Sep 2012 11:47:07 +0000 Received: from bgtlh.bgt.local (unknown [10.1.1.28]) by blue-gw.bluegiga.fi (Postfix) with ESMTP id 424067BE289; Fri, 7 Sep 2012 14:46:59 +0300 (EEST) From: Lauri Hintsala To: cjb@laptop.org, shawn.guo@linaro.org Subject: [PATCH] mmc: mxs-mmc: implement broken-cd Date: Fri, 7 Sep 2012 14:45:17 +0300 Message-Id: <1347018317-2222-1-git-send-email-lauri.hintsala@bluegiga.com> X-Mailer: git-send-email 1.7.9.5 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: veli-pekka.peltola@bluegiga.com, linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Lauri Hintsala X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This feature allows to use SDIO bus without wiring card detect signal. This is relevant in cases where SDIO device is connected to SDIO bus and there is no way to disconnect device from bus (device is always present). Signed-off-by: Lauri Hintsala Acked-by: Shawn Guo --- drivers/mmc/host/mxs-mmc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c index ad3fcea..992760e 100644 --- a/drivers/mmc/host/mxs-mmc.c +++ b/drivers/mmc/host/mxs-mmc.c @@ -165,6 +165,7 @@ struct mxs_mmc_host { int sdio_irq_en; int wp_gpio; bool wp_inverted; + bool broken_cd; }; static int mxs_mmc_get_ro(struct mmc_host *mmc) @@ -187,6 +188,9 @@ static int mxs_mmc_get_cd(struct mmc_host *mmc) { struct mxs_mmc_host *host = mmc_priv(mmc); + if (host->broken_cd) + return -ENOSYS; + return !(readl(host->base + HW_SSP_STATUS(host)) & BM_SSP_STATUS_CARD_DETECT); } @@ -808,6 +812,9 @@ static int mxs_mmc_probe(struct platform_device *pdev) &flags); if (flags & OF_GPIO_ACTIVE_LOW) host->wp_inverted = 1; + + if (of_get_property(np, "broken-cd", NULL)) + host->broken_cd = 1; } else { if (pdata->flags & SLOTF_8_BIT_CAPABLE) mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA;