public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Rapoport <mike@compulab.co.il>
To: Olof Johansson <olof@lixom.net>
Cc: Chris Ball <cjb@laptop.org>, Wolfram Sang <w.sang@pengutronix.de>,
	linux-mmc@vger.kernel.org, linux-tegra@vger.kernel.org,
	Yvonne Yip <y@palm.com>
Subject: Re: [PATCH 3/3] mmc: add sdhci-tegra driver for Tegra SoCs
Date: Thu, 23 Dec 2010 08:20:58 +0200	[thread overview]
Message-ID: <4D12EA4A.4000906@compulab.co.il> (raw)
In-Reply-To: <1293004871-1918-4-git-send-email-olof@lixom.net>

On 12/22/10 10:01, Olof Johansson wrote:
> SDHCI driver for Tegra. Pretty straight forward, a few pieces of
> functionality left to fill in but nothing that stops it from going
> upstream. Board enablement submitted separately.
> 
> This driver plugs in as a new variant of sdhci-pltfm, using the platform
> data structure passed in to specify the GPIOs to use for card detect,
> write protect and card power enablement.
> 
> Original driver (of which only the header file is left):
> Signed-off-by: Yvonne Yip <y@palm.com>
> 
> The rest, which has been rewritten by now:
> Signed-off-by: Olof Johansson <olof@lixom.net>
> Cc: Wolfram Sang <w.sang@pengutronix.de>
> Cc: Mike Rapoport <mike@compulab.co.il>

Only one comment below, otherwise feel free to add
Acked-by: Mike Rapoport <mike@compulab.co.il>

> ---
> 
>  arch/arm/mach-tegra/include/mach/sdhci.h |   28 ++++
>  drivers/mmc/host/Kconfig                 |   10 ++
>  drivers/mmc/host/Makefile                |    1 +
>  drivers/mmc/host/sdhci-pltfm.c           |    3 +
>  drivers/mmc/host/sdhci-pltfm.h           |    1 +
>  drivers/mmc/host/sdhci-tegra.c           |  219 ++++++++++++++++++++++++++++++
>  6 files changed, 262 insertions(+), 0 deletions(-)
>  create mode 100644 arch/arm/mach-tegra/include/mach/sdhci.h
>  create mode 100644 drivers/mmc/host/sdhci-tegra.c
> 

[ snip ]

> +	if (gpio_is_valid(plat->wp_gpio)) {
> +		rc = gpio_request(plat->wp_gpio, "sdhci_wp");
> +		if (rc) {
> +			dev_err(mmc_dev(host->mmc), 
> +				"failed to allocate wp gpio\n");
> +			goto out_cd;
> +		}
> +		tegra_gpio_enable(plat->wp_gpio);

gpio_direction_input?

> +	}
> +
> +	clk = clk_get(mmc_dev(host->mmc), NULL);
> +	if (IS_ERR(clk)) {
> +		dev_err(mmc_dev(host->mmc), "clk err\n");
> +		rc = PTR_ERR(clk);
> +		goto out_wp;
> +	}
> +	clk_enable(clk);
> +	pltfm_host->clk = clk;
> +
> +	return 0;
> +
> +out_wp:
> +	if (gpio_is_valid(plat->wp_gpio)) {
> +		tegra_gpio_disable(plat->wp_gpio);
> +		gpio_free(plat->wp_gpio);
> +	}
> +
> +out_cd:
> +	if (gpio_is_valid(plat->cd_gpio)) {
> +		tegra_gpio_disable(plat->cd_gpio);
> +		gpio_free(plat->cd_gpio);
> +	}
> +
> +out_power:
> +	if (gpio_is_valid(plat->power_gpio)) {
> +		tegra_gpio_disable(plat->power_gpio);
> +		gpio_free(plat->power_gpio);
> +	}
> +
> +out:
> +	return rc;
> +}
> +
> +static void tegra_sdhci_pltfm_exit(struct sdhci_host *host)
> +{
> +	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
> +	struct platform_device *pdev = to_platform_device(mmc_dev(host->mmc));
> +	struct tegra_sdhci_platform_data *plat;
> +
> +	plat = pdev->dev.platform_data;
> +
> +	if (gpio_is_valid(plat->wp_gpio)) {
> +		tegra_gpio_disable(plat->wp_gpio);
> +		gpio_free(plat->wp_gpio);
> +	}
> +
> +	if (gpio_is_valid(plat->cd_gpio)) {
> +		tegra_gpio_disable(plat->cd_gpio);
> +		gpio_free(plat->cd_gpio);
> +	}
> +
> +	if (gpio_is_valid(plat->power_gpio)) {
> +		tegra_gpio_disable(plat->power_gpio);
> +		gpio_free(plat->power_gpio);
> +	}
> +
> +	clk_disable(pltfm_host->clk);
> +	clk_put(pltfm_host->clk);
> +}
> +
> +static struct sdhci_ops tegra_sdhci_ops = {
> +	.get_ro     = tegra_sdhci_get_ro,
> +	.read_l     = tegra_sdhci_readl,
> +	.read_w     = tegra_sdhci_readw,
> +	.write_l    = tegra_sdhci_writel,
> +};
> +
> +struct sdhci_pltfm_data sdhci_tegra_pdata = {
> +	.quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL |
> +		  SDHCI_QUIRK_SINGLE_POWER_WRITE |
> +		  SDHCI_QUIRK_NO_HISPD_BIT |
> +		  SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC,
> +	.ops  = &tegra_sdhci_ops,
> +	.init = tegra_sdhci_pltfm_init,
> +	.exit = tegra_sdhci_pltfm_exit,
> +};


-- 
Sincerely yours,
Mike.

  parent reply	other threads:[~2010-12-23  6:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-22  8:01 [PATCH 0/3 v2] Add SDHCI driver for Tegra Olof Johansson
2010-12-22  8:01 ` [PATCH 1/3] sdhci: add quirk for max len ADMA descriptors Olof Johansson
2010-12-22  8:01 ` [PATCH 2/3] sdhci: don't finish commands in flight Olof Johansson
2010-12-22  8:08   ` Chris Ball
2010-12-22  9:38     ` Olof Johansson
2010-12-22  8:01 ` [PATCH 3/3] mmc: add sdhci-tegra driver for Tegra SoCs Olof Johansson
2010-12-22 16:22   ` Wolfram Sang
2010-12-22 19:22     ` Olof Johansson
2010-12-23  6:20   ` Mike Rapoport [this message]
2010-12-23  8:59     ` Olof Johansson
2010-12-22  8:06 ` [PATCH 0/3 v2] Add SDHCI driver for Tegra Chris Ball
2010-12-22 16:05 ` Wolfram Sang
2010-12-22 20:48   ` Olof Johansson

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=4D12EA4A.4000906@compulab.co.il \
    --to=mike@compulab.co.il \
    --cc=cjb@laptop.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=olof@lixom.net \
    --cc=w.sang@pengutronix.de \
    --cc=y@palm.com \
    /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