devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@avionic-design.de>
To: Stephen Warren <swarren@nvidia.com>
Cc: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>,
	Peter De Schrijver <pdeschrijver@nvidia.com>,
	alsa-devel@alsa-project.org, Mike Rapoport <mike@compulab.co.il>,
	devicetree-discuss@lists.ozlabs.org,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Ian Lartey <ian@opensource.wolfsonmicro.com>,
	Rob Herring <rob.herring@calxeda.com>,
	Marc Dietrich <marvin24@gmx.de>,
	Grant Likely <grant.likely@secretlab.ca>,
	linux-tegra@vger.kernel.org, John Bonesio <bones@secretlab.ca>,
	Leon Romanovsky <leon@leon.nu>, Colin Cross <ccross@android.com>,
	Olof Johansson <olof@lixom.net>, Liam Girdwood <lrg@ti.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 11/17] ASoC: Tegra I2S: Add device tree binding
Date: Wed, 23 Nov 2011 08:04:49 +0100	[thread overview]
Message-ID: <20111123070449.GD5255@avionic-0098.adnet.avionic-design.de> (raw)
In-Reply-To: <1322011285-4002-12-git-send-email-swarren@nvidia.com>


[-- Attachment #1.1: Type: text/plain, Size: 4394 bytes --]

* Stephen Warren wrote:
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
>  .../devicetree/bindings/sound/tegra20-i2s.txt      |   16 +++++++++++
>  sound/soc/tegra/tegra_i2s.c                        |   29 ++++++++++++++++---
>  2 files changed, 40 insertions(+), 5 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/sound/tegra20-i2s.txt
> 
> diff --git a/Documentation/devicetree/bindings/sound/tegra20-i2s.txt b/Documentation/devicetree/bindings/sound/tegra20-i2s.txt
> new file mode 100644
> index 0000000..d38abdc
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/tegra20-i2s.txt
> @@ -0,0 +1,16 @@
> +NVIDIA Tegra 20 I2S controller
> +
> +Required properties:
> +- compatible : "nvidia,tegra20-i2s"
> +- reg : Should contain I2S registers location and length
> +- interrupts : Should contain I2S interrupt
> +- dma-channel : The Tegra DMA controller's channel ID for this I2S controller
> +
> +Example:
> +
> +i2s@70002800 {
> +	compatible = "nvidia,tegra20-i2s";
> +	reg = <0x70002800 0x200>;
> +	interrupts = < 45 >;
> +	dma-channel = < 2 >;
> +};
> diff --git a/sound/soc/tegra/tegra_i2s.c b/sound/soc/tegra/tegra_i2s.c
> index 3c0cbd2..b4e19a5 100644
> --- a/sound/soc/tegra/tegra_i2s.c
> +++ b/sound/soc/tegra/tegra_i2s.c
> @@ -36,6 +36,7 @@
>  #include <linux/seq_file.h>
>  #include <linux/slab.h>
>  #include <linux/io.h>
> +#include <linux/of.h>
>  #include <mach/iomap.h>
>  #include <sound/core.h>
>  #include <sound/pcm.h>
> @@ -332,6 +333,7 @@ static __devinit int tegra_i2s_platform_probe(struct platform_device *pdev)
>  	struct tegra_i2s * i2s;
>  	struct resource *mem, *memregion, *dmareq;
>  	int ret;
> +	u32 dma_ch;
>  
>  	i2s = devm_kzalloc(&pdev->dev, sizeof(struct tegra_i2s), GFP_KERNEL);
>  	if (!i2s) {
> @@ -360,9 +362,19 @@ static __devinit int tegra_i2s_platform_probe(struct platform_device *pdev)
>  
>  	dmareq = platform_get_resource(pdev, IORESOURCE_DMA, 0);
>  	if (!dmareq) {
> -		dev_err(&pdev->dev, "No DMA resource\n");
> -		ret = -ENODEV;
> -		goto err_clk_put;
> +		/*
> +		 * FIXME: Perhaps there should be a standard binding for this
> +		 * that ends up creating the IORESOURCE_DMA resource for us.
> +		 */
> +		if (of_property_read_u32(pdev->dev.of_node,
> +					 "nvidia,dma-channels",

The binding documentation says the property is called "nvidia,dma-channel"
but you use "nvidia,dma-channel*s*" here.

> +					 &dma_ch) < 0) {
> +			dev_err(&pdev->dev, "No DMA resource\n");
> +			ret = -ENODEV;
> +			goto err_clk_put;
> +		}
> +	} else {
> +		dma_ch = dmareq->start;
>  	}
>  
>  	memregion = devm_request_mem_region(&pdev->dev, mem->start,
> @@ -383,12 +395,12 @@ static __devinit int tegra_i2s_platform_probe(struct platform_device *pdev)
>  	i2s->capture_dma_data.addr = mem->start + TEGRA_I2S_FIFO2;
>  	i2s->capture_dma_data.wrap = 4;
>  	i2s->capture_dma_data.width = 32;
> -	i2s->capture_dma_data.req_sel = dmareq->start;
> +	i2s->capture_dma_data.req_sel = dma_ch;
>  
>  	i2s->playback_dma_data.addr = mem->start + TEGRA_I2S_FIFO1;
>  	i2s->playback_dma_data.wrap = 4;
>  	i2s->playback_dma_data.width = 32;
> -	i2s->playback_dma_data.req_sel = dmareq->start;
> +	i2s->playback_dma_data.req_sel = dma_ch;
>  
>  	i2s->reg_ctrl = TEGRA_I2S_CTRL_FIFO_FORMAT_PACKED;
>  
> @@ -422,10 +434,16 @@ static int __devexit tegra_i2s_platform_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +static const struct of_device_id tegra_i2s_of_match[] __devinitconst = {
> +	{ .compatible = "nvidia,tegra20-i2s", },
> +	{},
> +};
> +
>  static struct platform_driver tegra_i2s_driver = {
>  	.driver = {
>  		.name = DRV_NAME,
>  		.owner = THIS_MODULE,
> +		.of_match_table = tegra_i2s_of_match,
>  	},
>  	.probe = tegra_i2s_platform_probe,
>  	.remove = __devexit_p(tegra_i2s_platform_remove),
> @@ -436,3 +454,4 @@ MODULE_AUTHOR("Stephen Warren <swarren@nvidia.com>");
>  MODULE_DESCRIPTION("Tegra I2S ASoC driver");
>  MODULE_LICENSE("GPL");
>  MODULE_ALIAS("platform:" DRV_NAME);
> +MODULE_DEVICE_TABLE(of, tegra_i2s_of_match);
> -- 
> 1.7.0.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 

[-- Attachment #1.2: Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2011-11-23  7:04 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-23  1:21 [PATCH 00/17] ASoC: Add Tegra DT, cleanup, and related Stephen Warren
     [not found] ` <1322011285-4002-1-git-send-email-swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-11-23  1:21   ` [PATCH 01/17] arm/tegra: board-dt: audio: Enable clocks, fix AUXDATA Stephen Warren
2011-11-23 10:38     ` Mark Brown
     [not found]       ` <20111123103858.GK4332-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2011-11-23 17:44         ` Stephen Warren
     [not found]           ` <74CDBE0F657A3D45AFBB94109FB122FF174F08C708-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2011-11-23 22:01             ` Olof Johansson
2011-11-23  1:21   ` [PATCH 02/17] arm/dt: Tegra: Clean up I2S and DAS nodes Stephen Warren
2011-11-23  1:21   ` [PATCH 03/17] arm/dt: Tegra: Enable audio on WM8903 boards, disable others Stephen Warren
     [not found]     ` <1322011285-4002-4-git-send-email-swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-11-23 16:50       ` Stephen Warren
2011-11-23  1:21   ` [PATCH 04/17] ASoC: Add device tree binding for WM8903 Stephen Warren
2011-11-23 10:20     ` Mark Brown
2011-11-23  1:21   ` [PATCH 05/17] ASoC: Tegra: Move DAS configuration into machine drivers Stephen Warren
     [not found]     ` <1322011285-4002-6-git-send-email-swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-11-23 10:24       ` Mark Brown
2011-11-23  1:21   ` [PATCH 06/17] ASoC: Tegra PCM: Use module_platform_driver Stephen Warren
     [not found]     ` <1322011285-4002-7-git-send-email-swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-11-23 10:24       ` Mark Brown
2011-11-23  1:21   ` [PATCH 07/17] ASoC: Tegra DAS: Use devm_ APIs and module_platform_driver Stephen Warren
2011-11-23  6:58     ` Thierry Reding
     [not found]       ` <20111123065808.GB5255-RM9K5IK7kjIyiCvfTdI0JKcOhU4Rzj621B7CTYaBSLdn68oJJulU0Q@public.gmane.org>
2011-11-23 10:23         ` Mark Brown
2011-11-23 17:29       ` Stephen Warren
     [not found]         ` <74CDBE0F657A3D45AFBB94109FB122FF174F08C6F3-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2011-11-23 20:40           ` [alsa-devel] " Thierry Reding
     [not found]     ` <1322011285-4002-8-git-send-email-swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-11-23 10:25       ` Mark Brown
2011-11-23  1:21   ` [PATCH 08/17] ASoC: Tegra I2S: " Stephen Warren
2011-11-23  7:00     ` Thierry Reding
     [not found]     ` <1322011285-4002-9-git-send-email-swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-11-23 10:25       ` Mark Brown
2011-11-23  1:21   ` [PATCH 09/17] ASoC: Tegra I2S: Remove dependency on pdev->id Stephen Warren
     [not found]     ` <1322011285-4002-10-git-send-email-swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-11-23 11:03       ` Mark Brown
     [not found]         ` <20111123110338.GC21073-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2011-11-23 17:54           ` Stephen Warren
     [not found]             ` <74CDBE0F657A3D45AFBB94109FB122FF174F08C711-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2011-11-23 18:03               ` Mark Brown
2011-11-23  1:21   ` [PATCH 10/17] ASoC: Tegra DAS: Add device tree binding Stephen Warren
     [not found]     ` <1322011285-4002-11-git-send-email-swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-11-23 11:07       ` Mark Brown
2011-11-23  1:21   ` [PATCH 11/17] ASoC: Tegra I2S: " Stephen Warren
2011-11-23  7:04     ` Thierry Reding [this message]
     [not found]       ` <20111123070449.GD5255-RM9K5IK7kjIyiCvfTdI0JKcOhU4Rzj621B7CTYaBSLdn68oJJulU0Q@public.gmane.org>
2011-11-23 10:48         ` Mark Brown
     [not found]           ` <20111123104845.GM4332-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2011-11-23 10:57             ` Thierry Reding
     [not found]     ` <1322011285-4002-12-git-send-email-swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-11-23 11:27       ` Mark Brown
2011-11-23  1:21   ` [PATCH 12/17] ASoC: Tegra+WM8903 machine: Use devm_ APIs and module_platform_driver Stephen Warren
     [not found]     ` <1322011285-4002-13-git-send-email-swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-11-23  7:05       ` Thierry Reding
2011-11-23 11:08       ` Mark Brown
2011-11-23  1:21   ` [PATCH 13/17] ASoC: Tegra TrimSlice " Stephen Warren
     [not found]     ` <1322011285-4002-14-git-send-email-swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-11-23  7:06       ` Thierry Reding
2011-11-23 11:11     ` Mark Brown
2011-11-23  1:21   ` [PATCH 14/17] ASoC: Implement "auto nc pins" feature Stephen Warren
     [not found]     ` <1322011285-4002-15-git-send-email-swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-11-23 11:15       ` Mark Brown
2011-11-23  1:21   ` [PATCH 15/17] ASoC: Tegra+WM903 machine: Use new auto_nc_codec_pins feature Stephen Warren
2011-11-23  1:21   ` [PATCH 16/17] ASoC: TrimSlice " Stephen Warren
2011-11-23  1:21   ` [PATCH 17/17] ASoC: Tegra+WM8903 machine: Add device tree binding Stephen Warren
     [not found]     ` <1322011285-4002-18-git-send-email-swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-11-23  7:15       ` Thierry Reding
2011-11-23 11:26       ` Mark Brown

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=20111123070449.GD5255@avionic-0098.adnet.avionic-design.de \
    --to=thierry.reding@avionic-design.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=bones@secretlab.ca \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=ccross@android.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=dp@opensource.wolfsonmicro.com \
    --cc=grant.likely@secretlab.ca \
    --cc=ian@opensource.wolfsonmicro.com \
    --cc=leon@leon.nu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=lrg@ti.com \
    --cc=marvin24@gmx.de \
    --cc=mike@compulab.co.il \
    --cc=olof@lixom.net \
    --cc=pdeschrijver@nvidia.com \
    --cc=rob.herring@calxeda.com \
    --cc=swarren@nvidia.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;
as well as URLs for NNTP newsgroup(s).