Rename Tegra ASoC driver
Subsystems (5)
cover Rename Tegra ASoC driver
Colin, Erik, Olof,
Could you please ack these patches once they're ready, so that Mark can place them into his tegra-arch branch.
Colin, Erik, Olof, Mark,
Once these changes are in Mark's tegra-arch branch, could you please merge them into your subsystem's for-2.6.40 or equivalent branches.
Thanks.
This patchset is for 2.6.40.
The Tegra ASoC driver currently supports just the Harmony board. Hence, the driver name includes the word "harmony". I'll soon be submitting a patchset to add support for more boards. Hence, the current name doesn't apply well any more. Hence, I'd like to rename the driver.
To do this, the three changes below need to be applied to both the ASoC tree and the ARM/Tegra tree:
ARM: Tegra: Rename harmony_audio.h -> tegra_wm8903_pdata.h
ARM: Tegra: Add to tegra_wm8903_platform_data
These both change a header file that is shared between the two subsystems. Future changes in both subsystems depend on these changes, so the changes must be merged into both subsystems first.
ASoC: Tegra: Rename pdev tegra-snd-harmony to tegra-snd-wm8903
Compile-wise, the subsets of this change that apply to each subsystem could be applied separately to each subsystem. However, that would break current Tegra audio support, since the driver name used in the board files would no longer match the driver name actually implemented, in either subsystem. Hence, this entire change should be merged into both subsystems.
Stephen Warren (3):
ARM: Tegra: Rename harmony_audio.h -> tegra_wm8903_pdata.h
ASoC: Tegra: Rename pdev tegra-snd-harmony to tegra-snd-wm8903
ARM: Tegra: Add to tegra_wm8903_platform_data
arch/arm/mach-tegra/board-harmony.c | 7 +++-- arch/arm/mach-tegra/include/mach/harmony_audio.h | 22 ------------------- .../mach-tegra/include/mach/tegra_wm8903_pdata.h | 23 ++++++++++++++++++++ sound/soc/tegra/harmony.c | 14 ++++++------ 4 files changed, 34 insertions(+), 32 deletions(-) delete mode 100644 arch/arm/mach-tegra/include/mach/harmony_audio.h create mode 100644 arch/arm/mach-tegra/include/mach/tegra_wm8903_pdata.h
A message that is not in the archive (sent off-list or not yet received): 1302629341-2302-1-git-send-email-swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org
PATCH 1/3 ARM: Tegra: Rename harmony_audio.h -> tegra_wm8903_pdata.h
The audio driver will soon support more than just the Tegra Harmony board. Rename the platform data header file and data type to reflect this.
---
This patch needs special merge handling; please see the cover letter.
arch/arm/mach-tegra/board-harmony.c | 4 +- arch/arm/mach-tegra/include/mach/harmony_audio.h | 22 -------------------- .../mach-tegra/include/mach/tegra_wm8903_pdata.h | 22 ++++++++++++++++++++ sound/soc/tegra/harmony.c | 12 +++++----- 4 files changed, 30 insertions(+), 30 deletions(-) delete mode 100644 arch/arm/mach-tegra/include/mach/harmony_audio.h create mode 100644 arch/arm/mach-tegra/include/mach/tegra_wm8903_pdata.h
arch/arm/mach-tegra/board-harmony.c +2 -2
@@ -34,7 +34,7 @@#include <asm/mach/time.h> #include <asm/setup.h> -#include <mach/harmony_audio.h> +#include <mach/tegra_wm8903_pdata.h> #include <mach/iomap.h> #include <mach/irqs.h> #include <mach/sdhci.h>
@@ -67,7 +67,7 @@ static struct platform_device debug_uart = { }, }; -static struct harmony_audio_platform_data harmony_audio_pdata = { +static struct tegra_wm8903_platform_data harmony_audio_pdata = { .gpio_spkr_en =TEGRA_GPIO_SPKR_EN , .gpio_hp_det =TEGRA_GPIO_HP_DET , .gpio_int_mic_en =TEGRA_GPIO_INT_MIC_EN ,
arch/arm/mach-tegra/include/mach/harmony_audio.h deleted +0 -22
@@ -1,22 +0,0 @@ -/* -* arch/arm/mach-tegra/include/mach/harmony_audio.h -* -* Copyright 2011 NVIDIA, Inc. -* -* This software is licensed under the terms of the GNU General Public -* License version 2, as published by the Free Software Foundation, and -* may be copied, distributed, and modified under those terms. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -*/ - -struct harmony_audio_platform_data { -int gpio_spkr_en; -int gpio_hp_det; -int gpio_int_mic_en; -int gpio_ext_mic_en; -};
arch/arm/mach-tegra/include/mach/tegra_wm8903_pdata.h new file +22 -0
@@ -0,0 +1,22 @@ +/* +* arch/arm/mach-tegra/include/mach/tegra_wm8903_pdata.h +* +* Copyright 2011 NVIDIA, Inc. +* +* This software is licensed under the terms of the GNU General Public +* License version 2, as published by the Free Software Foundation, and +* may be copied, distributed, and modified under those terms. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +*/ + +struct tegra_wm8903_platform_data { +int gpio_spkr_en; +int gpio_hp_det; +int gpio_int_mic_en; +int gpio_ext_mic_en; +};
sound/soc/tegra/harmony.c +6 -6
@@ -35,7 +35,7 @@#include <linux/slab.h> #include <linux/gpio.h> -#include <mach/harmony_audio.h> +#include <mach/tegra_wm8903_pdata.h> #include <sound/core.h> #include <sound/jack.h>
@@ -58,7 +58,7 @@struct tegra_harmony {struct tegra_asoc_utils_data util_data; -struct harmony_audio_platform_data *pdata; +struct tegra_wm8903_platform_data *pdata;int gpio_requested; };
@@ -163,7 +163,7 @@ static int harmony_event_int_spk(struct snd_soc_dapm_widget *w,struct snd_soc_codec *codec = w->codec;struct snd_soc_card *card = codec->card;struct tegra_harmony *harmony =snd_soc_card_get_drvdata (card); -struct harmony_audio_platform_data *pdata = harmony->pdata; +struct tegra_wm8903_platform_data *pdata = harmony->pdata;gpio_set_value_cansleep (pdata->gpio_spkr_en,SND_SOC_DAPM_EVENT_ON (event));
@@ -198,7 +198,7 @@ static int harmony_asoc_init(struct snd_soc_pcm_runtime *rtd)struct snd_soc_dapm_context *dapm = &codec->dapm;struct snd_soc_card *card = codec->card;struct tegra_harmony *harmony =snd_soc_card_get_drvdata (card); -struct harmony_audio_platform_data *pdata = harmony->pdata; +struct tegra_wm8903_platform_data *pdata = harmony->pdata;int ret; ret =gpio_request (pdata->gpio_spkr_en,"spkr_en" );
@@ -291,7 +291,7 @@ static __devinit int tegra_snd_harmony_probe(struct platform_device *pdev) {struct snd_soc_card *card = &snd_soc_harmony;struct tegra_harmony *harmony; -struct harmony_audio_platform_data *pdata; +struct tegra_wm8903_platform_data *pdata;int ret;if (!machine_is_harmony ()) {
@@ -344,7 +344,7 @@ static int __devexit tegra_snd_harmony_remove(struct platform_device *pdev) {struct snd_soc_card *card =platform_get_drvdata (pdev);struct tegra_harmony *harmony =snd_soc_card_get_drvdata (card); -struct harmony_audio_platform_data *pdata = harmony->pdata; +struct tegra_wm8903_platform_data *pdata = harmony->pdata;snd_soc_unregister_card (card);
Signature · 1 line
1.7.1
A message that is not in the archive (sent off-list or not yet received): 1302629341-2302-2-git-send-email-swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org
Mark Brown
AppliedRe: [alsa-devel] [PATCH 1/3] ARM: Tegra: Rename harmony_audio.h -> tegra_wm8903_pdata.h
Quoted 4 lines · Stephen Warren
The audio driver will soon support more than just the Tegra Harmony board. Rename the platform data header file and data type to reflect this.
Signed-off-by Stephen Warren <[email protected]>
Applied all on the 'tegra' branch of my sound tree, thanks.
PATCH 2/3 ASoC: Tegra: Rename pdev tegra-snd-harmony to tegra-snd-wm8903
In reply to a message not in the archiveSoon, this machine driver will be updated to handle a number of Tegra boards using the WM8903 codec. Rename the platform device in advance to reflect this.
---
This patch needs special merge handling; please see the cover letter.
arch/arm/mach-tegra/board-harmony.c | 2 +- sound/soc/tegra/harmony.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-tegra/board-harmony.c +1 -1
@@ -75,7 +75,7 @@ static struct tegra_wm8903_platform_data harmony_audio_pdata = { };static struct platform_device harmony_audio_device = { - .name ="tegra-snd-harmony" , + .name ="tegra-snd-wm8903" , .id =0 , .dev = { .platform_data = &harmony_audio_pdata,
sound/soc/tegra/harmony.c +1 -1
@@ -50,7 +50,7 @@#include "tegra_pcm.h" #include "tegra_asoc_utils.h" -#define DRV_NAME "tegra-snd-harmony" +#define DRV_NAME "tegra-snd-wm8903"#define GPIO_SPKR_EN BIT(0)#define GPIO_INT_MIC_EN BIT(1)
Signature · 1 line
1.7.1
A message that is not in the archive (sent off-list or not yet received): 1302629341-2302-3-git-send-email-swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org
Liam Girdwood
Acked-byRe: [alsa-devel] [PATCH 2/3] ASoC: Tegra: Rename pdev tegra-snd-harmony to tegra-snd-wm8903
Quoted 4 lines · Stephen Warren
Soon, this machine driver will be updated to handle a number of Tegra boards using the WM8903 codec. Rename the platform device in advance to reflect this.
Signed-off-by Stephen Warren <[email protected]>
PATCH 3/3 ARM: Tegra: Add to tegra_wm8903_platform_data
In reply to a message not in the archiveSeaboard derivate Kaen has a GPIO to mute the headphone output. Add a field to tegra_wm8903_platform_data so the board files can pass the GPIO number for that to the ASoC machine driver.
Also, initialize this new field to a "not present" value for Harmony.
---
This patch needs special merge handling; please see the cover letter.
arch/arm/mach-tegra/board-harmony.c | 1 + .../mach-tegra/include/mach/tegra_wm8903_pdata.h | 1 + 2 files changed, 2 insertions(+), 0 deletions(-)
arch/arm/mach-tegra/board-harmony.c +1 -0
@@ -70,6 +70,7 @@ static struct platform_device debug_uart = {static struct tegra_wm8903_platform_data harmony_audio_pdata = { .gpio_spkr_en =TEGRA_GPIO_SPKR_EN , .gpio_hp_det =TEGRA_GPIO_HP_DET , + .gpio_hp_mute =-1 , .gpio_int_mic_en =TEGRA_GPIO_INT_MIC_EN , .gpio_ext_mic_en =TEGRA_GPIO_EXT_MIC_EN , };
arch/arm/mach-tegra/include/mach/tegra_wm8903_pdata.h +1 -0
@@ -17,6 +17,7 @@struct tegra_wm8903_platform_data {int gpio_spkr_en;int gpio_hp_det; +int gpio_hp_mute;int gpio_int_mic_en;int gpio_ext_mic_en; };
Signature · 1 line
1.7.1