public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Pereira da Silva <aletes.xgr@gmail.com>
To: cjb@laptop.org, shawn.guo@linaro.org, marex@denx.de,
	fabio.estevam@freescale.com, otavio@ossystems.com.br,
	broonie@opensource.wolfsonmicro.com, linux-mmc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: Alexandre Pereira da Silva <aletes.xgr@gmail.com>
Subject: [PATCH] mmc: mxs-mmc: Add support for non-removable cards
Date: Fri,  5 Apr 2013 01:18:38 -0300	[thread overview]
Message-ID: <1365135518-31549-1-git-send-email-aletes.xgr@gmail.com> (raw)

Some boards and card slots doesn't have card detect feature available.
In that case allow to mark the cards as non-removable, via devicetree.

Signed-off-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>
---
 drivers/mmc/host/mxs-mmc.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index 4efe302..7d2cd74 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -95,6 +95,9 @@ static int mxs_mmc_get_cd(struct mmc_host *mmc)
 	struct mxs_mmc_host *host = mmc_priv(mmc);
 	struct mxs_ssp *ssp = &host->ssp;
 
+	if (mmc->caps & MMC_CAP_NONREMOVABLE)
+		return 1;
+
 	return !(readl(ssp->base + HW_SSP_STATUS(ssp)) &
 		 BM_SSP_STATUS_CARD_DETECT);
 }
@@ -691,6 +694,9 @@ static int mxs_mmc_probe(struct platform_device *pdev)
 	if (flags & OF_GPIO_ACTIVE_LOW)
 		host->wp_inverted = 1;
 
+	if (of_find_property(np, "non-removable", NULL))
+		mmc->caps |= MMC_CAP_NONREMOVABLE;
+
 	mmc->f_min = 400000;
 	mmc->f_max = 288000000;
 	mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
-- 
1.7.10


             reply	other threads:[~2013-04-05  4:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-05  4:18 Alexandre Pereira da Silva [this message]
2013-04-05  6:37 ` [PATCH] mmc: mxs-mmc: Add support for non-removable cards Marek Vasut
2013-04-05  9:57   ` Mark Brown
2013-04-05 16:07     ` Marek Vasut
2013-04-05  9:13 ` Shawn Guo
2013-04-05 11:49   ` Alexandre Pereira da Silva

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1365135518-31549-1-git-send-email-aletes.xgr@gmail.com \
    --to=aletes.xgr@gmail.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=cjb@laptop.org \
    --cc=fabio.estevam@freescale.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=otavio@ossystems.com.br \
    --cc=shawn.guo@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox