From: daniel@caiaq•de (Daniel Mack)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH 09/13] mxcmmc: add card detect through DAT3 possibility
Date: Wed, 19 May 2010 19:11:41 +0200 [thread overview]
Message-ID: <20100519171141.GW30801@buzzloop.caiaq.de> (raw)
In-Reply-To: <1274287568-30253-9-git-send-email-eric@eukrea.com>
On Wed, May 19, 2010 at 06:46:04PM +0200, Eric B?nard wrote:
> Signed-off-by: Eric B?nard <eric@eukrea•com>
> ---
> arch/arm/plat-mxc/include/mach/mmc.h | 3 +++
> drivers/mmc/host/mxcmmc.c | 16 +++++++++++++---
> 2 files changed, 16 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/plat-mxc/include/mach/mmc.h b/arch/arm/plat-mxc/include/mach/mmc.h
> index de2128d..29115f4 100644
> --- a/arch/arm/plat-mxc/include/mach/mmc.h
> +++ b/arch/arm/plat-mxc/include/mach/mmc.h
> @@ -31,6 +31,9 @@ struct imxmmc_platform_data {
>
> /* adjust slot voltage */
> void (*setpower)(struct device *, unsigned int vdd);
> +
> + /* enable card detect using DAT3 */
> + int dat3_card_detect;
> };
>
> #endif
> diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c
> index ec18e3b..74c87e0 100644
> --- a/drivers/mmc/host/mxcmmc.c
> +++ b/drivers/mmc/host/mxcmmc.c
> @@ -119,6 +119,7 @@ struct mxcmci_host {
> int detect_irq;
> int dma;
> int do_dma;
> + int default_irq_mask;
> int use_sdio;
> unsigned int power_mode;
> struct imxmmc_platform_data *pdata;
> @@ -228,7 +229,7 @@ static int mxcmci_setup_data(struct mxcmci_host *host, struct mmc_data *data)
> static int mxcmci_start_cmd(struct mxcmci_host *host, struct mmc_command *cmd,
> unsigned int cmdat)
> {
> - u32 int_cntr;
> + u32 int_cntr = host->default_irq_mask;
> unsigned long flags;
>
> WARN_ON(host->cmd != NULL);
> @@ -275,7 +276,7 @@ static int mxcmci_start_cmd(struct mxcmci_host *host, struct mmc_command *cmd,
> static void mxcmci_finish_request(struct mxcmci_host *host,
> struct mmc_request *req)
> {
> - u32 int_cntr = 0;
> + u32 int_cntr = host->default_irq_mask;
> unsigned long flags;
>
> spin_lock_irqsave(&host->lock, flags);
> @@ -585,6 +586,9 @@ static irqreturn_t mxcmci_irq(int irq, void *devid)
> (stat & (STATUS_DATA_TRANS_DONE | STATUS_WRITE_OP_DONE)))
> mxcmci_data_done(host, stat);
> #endif
> + if (host->default_irq_mask &&
> + (stat & (STATUS_CARD_INSERTION | STATUS_CARD_REMOVAL)))
> + mmc_detect_change(host->mmc, msecs_to_jiffies(200));
> return IRQ_HANDLED;
> }
>
> @@ -809,6 +813,12 @@ static int mxcmci_probe(struct platform_device *pdev)
> else
> mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
>
> + if (host->pdata && host->pdata->dat3_card_detect)
As 0 is a valid GPIO, so you should use gpio_is_valid() here, and update
all users' pdata to set dat3_card_detect = -1, so it will fail this
test.
Daniel
next prev parent reply other threads:[~2010-05-19 17:11 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-19 16:45 [PATCH 01/13] eukrea_mbimx27-baseboard: fix typo in display name Eric Bénard
2010-05-19 16:45 ` [PATCH 02/13] eukrea_mbimx27-baseboard: add generic-bl and platform-lcd controls Eric Bénard
2010-05-19 16:45 ` [PATCH 03/13] eukrea_mbimx27-baseboard: add timings for DVI output Eric Bénard
2010-05-19 16:45 ` [PATCH 04/13] cpuimx27 and mbimx27: allow fine control of UART4 and SDHC2 usage Eric Bénard
2010-05-19 16:46 ` [PATCH 05/13] mach-cpuimx27: fix QuadUART's IRQ typo in pins'setup Eric Bénard
2010-05-19 16:46 ` [PATCH 06/13] eukrea_mbimx27: fix ADS7846 support Eric Bénard
2010-05-19 16:46 ` [PATCH 07/13] mach-cpuimx27: add USB Host2 and OTG support Eric Bénard
2010-05-19 16:46 ` [PATCH 08/13] mach-cpuimx27: register wdt and w1_master resources Eric Bénard
2010-05-19 16:46 ` [PATCH 09/13] mxcmmc: add card detect through DAT3 possibility Eric Bénard
2010-05-19 16:46 ` [PATCH 10/13] eukrea_mbimx27: use card detect through DAT3 for SDHC1 Eric Bénard
2010-05-19 16:46 ` [PATCH 11/13] MX2X: Add Keypad device definition for MX2X arch Eric Bénard
2010-05-19 16:46 ` [PATCH 12/13] eukrea_mbimx27: add support for the keyboard Eric Bénard
2010-05-19 16:46 ` [PATCH 13/13] mx27_defconfig: update to enable cpuimx27 & mbimx27 Eric Bénard
2010-05-19 17:11 ` Daniel Mack [this message]
2010-05-19 17:21 ` [PATCH 09/13] mxcmmc: add card detect through DAT3 possibility Eric Bénard
2010-05-19 17:23 ` Daniel Mack
2010-05-27 17:54 ` [PATCH] " Eric Bénard
2010-05-20 6:39 ` [PATCH 06/13] eukrea_mbimx27: fix ADS7846 support Sascha Hauer
2010-05-20 7:22 ` [PATCH v2] " Eric Bénard
2010-05-20 6:33 ` [PATCH 02/13] eukrea_mbimx27-baseboard: add generic-bl and platform-lcd controls Sascha Hauer
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=20100519171141.GW30801@buzzloop.caiaq.de \
--to=daniel@caiaq$(echo .)de \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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