All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Dietich <marvin24-Mmb7MZpHnFY@public.gmane.org>
To: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Cc: Grant Likely
	<grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>,
	Chris Ball <cjb-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.org>,
	Olof Johansson <olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org>,
	Shawn Guo <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 1/2] sdhci/tegra: Add Device Tree probing support
Date: Tue, 30 Aug 2011 09:52:01 +0200	[thread overview]
Message-ID: <201108300952.02418.marvin24@gmx.de> (raw)
In-Reply-To: <1314123334-23133-1-git-send-email-swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

Hi,

just a small question,

> From: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>

[...]

> diff --git a/Documentation/devicetree/bindings/mmc/nvidia-sdhci.txt
> b/Documentation/devicetree/bindings/mmc/nvidia-sdhci.txt new file mode
> 100644
> index 0000000..c87f667
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mmc/nvidia-sdhci.txt
> @@ -0,0 +1,25 @@
> +* NVIDIA Tegra Secure Digital Host Controller
> +
> +This controller on Tegra family SoCs provides an interface for MMC, SD,
> +and SDIO types of memory cards.
> +
> +Required properties:
> +- compatible : Should be "nvidia,<chip>-sdhci"
> +- reg : Should contain eSDHC registers location and length
> +- interrupts : Should contain eSDHC interrupt
> +
> +Optional properties:
> +- cd-gpios : Specify GPIOs for card detection
> +- wp-gpios : Specify GPIOs for write protection
> +- power-gpios : Specify GPIOs for power control
> +
> +Example:
> +
> +sdhci@c8000200 {
> +	compatible = "nvidia,tegra20-sdhci";
> +	reg = <0xc8000200 0x200>;
> +	interrupts = <47>;
> +	cd-gpios = <&gpio 69 0>; /* gpio PI5 */
> +	wp-gpios = <&gpio 57 0>; /* gpio PH1 */
> +	power-gpios = <&gpio 155 0>; /* gpio PT3 */
> +};
> diff --git a/drivers/mmc/host/sdhci-tegra.c
> b/drivers/mmc/host/sdhci-tegra.c index a5a9a97..9ab18d6 100644
> --- a/drivers/mmc/host/sdhci-tegra.c
> +++ b/drivers/mmc/host/sdhci-tegra.c
> @@ -17,6 +17,7 @@
>  #include <linux/platform_device.h>
>  #include <linux/clk.h>
>  #include <linux/io.h>
> +#include <linux/of_gpio.h>
>  #include <linux/gpio.h>
>  #include <linux/mmc/card.h>
>  #include <linux/mmc/host.h>
> @@ -74,10 +75,8 @@ static void tegra_sdhci_writel(struct sdhci_host *host,
> u32 val, int reg)
> 
>  static unsigned int tegra_sdhci_get_ro(struct sdhci_host *sdhci)
>  {
> -	struct platform_device *pdev = to_platform_device(mmc_dev(sdhci->mmc));
> -	struct tegra_sdhci_platform_data *plat;
> -
> -	plat = pdev->dev.platform_data;
> +	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(sdhci);
> +	struct tegra_sdhci_platform_data *plat = pltfm_host->priv;
> 
>  	if (!gpio_is_valid(plat->wp_gpio))
>  		return -1;
> @@ -95,12 +94,10 @@ static irqreturn_t carddetect_irq(int irq, void *data)
> 
>  static int tegra_sdhci_8bit(struct sdhci_host *host, int bus_width)
>  {
> -	struct platform_device *pdev = to_platform_device(mmc_dev(host->mmc));
> -	struct tegra_sdhci_platform_data *plat;
> +	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
> +	struct tegra_sdhci_platform_data *plat = pltfm_host->priv;
>  	u32 ctrl;
> 
> -	plat = pdev->dev.platform_data;
> -
>  	ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
>  	if (plat->is_8bit && bus_width == MMC_BUS_WIDTH_8) {
>  		ctrl &= ~SDHCI_CTRL_4BITBUS;

what about 8 bit support? 

> @@ -132,6 +129,34 @@ static struct sdhci_pltfm_data sdhci_tegra_pdata = {
>  	.ops  = &tegra_sdhci_ops,
>  };
> 
> +static const struct of_device_id sdhci_tegra_dt_match[] __devinitdata = {
> +	{ .compatible = "nvidia,tegra20-sdhci", },
> +	{}
> +};
> +MODULE_DEVICE_TABLE(of, sdhci_dt_ids);
> +
> +static struct tegra_sdhci_platform_data * __devinit
> sdhci_tegra_dt_parse_pdata( +						struct platform_device *pdev)
> +{
> +	struct tegra_sdhci_platform_data *plat;
> +	struct device_node *np = pdev->dev.of_node;
> +
> +	if (!np)
> +		return NULL;
> +
> +	plat = devm_kzalloc(&pdev->dev, sizeof(*plat), GFP_KERNEL);
> +	if (!plat) {
> +		dev_err(&pdev->dev, "Can't allocate platform data\n");
> +		return NULL;
> +	}
> +
> +	plat->cd_gpio = of_get_named_gpio(np, "cd-gpios", 0);
> +	plat->wp_gpio = of_get_named_gpio(np, "wp-gpios", 0);
> +	plat->power_gpio = of_get_named_gpio(np, "power-gpios", 0);
> +
> +	return plat;
> +}

[...]

WARNING: multiple messages have this Message-ID (diff)
From: marvin24@gmx.de (Marc Dietich)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] sdhci/tegra: Add Device Tree probing support
Date: Tue, 30 Aug 2011 09:52:01 +0200	[thread overview]
Message-ID: <201108300952.02418.marvin24@gmx.de> (raw)
In-Reply-To: <1314123334-23133-1-git-send-email-swarren@nvidia.com>

Hi,

just a small question,

> From: Grant Likely <grant.likely@secretlab.ca>

[...]

> diff --git a/Documentation/devicetree/bindings/mmc/nvidia-sdhci.txt
> b/Documentation/devicetree/bindings/mmc/nvidia-sdhci.txt new file mode
> 100644
> index 0000000..c87f667
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mmc/nvidia-sdhci.txt
> @@ -0,0 +1,25 @@
> +* NVIDIA Tegra Secure Digital Host Controller
> +
> +This controller on Tegra family SoCs provides an interface for MMC, SD,
> +and SDIO types of memory cards.
> +
> +Required properties:
> +- compatible : Should be "nvidia,<chip>-sdhci"
> +- reg : Should contain eSDHC registers location and length
> +- interrupts : Should contain eSDHC interrupt
> +
> +Optional properties:
> +- cd-gpios : Specify GPIOs for card detection
> +- wp-gpios : Specify GPIOs for write protection
> +- power-gpios : Specify GPIOs for power control
> +
> +Example:
> +
> +sdhci at c8000200 {
> +	compatible = "nvidia,tegra20-sdhci";
> +	reg = <0xc8000200 0x200>;
> +	interrupts = <47>;
> +	cd-gpios = <&gpio 69 0>; /* gpio PI5 */
> +	wp-gpios = <&gpio 57 0>; /* gpio PH1 */
> +	power-gpios = <&gpio 155 0>; /* gpio PT3 */
> +};
> diff --git a/drivers/mmc/host/sdhci-tegra.c
> b/drivers/mmc/host/sdhci-tegra.c index a5a9a97..9ab18d6 100644
> --- a/drivers/mmc/host/sdhci-tegra.c
> +++ b/drivers/mmc/host/sdhci-tegra.c
> @@ -17,6 +17,7 @@
>  #include <linux/platform_device.h>
>  #include <linux/clk.h>
>  #include <linux/io.h>
> +#include <linux/of_gpio.h>
>  #include <linux/gpio.h>
>  #include <linux/mmc/card.h>
>  #include <linux/mmc/host.h>
> @@ -74,10 +75,8 @@ static void tegra_sdhci_writel(struct sdhci_host *host,
> u32 val, int reg)
> 
>  static unsigned int tegra_sdhci_get_ro(struct sdhci_host *sdhci)
>  {
> -	struct platform_device *pdev = to_platform_device(mmc_dev(sdhci->mmc));
> -	struct tegra_sdhci_platform_data *plat;
> -
> -	plat = pdev->dev.platform_data;
> +	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(sdhci);
> +	struct tegra_sdhci_platform_data *plat = pltfm_host->priv;
> 
>  	if (!gpio_is_valid(plat->wp_gpio))
>  		return -1;
> @@ -95,12 +94,10 @@ static irqreturn_t carddetect_irq(int irq, void *data)
> 
>  static int tegra_sdhci_8bit(struct sdhci_host *host, int bus_width)
>  {
> -	struct platform_device *pdev = to_platform_device(mmc_dev(host->mmc));
> -	struct tegra_sdhci_platform_data *plat;
> +	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
> +	struct tegra_sdhci_platform_data *plat = pltfm_host->priv;
>  	u32 ctrl;
> 
> -	plat = pdev->dev.platform_data;
> -
>  	ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
>  	if (plat->is_8bit && bus_width == MMC_BUS_WIDTH_8) {
>  		ctrl &= ~SDHCI_CTRL_4BITBUS;

what about 8 bit support? 

> @@ -132,6 +129,34 @@ static struct sdhci_pltfm_data sdhci_tegra_pdata = {
>  	.ops  = &tegra_sdhci_ops,
>  };
> 
> +static const struct of_device_id sdhci_tegra_dt_match[] __devinitdata = {
> +	{ .compatible = "nvidia,tegra20-sdhci", },
> +	{}
> +};
> +MODULE_DEVICE_TABLE(of, sdhci_dt_ids);
> +
> +static struct tegra_sdhci_platform_data * __devinit
> sdhci_tegra_dt_parse_pdata( +						struct platform_device *pdev)
> +{
> +	struct tegra_sdhci_platform_data *plat;
> +	struct device_node *np = pdev->dev.of_node;
> +
> +	if (!np)
> +		return NULL;
> +
> +	plat = devm_kzalloc(&pdev->dev, sizeof(*plat), GFP_KERNEL);
> +	if (!plat) {
> +		dev_err(&pdev->dev, "Can't allocate platform data\n");
> +		return NULL;
> +	}
> +
> +	plat->cd_gpio = of_get_named_gpio(np, "cd-gpios", 0);
> +	plat->wp_gpio = of_get_named_gpio(np, "wp-gpios", 0);
> +	plat->power_gpio = of_get_named_gpio(np, "power-gpios", 0);
> +
> +	return plat;
> +}

[...]

WARNING: multiple messages have this Message-ID (diff)
From: Marc Dietich <marvin24@gmx.de>
To: Stephen Warren <swarren@nvidia.com>
Cc: Grant Likely <grant.likely@secretlab.ca>,
	Chris Ball <cjb@laptop.org>, Olof Johansson <olof@lixom.net>,
	Shawn Guo <shawn.guo@linaro.org>,
	linux-mmc@vger.kernel.org, linux-tegra@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	devicetree-discuss@lists.ozlabs.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] sdhci/tegra: Add Device Tree probing support
Date: Tue, 30 Aug 2011 09:52:01 +0200	[thread overview]
Message-ID: <201108300952.02418.marvin24@gmx.de> (raw)
In-Reply-To: <1314123334-23133-1-git-send-email-swarren@nvidia.com>

Hi,

just a small question,

> From: Grant Likely <grant.likely@secretlab.ca>

[...]

> diff --git a/Documentation/devicetree/bindings/mmc/nvidia-sdhci.txt
> b/Documentation/devicetree/bindings/mmc/nvidia-sdhci.txt new file mode
> 100644
> index 0000000..c87f667
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mmc/nvidia-sdhci.txt
> @@ -0,0 +1,25 @@
> +* NVIDIA Tegra Secure Digital Host Controller
> +
> +This controller on Tegra family SoCs provides an interface for MMC, SD,
> +and SDIO types of memory cards.
> +
> +Required properties:
> +- compatible : Should be "nvidia,<chip>-sdhci"
> +- reg : Should contain eSDHC registers location and length
> +- interrupts : Should contain eSDHC interrupt
> +
> +Optional properties:
> +- cd-gpios : Specify GPIOs for card detection
> +- wp-gpios : Specify GPIOs for write protection
> +- power-gpios : Specify GPIOs for power control
> +
> +Example:
> +
> +sdhci@c8000200 {
> +	compatible = "nvidia,tegra20-sdhci";
> +	reg = <0xc8000200 0x200>;
> +	interrupts = <47>;
> +	cd-gpios = <&gpio 69 0>; /* gpio PI5 */
> +	wp-gpios = <&gpio 57 0>; /* gpio PH1 */
> +	power-gpios = <&gpio 155 0>; /* gpio PT3 */
> +};
> diff --git a/drivers/mmc/host/sdhci-tegra.c
> b/drivers/mmc/host/sdhci-tegra.c index a5a9a97..9ab18d6 100644
> --- a/drivers/mmc/host/sdhci-tegra.c
> +++ b/drivers/mmc/host/sdhci-tegra.c
> @@ -17,6 +17,7 @@
>  #include <linux/platform_device.h>
>  #include <linux/clk.h>
>  #include <linux/io.h>
> +#include <linux/of_gpio.h>
>  #include <linux/gpio.h>
>  #include <linux/mmc/card.h>
>  #include <linux/mmc/host.h>
> @@ -74,10 +75,8 @@ static void tegra_sdhci_writel(struct sdhci_host *host,
> u32 val, int reg)
> 
>  static unsigned int tegra_sdhci_get_ro(struct sdhci_host *sdhci)
>  {
> -	struct platform_device *pdev = to_platform_device(mmc_dev(sdhci->mmc));
> -	struct tegra_sdhci_platform_data *plat;
> -
> -	plat = pdev->dev.platform_data;
> +	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(sdhci);
> +	struct tegra_sdhci_platform_data *plat = pltfm_host->priv;
> 
>  	if (!gpio_is_valid(plat->wp_gpio))
>  		return -1;
> @@ -95,12 +94,10 @@ static irqreturn_t carddetect_irq(int irq, void *data)
> 
>  static int tegra_sdhci_8bit(struct sdhci_host *host, int bus_width)
>  {
> -	struct platform_device *pdev = to_platform_device(mmc_dev(host->mmc));
> -	struct tegra_sdhci_platform_data *plat;
> +	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
> +	struct tegra_sdhci_platform_data *plat = pltfm_host->priv;
>  	u32 ctrl;
> 
> -	plat = pdev->dev.platform_data;
> -
>  	ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
>  	if (plat->is_8bit && bus_width == MMC_BUS_WIDTH_8) {
>  		ctrl &= ~SDHCI_CTRL_4BITBUS;

what about 8 bit support? 

> @@ -132,6 +129,34 @@ static struct sdhci_pltfm_data sdhci_tegra_pdata = {
>  	.ops  = &tegra_sdhci_ops,
>  };
> 
> +static const struct of_device_id sdhci_tegra_dt_match[] __devinitdata = {
> +	{ .compatible = "nvidia,tegra20-sdhci", },
> +	{}
> +};
> +MODULE_DEVICE_TABLE(of, sdhci_dt_ids);
> +
> +static struct tegra_sdhci_platform_data * __devinit
> sdhci_tegra_dt_parse_pdata( +						struct platform_device *pdev)
> +{
> +	struct tegra_sdhci_platform_data *plat;
> +	struct device_node *np = pdev->dev.of_node;
> +
> +	if (!np)
> +		return NULL;
> +
> +	plat = devm_kzalloc(&pdev->dev, sizeof(*plat), GFP_KERNEL);
> +	if (!plat) {
> +		dev_err(&pdev->dev, "Can't allocate platform data\n");
> +		return NULL;
> +	}
> +
> +	plat->cd_gpio = of_get_named_gpio(np, "cd-gpios", 0);
> +	plat->wp_gpio = of_get_named_gpio(np, "wp-gpios", 0);
> +	plat->power_gpio = of_get_named_gpio(np, "power-gpios", 0);
> +
> +	return plat;
> +}

[...]

  parent reply	other threads:[~2011-08-30  7:52 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-23 18:15 [PATCH 1/2] sdhci/tegra: Add Device Tree probing support Stephen Warren
2011-08-23 18:15 ` Stephen Warren
2011-08-23 18:15 ` Stephen Warren
2011-08-23 18:41 ` Chris Ball
2011-08-23 18:41   ` Chris Ball
     [not found] ` <1314123334-23133-1-git-send-email-swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-08-23 18:15   ` [PATCH 2/2] arm/dt: Tegra: Update SDHCI nodes to match bindings Stephen Warren
2011-08-23 18:15     ` Stephen Warren
2011-08-23 18:15     ` Stephen Warren
     [not found]     ` <1314123334-23133-2-git-send-email-swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-08-26  5:19       ` Olof Johansson
2011-08-26  5:19         ` Olof Johansson
2011-08-26  5:19         ` Olof Johansson
2011-08-26  5:19   ` [PATCH 1/2] sdhci/tegra: Add Device Tree probing support Olof Johansson
2011-08-26  5:19     ` Olof Johansson
2011-08-26  5:19     ` Olof Johansson
2011-08-30  7:52   ` Marc Dietich [this message]
2011-08-30  7:52     ` Marc Dietich
2011-08-30  7:52     ` Marc Dietich
     [not found]     ` <201108300952.02418.marvin24-Mmb7MZpHnFY@public.gmane.org>
2011-08-30 16:17       ` Stephen Warren
2011-08-30 16:17         ` Stephen Warren
2011-08-30 16:17         ` Stephen Warren
2011-08-30  3:40 ` Shawn Guo
2011-08-30  3:40   ` Shawn Guo
2011-08-30  3:40   ` Shawn Guo
2011-08-30 16:01   ` Stephen Warren
2011-08-30 16:01     ` Stephen Warren
2011-08-31  2:49     ` Shawn Guo
2011-08-31  2:49       ` Shawn Guo

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=201108300952.02418.marvin24@gmx.de \
    --to=marvin24-mmb7mzphnfy@public.gmane.org \
    --cc=cjb-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org \
    --cc=shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.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 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.