From: Marc Reilly <marc@cpdesign.com.au>
To: linux-arm-kernel@lists.infradead.org
Cc: "Zhu Richard-R65037" <r65037@freescale.com>,
linux-mmc@vger.kernel.org, "Wolfram Sang" <w.sang@pengutronix.de>,
kernel@pengutronix.de, "Eric Bénard" <eric@eukrea.com>
Subject: Re: [PATCH 1/5] mmc: sdhci-esdhc-imx: add support for write protect on custom GPIO
Date: Fri, 11 Feb 2011 09:24:38 +1100 [thread overview]
Message-ID: <201102110924.38338.marc@cpdesign.com.au> (raw)
In-Reply-To: <1297365291-1038-2-git-send-email-w.sang@pengutronix.de>
Hi Wolfram,
First three patches work well on my vpr200 board (mx35).
One comment inline...
I ran some tests of insert/remove card with the card locked and unlocked, and
trying to append a file. It behaved as expected, thus:
Tested-by: Marc Reilly <marc@cpdesign.com.au>
> +static unsigned int esdhc_pltfm_get_ro(struct sdhci_host *host)
> +{
> + struct esdhc_platform_data *boarddata = host->mmc->parent->platform_data;
> +
> + if (boarddata && gpio_is_valid(boarddata->wp_gpio))
> + return gpio_get_value(boarddata->wp_gpio);
> + else
> + return -ENOSYS;
> +}
> +
..snip..
> @@ -116,9 +139,20 @@ static int esdhc_pltfm_init(struct sdhci_host *host,
> struct sdhci_pltfm_data *pd if (cpu_is_mx35() || cpu_is_mx51())
> host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
>
> - /* Fix errata ENGcm07207 which is present on i.MX25 and i.MX35 */
> - if (cpu_is_mx25() || cpu_is_mx35())
> + if (cpu_is_mx25() || cpu_is_mx35()) {
> + /* Fix errata ENGcm07207 present on i.MX25 and i.MX35 */
> host->quirks |= SDHCI_QUIRK_NO_MULTIBLOCK;
> + /* write_protect can't be routed to controller, use gpio */
> + sdhci_esdhc_ops.get_ro = esdhc_pltfm_get_ro;
> + }
> +
> + if (boarddata) {
Perhaps (boarddata && gpio_is_valid(boarddata->wp_gpio) as above?
For example what if someone sets up the boarddata for a card detect, but not
write protect.
> + err = gpio_request_one(boarddata->wp_gpio, GPIOF_IN, "ESDHC_WP");
> + if (err) {
> + dev_warn(mmc_dev(host->mmc), "can't get wp_pin!\n");
> + boarddata->wp_gpio = err;
> + }
> + }
>
> return 0;
> }
Cheers,
Marc
WARNING: multiple messages have this Message-ID (diff)
From: marc@cpdesign.com.au (Marc Reilly)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/5] mmc: sdhci-esdhc-imx: add support for write protect on custom GPIO
Date: Fri, 11 Feb 2011 09:24:38 +1100 [thread overview]
Message-ID: <201102110924.38338.marc@cpdesign.com.au> (raw)
In-Reply-To: <1297365291-1038-2-git-send-email-w.sang@pengutronix.de>
Hi Wolfram,
First three patches work well on my vpr200 board (mx35).
One comment inline...
I ran some tests of insert/remove card with the card locked and unlocked, and
trying to append a file. It behaved as expected, thus:
Tested-by: Marc Reilly <marc@cpdesign.com.au>
> +static unsigned int esdhc_pltfm_get_ro(struct sdhci_host *host)
> +{
> + struct esdhc_platform_data *boarddata = host->mmc->parent->platform_data;
> +
> + if (boarddata && gpio_is_valid(boarddata->wp_gpio))
> + return gpio_get_value(boarddata->wp_gpio);
> + else
> + return -ENOSYS;
> +}
> +
..snip..
> @@ -116,9 +139,20 @@ static int esdhc_pltfm_init(struct sdhci_host *host,
> struct sdhci_pltfm_data *pd if (cpu_is_mx35() || cpu_is_mx51())
> host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
>
> - /* Fix errata ENGcm07207 which is present on i.MX25 and i.MX35 */
> - if (cpu_is_mx25() || cpu_is_mx35())
> + if (cpu_is_mx25() || cpu_is_mx35()) {
> + /* Fix errata ENGcm07207 present on i.MX25 and i.MX35 */
> host->quirks |= SDHCI_QUIRK_NO_MULTIBLOCK;
> + /* write_protect can't be routed to controller, use gpio */
> + sdhci_esdhc_ops.get_ro = esdhc_pltfm_get_ro;
> + }
> +
> + if (boarddata) {
Perhaps (boarddata && gpio_is_valid(boarddata->wp_gpio) as above?
For example what if someone sets up the boarddata for a card detect, but not
write protect.
> + err = gpio_request_one(boarddata->wp_gpio, GPIOF_IN, "ESDHC_WP");
> + if (err) {
> + dev_warn(mmc_dev(host->mmc), "can't get wp_pin!\n");
> + boarddata->wp_gpio = err;
> + }
> + }
>
> return 0;
> }
Cheers,
Marc
next prev parent reply other threads:[~2011-02-10 22:24 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-10 19:14 [PATCH 0/5] sdhci-esdhc-imx: use gpio for write protection and card detection Wolfram Sang
2011-02-10 19:14 ` Wolfram Sang
2011-02-10 19:14 ` [PATCH 1/5] mmc: sdhci-esdhc-imx: add support for write protect on custom GPIO Wolfram Sang
2011-02-10 19:14 ` Wolfram Sang
2011-02-10 22:24 ` Marc Reilly [this message]
2011-02-10 22:24 ` Marc Reilly
2011-02-11 9:42 ` Wolfram Sang
2011-02-11 9:42 ` Wolfram Sang
2011-02-10 19:14 ` [PATCH 2/5] mmc: sdhci-esdhc: broken card detection is not a default quirk Wolfram Sang
2011-02-10 19:14 ` Wolfram Sang
2011-02-10 19:18 ` Wolfram Sang
2011-02-10 19:18 ` Wolfram Sang
2011-02-11 10:07 ` Anton Vorontsov
2011-02-11 10:07 ` Anton Vorontsov
2011-02-10 19:14 ` [PATCH 3/5] mmc: sdhci-esdhc-imx: add card detect on custom GPIO Wolfram Sang
2011-02-10 19:14 ` Wolfram Sang
2011-02-10 19:14 ` [PATCH 4/5] arm: mach-mx3: pcm043: add write-protect and card-detect for SD1 Wolfram Sang
2011-02-10 19:14 ` Wolfram Sang
2011-02-10 19:14 ` [PATCH 5/5] arm: mach-mx3: use IMX_GPIO_NR instead of hard-coded values Wolfram Sang
2011-02-10 19:14 ` Wolfram Sang
-- strict thread matches above, loose matches on Subject: below --
2011-02-22 12:58 [PATCH V2 0/5] sdhci-esdhc-imx: use gpio for write protection and card detection Wolfram Sang
2011-02-22 12:58 ` [PATCH 1/5] mmc: sdhci-esdhc-imx: add support for write protect on custom GPIO Wolfram Sang
2011-02-22 12:58 ` Wolfram Sang
2011-02-23 13:51 [PATCH V3 0/5] sdhci-esdhc-imx: use gpio for write protection and card detection Wolfram Sang
2011-02-23 13:51 ` [PATCH 1/5] mmc: sdhci-esdhc-imx: add support for write protect on custom GPIO Wolfram Sang
2011-02-23 13:51 ` Wolfram Sang
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=201102110924.38338.marc@cpdesign.com.au \
--to=marc@cpdesign.com.au \
--cc=eric@eukrea.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mmc@vger.kernel.org \
--cc=r65037@freescale.com \
--cc=w.sang@pengutronix.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.