Re: [PATCH 17/17] ASoC: Tegra+WM8903 machine: Add device tree binding

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Stephen Warren wrote:
> From: John Bonesio <bones@xxxxxxxxxxxx>
> 
> This driver is parameterized in two ways:
> 
> a) Platform data, which supplies a set of GPIOs used by the driver.
>    These GPIOs can now be parsed out of device tree.
> 
> b) Machine-specific DAPM route arrays embedded into the ASoC machine
>    driver itself. The driver picks the appropriate array to use using
>    machine_is_*(). This array can now be parsed straight out of device
>    tree, allowing the machine driver to be completely machine agnostic.
> 
> swarren applied the following modifications:
> * Moved all pdata and DT parsing into one place.
> * Added DAPM route parsing from DT.
> * Added tegra_pcm device registration.
> * Documented DT binding.
> 
> Signed-off-by: John Bonesio <bones@xxxxxxxxxxxx>
> Signed-off-by: Grant Likely <grant.likely@xxxxxxxxxxxx>
> Signed-off-by: Stephen Warren <swarren@xxxxxxxxxx>
> ---
>  .../bindings/sound/tegra-audio-wm8903.txt          |   63 +++++++++
>  sound/soc/tegra/tegra_wm8903.c                     |  133 ++++++++++++++++----
>  2 files changed, 171 insertions(+), 25 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/sound/tegra-audio-wm8903.txt
[...]
> diff --git a/sound/soc/tegra/tegra_wm8903.c b/sound/soc/tegra/tegra_wm8903.c
[...]
> @@ -262,6 +266,83 @@ static int tegra_wm8903_init(struct snd_soc_pcm_runtime *rtd)
>  		return ret;
>  	}
>  
> +	pdata = &machine->pdata;
> +	np = card->dev->of_node;
> +
> +	if (card->dev->platform_data) {
> +		*pdata = *(struct tegra_wm8903_platform_data *)
> +						card->dev->platform_data;
[...]

Minor nit: perhaps this should use memcpy() instead?

Thierry

Attachment: pgpIUxdP7XvA_.pgp
Description: PGP signature


[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux