[alsa-devel] [PATCH v4 - resend 00/13] OMAP4: ASoC: Support for PandaBoard family
Hello,
the following series will add ASoC support for PandaBoards. PandaBoards have different audio routings compared to SDP4430/Blaze boards, but the differences not that big to justify a new ASoC machine driver.
The v3 series did not made it to 3.3 kernel. This set contains all the patches needed to enable the audio support on the PandaBoard family. The machine driver has been converted to a generic OMAP4 driver which can support wide range of machines using OMAP4 with twl6040 codec.
I have remove the hardcoded MCLK clock frequency use in the machine driver (there can be devices with different MCLK configuration). This changed patch 04, 05, and 12. Since this does not affect the functionality I kept the acks for these patches. Patch 11 did not existed in the v3 series.
Regards, Peter --- Peter Ujfalusi (13): ASoC: sdp4430: Correct author e-mail address ASoC: OMAP4: Rename the sdp4430 machine driver ASoC: omap-abe-twl6040: Correct internal prefix, Kconfig entry include: platform_data: Platform data header for OMAP4 ASoC audio OMAP4: 4430sdp: Register platform device for OMAP4 audio ASoC: omap-abe-twl6040: Convert to platform deriver ASoC: twl6040: Convert MICBIAS to SUPPLY widget ASoC: omap-abe-twl6040: Add complete DAPM routing ASoC: omap-abe-twl6040: DAI link selection based on platform data ASoC: omap-abe-twl6040: Configure card according to platform data ASoC: omap-abe-twl6040: Use provided MCLK frequency from pdata OMAP4: omap4panda: Enable audio support ASoC: Kconfig: OMAP4: Enable support for PandaBoards
arch/arm/mach-omap2/board-4430sdp.c | 29 ++ arch/arm/mach-omap2/board-omap4panda.c | 60 ++++- include/linux/platform_data/omap-abe-twl6040.h | 49 ++++ sound/soc/codecs/twl6040.c | 16 +- sound/soc/omap/Kconfig | 13 +- sound/soc/omap/Makefile | 4 +- sound/soc/omap/omap-abe-twl6040.c | 349 ++++++++++++++++++++++++ sound/soc/omap/sdp4430.c | 279 ------------------- 8 files changed, 504 insertions(+), 295 deletions(-) create mode 100644 include/linux/platform_data/omap-abe-twl6040.h create mode 100644 sound/soc/omap/omap-abe-twl6040.c delete mode 100644 sound/soc/omap/sdp4430.c
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com Acked-by: Mark Brown broonie@opensource.wolfsonmicro.com --- sound/soc/omap/sdp4430.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/omap/sdp4430.c b/sound/soc/omap/sdp4430.c index 175ba9a..ceadb13 100644 --- a/sound/soc/omap/sdp4430.c +++ b/sound/soc/omap/sdp4430.c @@ -1,7 +1,7 @@ /* * sdp4430.c -- SoC audio for TI OMAP4430 SDP * - * Author: Misael Lopez Cruz x0052729@ti.com + * Author: Misael Lopez Cruz misael.lopez@ti.com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -273,7 +273,7 @@ static void __exit sdp4430_soc_exit(void) } module_exit(sdp4430_soc_exit);
-MODULE_AUTHOR("Misael Lopez Cruz x0052729@ti.com"); +MODULE_AUTHOR("Misael Lopez Cruz misael.lopez@ti.com"); MODULE_DESCRIPTION("ALSA SoC SDP4430"); MODULE_LICENSE("GPL");
The same machine driver will support other boards with similar audio configuration (OMAP4, ABE, twl6040). Rename the driver to have more generic name.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com Acked-by: Mark Brown broonie@opensource.wolfsonmicro.com --- sound/soc/omap/Kconfig | 2 +- sound/soc/omap/Makefile | 4 ++-- sound/soc/omap/{sdp4430.c => omap-abe-twl6040.c} | 0 3 files changed, 3 insertions(+), 3 deletions(-) rename sound/soc/omap/{sdp4430.c => omap-abe-twl6040.c} (100%)
diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig index fb1bf25..4eae929 100644 --- a/sound/soc/omap/Kconfig +++ b/sound/soc/omap/Kconfig @@ -97,7 +97,7 @@ config SND_OMAP_SOC_SDP3430 Say Y if you want to add support for SoC audio on Texas Instruments SDP3430.
-config SND_OMAP_SOC_SDP4430 +config SND_OMAP_SOC_OMAP_ABE_TWL6040 tristate "SoC Audio support for Texas Instruments SDP4430" depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP_4430SDP select SND_OMAP_SOC_DMIC diff --git a/sound/soc/omap/Makefile b/sound/soc/omap/Makefile index 1fd723f..123ac18 100644 --- a/sound/soc/omap/Makefile +++ b/sound/soc/omap/Makefile @@ -20,7 +20,7 @@ snd-soc-overo-objs := overo.o snd-soc-omap3evm-objs := omap3evm.o snd-soc-am3517evm-objs := am3517evm.o snd-soc-sdp3430-objs := sdp3430.o -snd-soc-sdp4430-objs := sdp4430.o +snd-soc-omap-abe-twl6040-objs := omap-abe-twl6040.o snd-soc-omap3pandora-objs := omap3pandora.o snd-soc-omap3beagle-objs := omap3beagle.o snd-soc-zoom2-objs := zoom2.o @@ -36,7 +36,7 @@ obj-$(CONFIG_SND_OMAP_SOC_OMAP2EVM) += snd-soc-omap2evm.o obj-$(CONFIG_SND_OMAP_SOC_OMAP3EVM) += snd-soc-omap3evm.o obj-$(CONFIG_SND_OMAP_SOC_AM3517EVM) += snd-soc-am3517evm.o obj-$(CONFIG_SND_OMAP_SOC_SDP3430) += snd-soc-sdp3430.o -obj-$(CONFIG_SND_OMAP_SOC_SDP4430) += snd-soc-sdp4430.o +obj-$(CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040) += snd-soc-omap-abe-twl6040.o obj-$(CONFIG_SND_OMAP_SOC_OMAP3_PANDORA) += snd-soc-omap3pandora.o obj-$(CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE) += snd-soc-omap3beagle.o obj-$(CONFIG_SND_OMAP_SOC_ZOOM2) += snd-soc-zoom2.o diff --git a/sound/soc/omap/sdp4430.c b/sound/soc/omap/omap-abe-twl6040.c similarity index 100% rename from sound/soc/omap/sdp4430.c rename to sound/soc/omap/omap-abe-twl6040.c
Change the internal prefixes within the driver from sdp4430. At he same time correct the Kconfig text as well.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com Acked-by: Mark Brown broonie@opensource.wolfsonmicro.com --- sound/soc/omap/Kconfig | 7 ++-- sound/soc/omap/omap-abe-twl6040.c | 65 +++++++++++++++++++------------------ 2 files changed, 37 insertions(+), 35 deletions(-)
diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig index 4eae929..98410b8 100644 --- a/sound/soc/omap/Kconfig +++ b/sound/soc/omap/Kconfig @@ -98,15 +98,16 @@ config SND_OMAP_SOC_SDP3430 SDP3430.
config SND_OMAP_SOC_OMAP_ABE_TWL6040 - tristate "SoC Audio support for Texas Instruments SDP4430" + tristate "SoC Audio support for OMAP boards using ABE and twl6040 codec" depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP_4430SDP select SND_OMAP_SOC_DMIC select SND_OMAP_SOC_MCPDM select SND_SOC_TWL6040 select SND_SOC_DMIC help - Say Y if you want to add support for SoC audio on Texas Instruments - SDP4430. + Say Y if you want to add support for SoC audio on OMAP boards using + ABE and twl6040 codec. This driver currently supports: + - SDP4430/Blaze boards
config SND_OMAP_SOC_OMAP4_HDMI tristate "SoC Audio support for Texas Instruments OMAP4 HDMI" diff --git a/sound/soc/omap/omap-abe-twl6040.c b/sound/soc/omap/omap-abe-twl6040.c index ceadb13..5598165 100644 --- a/sound/soc/omap/omap-abe-twl6040.c +++ b/sound/soc/omap/omap-abe-twl6040.c @@ -1,5 +1,6 @@ /* - * sdp4430.c -- SoC audio for TI OMAP4430 SDP + * omap-abe-twl6040.c -- SoC audio for TI OMAP based boards with ABE and + * twl6040 codec * * Author: Misael Lopez Cruz misael.lopez@ti.com * @@ -38,7 +39,7 @@ #include "omap-pcm.h" #include "../codecs/twl6040.h"
-static int sdp4430_hw_params(struct snd_pcm_substream *substream, +static int omapabe_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { struct snd_soc_pcm_runtime *rtd = substream->private_data; @@ -64,11 +65,11 @@ static int sdp4430_hw_params(struct snd_pcm_substream *substream, return ret; }
-static struct snd_soc_ops sdp4430_ops = { - .hw_params = sdp4430_hw_params, +static struct snd_soc_ops omapabe_ops = { + .hw_params = omapabe_hw_params, };
-static int sdp4430_dmic_hw_params(struct snd_pcm_substream *substream, +static int omapabe_dmic_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { struct snd_soc_pcm_runtime *rtd = substream->private_data; @@ -90,8 +91,8 @@ static int sdp4430_dmic_hw_params(struct snd_pcm_substream *substream, return 0; }
-static struct snd_soc_ops sdp4430_dmic_ops = { - .hw_params = sdp4430_dmic_hw_params, +static struct snd_soc_ops omapabe_dmic_ops = { + .hw_params = omapabe_dmic_hw_params, };
/* Headset jack */ @@ -110,7 +111,7 @@ static struct snd_soc_jack_pin hs_jack_pins[] = { };
/* SDP4430 machine DAPM */ -static const struct snd_soc_dapm_widget sdp4430_twl6040_dapm_widgets[] = { +static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = { SND_SOC_DAPM_MIC("Ext Mic", NULL), SND_SOC_DAPM_SPK("Ext Spk", NULL), SND_SOC_DAPM_MIC("Headset Mic", NULL), @@ -145,7 +146,7 @@ static const struct snd_soc_dapm_route audio_map[] = { {"AFMR", NULL, "FM Stereo In"}, };
-static int sdp4430_twl6040_init(struct snd_soc_pcm_runtime *rtd) +static int omapabe_twl6040_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_codec *codec = rtd->codec; int ret, hs_trim; @@ -175,7 +176,7 @@ static int sdp4430_twl6040_init(struct snd_soc_pcm_runtime *rtd) return ret; }
-static const struct snd_soc_dapm_widget sdp4430_dmic_dapm_widgets[] = { +static const struct snd_soc_dapm_widget dmic_dapm_widgets[] = { SND_SOC_DAPM_MIC("Digital Mic", NULL), };
@@ -184,14 +185,14 @@ static const struct snd_soc_dapm_route dmic_audio_map[] = { {"Digital Mic1 Bias", NULL, "Digital Mic"}, };
-static int sdp4430_dmic_init(struct snd_soc_pcm_runtime *rtd) +static int omapabe_dmic_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_codec *codec = rtd->codec; struct snd_soc_dapm_context *dapm = &codec->dapm; int ret;
- ret = snd_soc_dapm_new_controls(dapm, sdp4430_dmic_dapm_widgets, - ARRAY_SIZE(sdp4430_dmic_dapm_widgets)); + ret = snd_soc_dapm_new_controls(dapm, dmic_dapm_widgets, + ARRAY_SIZE(dmic_dapm_widgets)); if (ret) return ret;
@@ -208,8 +209,8 @@ static struct snd_soc_dai_link sdp4430_dai[] = { .codec_dai_name = "twl6040-legacy", .platform_name = "omap-pcm-audio", .codec_name = "twl6040-codec", - .init = sdp4430_twl6040_init, - .ops = &sdp4430_ops, + .init = omapabe_twl6040_init, + .ops = &omapabe_ops, }, { .name = "DMIC", @@ -218,27 +219,27 @@ static struct snd_soc_dai_link sdp4430_dai[] = { .codec_dai_name = "dmic-hifi", .platform_name = "omap-pcm-audio", .codec_name = "dmic-codec", - .init = sdp4430_dmic_init, - .ops = &sdp4430_dmic_ops, + .init = omapabe_dmic_init, + .ops = &omapabe_dmic_ops, }, };
/* Audio machine driver */ -static struct snd_soc_card snd_soc_sdp4430 = { +static struct snd_soc_card omapabe_card = { .name = "SDP4430", .owner = THIS_MODULE, .dai_link = sdp4430_dai, .num_links = ARRAY_SIZE(sdp4430_dai),
- .dapm_widgets = sdp4430_twl6040_dapm_widgets, - .num_dapm_widgets = ARRAY_SIZE(sdp4430_twl6040_dapm_widgets), + .dapm_widgets = twl6040_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(twl6040_dapm_widgets), .dapm_routes = audio_map, .num_dapm_routes = ARRAY_SIZE(audio_map), };
-static struct platform_device *sdp4430_snd_device; +static struct platform_device *omapabe_snd_device;
-static int __init sdp4430_soc_init(void) +static int __init omapabe_soc_init(void) { int ret;
@@ -246,15 +247,15 @@ static int __init sdp4430_soc_init(void) return -ENODEV; printk(KERN_INFO "SDP4430 SoC init\n");
- sdp4430_snd_device = platform_device_alloc("soc-audio", -1); - if (!sdp4430_snd_device) { + omapabe_snd_device = platform_device_alloc("soc-audio", -1); + if (!omapabe_snd_device) { printk(KERN_ERR "Platform device allocation failed\n"); return -ENOMEM; }
- platform_set_drvdata(sdp4430_snd_device, &snd_soc_sdp4430); + platform_set_drvdata(omapabe_snd_device, &omapabe_card);
- ret = platform_device_add(sdp4430_snd_device); + ret = platform_device_add(omapabe_snd_device); if (ret) goto err;
@@ -262,18 +263,18 @@ static int __init sdp4430_soc_init(void)
err: printk(KERN_ERR "Unable to add platform device\n"); - platform_device_put(sdp4430_snd_device); + platform_device_put(omapabe_snd_device); return ret; } -module_init(sdp4430_soc_init); +module_init(omapabe_soc_init);
-static void __exit sdp4430_soc_exit(void) +static void __exit omapabe_soc_exit(void) { - platform_device_unregister(sdp4430_snd_device); + platform_device_unregister(omapabe_snd_device); } -module_exit(sdp4430_soc_exit); +module_exit(omapabe_soc_exit);
MODULE_AUTHOR("Misael Lopez Cruz misael.lopez@ti.com"); -MODULE_DESCRIPTION("ALSA SoC SDP4430"); +MODULE_DESCRIPTION("ALSA SoC for OMAP boards with ABE and twl6040 codec"); MODULE_LICENSE("GPL");
Include file to be used with the upcoming ASoC machine driver for OMAP platform using ABE with twl6040 codec.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com Acked-by: Mark Brown broonie@opensource.wolfsonmicro.com --- include/linux/platform_data/omap-abe-twl6040.h | 49 ++++++++++++++++++++++++ 1 files changed, 49 insertions(+), 0 deletions(-) create mode 100644 include/linux/platform_data/omap-abe-twl6040.h
diff --git a/include/linux/platform_data/omap-abe-twl6040.h b/include/linux/platform_data/omap-abe-twl6040.h new file mode 100644 index 0000000..5d298ac --- /dev/null +++ b/include/linux/platform_data/omap-abe-twl6040.h @@ -0,0 +1,49 @@ +/** + * omap-abe-twl6040.h - ASoC machine driver OMAP4+ devices, header. + * + * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com + * All rights reserved. + * + * Author: Peter Ujfalusi peter.ujfalusi@ti.com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#ifndef _OMAP_ABE_TWL6040_H_ +#define _OMAP_ABE_TWL6040_H_ + +/* To select if only one channel is connected in a stereo port */ +#define ABE_TWL6040_LEFT (1 << 0) +#define ABE_TWL6040_RIGHT (1 << 1) + +struct omap_abe_twl6040_data { + char *card_name; + /* Feature flags for connected audio pins */ + u8 has_hs; + u8 has_hf; + bool has_ep; + u8 has_aux; + u8 has_vibra; + bool has_dmic; + bool has_hsmic; + bool has_mainmic; + bool has_submic; + u8 has_afm; + /* Other features */ + bool jack_detection; /* board can detect jack events */ + int mclk_freq; /* MCLK frequency speed for twl6040 */ +}; + +#endif /* _OMAP_ABE_TWL6040_H_ */
To avoid breakage in audio support with the coming change in ASoC machine driver (conversion to platfrom device).
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com CC: Santosh Shilimkar santosh.shilimkar@ti.com Acked-by: Tony Lindgren tony@atomide.com Acked-by: Santosh Shilimkar santosh.shilimkar@ti.com --- arch/arm/mach-omap2/board-4430sdp.c | 29 +++++++++++++++++++++++++++++ 1 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index 39fba9d..7eaeb08 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c @@ -41,6 +41,7 @@ #include <video/omap-panel-nokia-dsi.h> #include <video/omap-panel-picodlp.h> #include <linux/wl12xx.h> +#include <linux/platform_data/omap-abe-twl6040.h>
#include "mux.h" #include "hsmmc.h" @@ -377,12 +378,40 @@ static struct platform_device sdp4430_dmic_codec = { .id = -1, };
+static struct omap_abe_twl6040_data sdp4430_abe_audio_data = { + .card_name = "SDP4430", + .has_hs = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT, + .has_hf = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT, + .has_ep = 1, + .has_aux = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT, + .has_vibra = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT, + + .has_dmic = 1, + .has_hsmic = 1, + .has_mainmic = 1, + .has_submic = 1, + .has_afm = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT, + + .jack_detection = 1, + /* MCLK input is 38.4MHz */ + .mclk_freq = 38400000, +}; + +static struct platform_device sdp4430_abe_audio = { + .name = "omap-abe-twl6040", + .id = -1, + .dev = { + .platform_data = &sdp4430_abe_audio_data, + }, +}; + static struct platform_device *sdp4430_devices[] __initdata = { &sdp4430_gpio_keys_device, &sdp4430_leds_gpio, &sdp4430_leds_pwm, &sdp4430_vbat, &sdp4430_dmic_codec, + &sdp4430_abe_audio, };
static struct omap_musb_board_data musb_board_data = {
Convert the OMAP4 ABE/TWL6040 machine driver to platform driver. For the card name use the string provided via platform data. The card's name for OMAP4 SDP4430 has been changed: SDP4430 -> OMAP4-SDP4430
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com Acked-by: Mark Brown broonie@opensource.wolfsonmicro.com --- sound/soc/omap/omap-abe-twl6040.c | 60 ++++++++++++++++++++++--------------- 1 files changed, 36 insertions(+), 24 deletions(-)
diff --git a/sound/soc/omap/omap-abe-twl6040.c b/sound/soc/omap/omap-abe-twl6040.c index 5598165..4ee0392 100644 --- a/sound/soc/omap/omap-abe-twl6040.c +++ b/sound/soc/omap/omap-abe-twl6040.c @@ -23,6 +23,7 @@ #include <linux/clk.h> #include <linux/platform_device.h> #include <linux/mfd/twl6040.h> +#include <linux/platform_data/omap-abe-twl6040.h> #include <linux/module.h>
#include <sound/core.h> @@ -226,7 +227,6 @@ static struct snd_soc_dai_link sdp4430_dai[] = {
/* Audio machine driver */ static struct snd_soc_card omapabe_card = { - .name = "SDP4430", .owner = THIS_MODULE, .dai_link = sdp4430_dai, .num_links = ARRAY_SIZE(sdp4430_dai), @@ -237,44 +237,56 @@ static struct snd_soc_card omapabe_card = { .num_dapm_routes = ARRAY_SIZE(audio_map), };
-static struct platform_device *omapabe_snd_device; - -static int __init omapabe_soc_init(void) +static __devinit int omapabe_probe(struct platform_device *pdev) { + struct omap_abe_twl6040_data *pdata = dev_get_platdata(&pdev->dev); + struct snd_soc_card *card = &omapabe_card; int ret;
- if (!machine_is_omap_4430sdp()) - return -ENODEV; - printk(KERN_INFO "SDP4430 SoC init\n"); + card->dev = &pdev->dev;
- omapabe_snd_device = platform_device_alloc("soc-audio", -1); - if (!omapabe_snd_device) { - printk(KERN_ERR "Platform device allocation failed\n"); - return -ENOMEM; + if (!pdata) { + dev_err(&pdev->dev, "Missing pdata\n"); + return -ENODEV; }
- platform_set_drvdata(omapabe_snd_device, &omapabe_card); + if (pdata->card_name) { + card->name = pdata->card_name; + } else { + dev_err(&pdev->dev, "Card name is not provided\n"); + return -ENODEV; + }
- ret = platform_device_add(omapabe_snd_device); + ret = snd_soc_register_card(card); if (ret) - goto err; - - return 0; + dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", + ret);
-err: - printk(KERN_ERR "Unable to add platform device\n"); - platform_device_put(omapabe_snd_device); return ret; } -module_init(omapabe_soc_init);
-static void __exit omapabe_soc_exit(void) +static int __devexit omapabe_remove(struct platform_device *pdev) { - platform_device_unregister(omapabe_snd_device); + struct snd_soc_card *card = platform_get_drvdata(pdev); + + snd_soc_unregister_card(card); + + return 0; } -module_exit(omapabe_soc_exit); + +static struct platform_driver omapabe_driver = { + .driver = { + .name = "omap-abe-twl6040", + .owner = THIS_MODULE, + .pm = &snd_soc_pm_ops, + }, + .probe = omapabe_probe, + .remove = __devexit_p(omapabe_remove), +}; + +module_platform_driver(omapabe_driver);
MODULE_AUTHOR("Misael Lopez Cruz misael.lopez@ti.com"); MODULE_DESCRIPTION("ALSA SoC for OMAP boards with ABE and twl6040 codec"); MODULE_LICENSE("GPL"); - +MODULE_ALIAS("platform:omap-abe-twl6040");
In order to avoid breakage change the omap-abe-twl6040 machine driver's routing.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com Acked-by: Mark Brown broonie@opensource.wolfsonmicro.com --- sound/soc/codecs/twl6040.c | 16 ++++++++-------- sound/soc/omap/omap-abe-twl6040.c | 14 +++++++------- 2 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c index 5b9c79b..ece47ed 100644 --- a/sound/soc/codecs/twl6040.c +++ b/sound/soc/codecs/twl6040.c @@ -1125,14 +1125,14 @@ static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = { TWL6040_REG_MICRCTL, 2, 0),
/* Microphone bias */ - SND_SOC_DAPM_MICBIAS("Headset Mic Bias", - TWL6040_REG_AMICBCTL, 0, 0), - SND_SOC_DAPM_MICBIAS("Main Mic Bias", - TWL6040_REG_AMICBCTL, 4, 0), - SND_SOC_DAPM_MICBIAS("Digital Mic1 Bias", - TWL6040_REG_DMICBCTL, 0, 0), - SND_SOC_DAPM_MICBIAS("Digital Mic2 Bias", - TWL6040_REG_DMICBCTL, 4, 0), + SND_SOC_DAPM_SUPPLY("Headset Mic Bias", + TWL6040_REG_AMICBCTL, 0, 0, NULL, 0), + SND_SOC_DAPM_SUPPLY("Main Mic Bias", + TWL6040_REG_AMICBCTL, 4, 0, NULL, 0), + SND_SOC_DAPM_SUPPLY("Digital Mic1 Bias", + TWL6040_REG_DMICBCTL, 0, 0, NULL, 0), + SND_SOC_DAPM_SUPPLY("Digital Mic2 Bias", + TWL6040_REG_DMICBCTL, 4, 0, NULL, 0),
/* DACs */ SND_SOC_DAPM_DAC("HSDAC Left", "Headset Playback", SND_SOC_NOPM, 0, 0), diff --git a/sound/soc/omap/omap-abe-twl6040.c b/sound/soc/omap/omap-abe-twl6040.c index 4ee0392..3b8d571 100644 --- a/sound/soc/omap/omap-abe-twl6040.c +++ b/sound/soc/omap/omap-abe-twl6040.c @@ -123,17 +123,17 @@ static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = {
static const struct snd_soc_dapm_route audio_map[] = { /* External Mics: MAINMIC, SUBMIC with bias*/ - {"MAINMIC", NULL, "Main Mic Bias"}, - {"SUBMIC", NULL, "Main Mic Bias"}, - {"Main Mic Bias", NULL, "Ext Mic"}, + {"MAINMIC", NULL, "Ext Mic"}, + {"SUBMIC", NULL, "Ext Mic"}, + {"Ext Mic", NULL, "Main Mic Bias"},
/* External Speakers: HFL, HFR */ {"Ext Spk", NULL, "HFL"}, {"Ext Spk", NULL, "HFR"},
/* Headset Mic: HSMIC with bias */ - {"HSMIC", NULL, "Headset Mic Bias"}, - {"Headset Mic Bias", NULL, "Headset Mic"}, + {"HSMIC", NULL, "Headset Mic"}, + {"Headset Mic", NULL, "Headset Mic Bias"},
/* Headset Stereophone (Headphone): HSOL, HSOR */ {"Headset Stereophone", NULL, "HSOL"}, @@ -182,8 +182,8 @@ static const struct snd_soc_dapm_widget dmic_dapm_widgets[] = { };
static const struct snd_soc_dapm_route dmic_audio_map[] = { - {"DMic", NULL, "Digital Mic1 Bias"}, - {"Digital Mic1 Bias", NULL, "Digital Mic"}, + {"DMic", NULL, "Digital Mic"}, + {"Digital Mic", NULL, "Digital Mic1 Bias"}, };
static int omapabe_dmic_init(struct snd_soc_pcm_runtime *rtd)
SDP4430 is a reference platform, and as such it has all possible audio routing implemented. Correct the DAPM routing to be complete.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com Acked-by: Mark Brown broonie@opensource.wolfsonmicro.com --- sound/soc/omap/omap-abe-twl6040.c | 46 ++++++++++++++++++++++-------------- 1 files changed, 28 insertions(+), 18 deletions(-)
diff --git a/sound/soc/omap/omap-abe-twl6040.c b/sound/soc/omap/omap-abe-twl6040.c index 3b8d571..d95bd82 100644 --- a/sound/soc/omap/omap-abe-twl6040.c +++ b/sound/soc/omap/omap-abe-twl6040.c @@ -113,38 +113,48 @@ static struct snd_soc_jack_pin hs_jack_pins[] = {
/* SDP4430 machine DAPM */ static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = { - SND_SOC_DAPM_MIC("Ext Mic", NULL), - SND_SOC_DAPM_SPK("Ext Spk", NULL), - SND_SOC_DAPM_MIC("Headset Mic", NULL), + /* Outputs */ SND_SOC_DAPM_HP("Headset Stereophone", NULL), SND_SOC_DAPM_SPK("Earphone Spk", NULL), - SND_SOC_DAPM_INPUT("FM Stereo In"), + SND_SOC_DAPM_SPK("Ext Spk", NULL), + SND_SOC_DAPM_LINE("Line Out", NULL), + SND_SOC_DAPM_SPK("Vibrator", NULL), + + /* Inputs */ + SND_SOC_DAPM_MIC("Headset Mic", NULL), + SND_SOC_DAPM_MIC("Main Handset Mic", NULL), + SND_SOC_DAPM_MIC("Sub Handset Mic", NULL), + SND_SOC_DAPM_LINE("Line In", NULL), };
static const struct snd_soc_dapm_route audio_map[] = { - /* External Mics: MAINMIC, SUBMIC with bias*/ - {"MAINMIC", NULL, "Ext Mic"}, - {"SUBMIC", NULL, "Ext Mic"}, - {"Ext Mic", NULL, "Main Mic Bias"}, + /* Routings for outputs */ + {"Headset Stereophone", NULL, "HSOL"}, + {"Headset Stereophone", NULL, "HSOR"}, + + {"Earphone Spk", NULL, "EP"},
- /* External Speakers: HFL, HFR */ {"Ext Spk", NULL, "HFL"}, {"Ext Spk", NULL, "HFR"},
- /* Headset Mic: HSMIC with bias */ + {"Line Out", NULL, "AUXL"}, + {"Line Out", NULL, "AUXR"}, + + {"Vibrator", NULL, "VIBRAL"}, + {"Vibrator", NULL, "VIBRAR"}, + + /* Routings for inputs */ {"HSMIC", NULL, "Headset Mic"}, {"Headset Mic", NULL, "Headset Mic Bias"},
- /* Headset Stereophone (Headphone): HSOL, HSOR */ - {"Headset Stereophone", NULL, "HSOL"}, - {"Headset Stereophone", NULL, "HSOR"}, + {"MAINMIC", NULL, "Main Handset Mic"}, + {"Main Handset Mic", NULL, "Main Mic Bias"},
- /* Earphone speaker */ - {"Earphone Spk", NULL, "EP"}, + {"SUBMIC", NULL, "Sub Handset Mic"}, + {"Sub Handset Mic", NULL, "Main Mic Bias"},
- /* Aux/FM Stereo In: AFML, AFMR */ - {"AFML", NULL, "FM Stereo In"}, - {"AFMR", NULL, "FM Stereo In"}, + {"AFML", NULL, "Line In"}, + {"AFMR", NULL, "Line In"}, };
static int omapabe_twl6040_init(struct snd_soc_pcm_runtime *rtd)
We can have machines without DMIC connected. In this case there is no need to create amother (unusable) capture PCM on the card. The existence of the DMIC connection can be checked via pdata->has_dmic. Select the correct dai_link structure for the card based on pdata->has_dmic.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com Acked-by: Mark Brown broonie@opensource.wolfsonmicro.com --- sound/soc/omap/omap-abe-twl6040.c | 25 ++++++++++++++++++++++--- 1 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/sound/soc/omap/omap-abe-twl6040.c b/sound/soc/omap/omap-abe-twl6040.c index d95bd82..7ad5b25 100644 --- a/sound/soc/omap/omap-abe-twl6040.c +++ b/sound/soc/omap/omap-abe-twl6040.c @@ -212,7 +212,7 @@ static int omapabe_dmic_init(struct snd_soc_pcm_runtime *rtd) }
/* Digital audio interface glue - connects codec <--> CPU */ -static struct snd_soc_dai_link sdp4430_dai[] = { +static struct snd_soc_dai_link twl6040_dmic_dai[] = { { .name = "TWL6040", .stream_name = "TWL6040", @@ -235,11 +235,22 @@ static struct snd_soc_dai_link sdp4430_dai[] = { }, };
+static struct snd_soc_dai_link twl6040_only_dai[] = { + { + .name = "TWL6040", + .stream_name = "TWL6040", + .cpu_dai_name = "omap-mcpdm", + .codec_dai_name = "twl6040-legacy", + .platform_name = "omap-pcm-audio", + .codec_name = "twl6040-codec", + .init = omapabe_twl6040_init, + .ops = &omapabe_ops, + }, +}; + /* Audio machine driver */ static struct snd_soc_card omapabe_card = { .owner = THIS_MODULE, - .dai_link = sdp4430_dai, - .num_links = ARRAY_SIZE(sdp4430_dai),
.dapm_widgets = twl6040_dapm_widgets, .num_dapm_widgets = ARRAY_SIZE(twl6040_dapm_widgets), @@ -267,6 +278,14 @@ static __devinit int omapabe_probe(struct platform_device *pdev) return -ENODEV; }
+ if (pdata->has_dmic) { + card->dai_link = twl6040_dmic_dai; + card->num_links = ARRAY_SIZE(twl6040_dmic_dai); + } else { + card->dai_link = twl6040_only_dai; + card->num_links = ARRAY_SIZE(twl6040_only_dai); + } + ret = snd_soc_register_card(card); if (ret) dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
Disable the not connected pins on the board based on the received platform data. DO not register the jack function on boards, which does not have means to detect it (jack is always connected).
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com Acked-by: Mark Brown broonie@opensource.wolfsonmicro.com --- sound/soc/omap/omap-abe-twl6040.c | 44 ++++++++++++++++++++++++++---------- 1 files changed, 32 insertions(+), 12 deletions(-)
diff --git a/sound/soc/omap/omap-abe-twl6040.c b/sound/soc/omap/omap-abe-twl6040.c index 7ad5b25..91ea873 100644 --- a/sound/soc/omap/omap-abe-twl6040.c +++ b/sound/soc/omap/omap-abe-twl6040.c @@ -157,10 +157,32 @@ static const struct snd_soc_dapm_route audio_map[] = { {"AFMR", NULL, "Line In"}, };
+static inline void twl6040_disconnect_pin(struct snd_soc_dapm_context *dapm, + int connected, char *pin) +{ + if (!connected) + snd_soc_dapm_disable_pin(dapm, pin); +} + static int omapabe_twl6040_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_codec *codec = rtd->codec; - int ret, hs_trim; + struct snd_soc_card *card = codec->card; + struct snd_soc_dapm_context *dapm = &codec->dapm; + struct omap_abe_twl6040_data *pdata = dev_get_platdata(card->dev); + int hs_trim; + int ret = 0; + + /* Disable not connected paths if not used */ + twl6040_disconnect_pin(dapm, pdata->has_hs, "Headset Stereophone"); + twl6040_disconnect_pin(dapm, pdata->has_hf, "Ext Spk"); + twl6040_disconnect_pin(dapm, pdata->has_ep, "Earphone Spk"); + twl6040_disconnect_pin(dapm, pdata->has_aux, "Line Out"); + twl6040_disconnect_pin(dapm, pdata->has_vibra, "Vinrator"); + twl6040_disconnect_pin(dapm, pdata->has_hsmic, "Headset Mic"); + twl6040_disconnect_pin(dapm, pdata->has_mainmic, "Main Handset Mic"); + twl6040_disconnect_pin(dapm, pdata->has_submic, "Sub Handset Mic"); + twl6040_disconnect_pin(dapm, pdata->has_afm, "Line In");
/* * Configure McPDM offset cancellation based on the HSOTRIM value from @@ -170,19 +192,17 @@ static int omapabe_twl6040_init(struct snd_soc_pcm_runtime *rtd) omap_mcpdm_configure_dn_offsets(rtd, TWL6040_HSF_TRIM_LEFT(hs_trim), TWL6040_HSF_TRIM_RIGHT(hs_trim));
- /* Headset jack detection */ - ret = snd_soc_jack_new(codec, "Headset Jack", - SND_JACK_HEADSET, &hs_jack); - if (ret) - return ret; - - ret = snd_soc_jack_add_pins(&hs_jack, ARRAY_SIZE(hs_jack_pins), - hs_jack_pins); + /* Headset jack detection only if it is supported */ + if (pdata->jack_detection) { + ret = snd_soc_jack_new(codec, "Headset Jack", + SND_JACK_HEADSET, &hs_jack); + if (ret) + return ret;
- if (machine_is_omap_4430sdp()) + ret = snd_soc_jack_add_pins(&hs_jack, ARRAY_SIZE(hs_jack_pins), + hs_jack_pins); twl6040_hs_jack_detect(codec, &hs_jack, SND_JACK_HEADSET); - else - snd_soc_jack_report(&hs_jack, SND_JACK_HEADSET, SND_JACK_HEADSET); + }
return ret; }
On Tue, Jan 24, 2012 at 01:52:27PM +0200, Peter Ujfalusi wrote:
Disable the not connected pins on the board based on the received platform data. DO not register the jack function on boards, which does not have means to detect it (jack is always connected).
This should no longer be needed with the auto not connected stuff.
On 01/24/2012 03:00 PM, Mark Brown wrote:
On Tue, Jan 24, 2012 at 01:52:27PM +0200, Peter Ujfalusi wrote:
Disable the not connected pins on the board based on the received platform data. DO not register the jack function on boards, which does not have means to detect it (jack is always connected).
This should no longer be needed with the auto not connected stuff.
The auto not connected checks if we have connected something in the card domain to the codec's input/output/micbias widgets. In the machine driver we start from fully wired configuration, and based on the received platform data we mark certain connections not connected. The audio nc feature would not work here. It will not mark anything nc since the DAPM map is complete.
On Wed, Jan 25, 2012 at 10:23:01AM +0200, Peter Ujfalusi wrote:
On 01/24/2012 03:00 PM, Mark Brown wrote:
On Tue, Jan 24, 2012 at 01:52:27PM +0200, Peter Ujfalusi wrote:
Disable the not connected pins on the board based on the received platform data. DO not register the jack function on boards, which does not have means to detect it (jack is always connected).
This should no longer be needed with the auto not connected stuff.
The auto not connected checks if we have connected something in the card domain to the codec's input/output/micbias widgets. In the machine driver we start from fully wired configuration, and based on the received platform data we mark certain connections not connected. The audio nc feature would not work here. It will not mark anything nc since the DAPM map is complete.
It'd do the right thing if you changed the code to only register the board widgets and routes as required - from your reply to Jassi it looks like you ought to do conditional reigstration anyway as the input paths move around between board variations.
On 01/25/2012 01:33 PM, Mark Brown wrote:
It'd do the right thing if you changed the code to only register the board widgets and routes as required - from your reply to Jassi it looks like you ought to do conditional reigstration anyway as the input paths move around between board variations.
I'm planning to do similar thing as an increment on top of this series. Most likely the DT support will have conditional registration or - like Tegra does - we will receive the map from DT. Not sure yet which way it is going to be. The Tegra implementation is already there, so I might just follow it. At the end I want to have some consistency between the resulting sound cards (w/ DT, w/o DT).
Avoid using hardwired configuration for MCLK frequency. Different board design might use other MCLK frequency.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com --- sound/soc/omap/omap-abe-twl6040.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/sound/soc/omap/omap-abe-twl6040.c b/sound/soc/omap/omap-abe-twl6040.c index 91ea873..2e283d4 100644 --- a/sound/soc/omap/omap-abe-twl6040.c +++ b/sound/soc/omap/omap-abe-twl6040.c @@ -45,12 +45,15 @@ static int omapabe_hw_params(struct snd_pcm_substream *substream, { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_dai *codec_dai = rtd->codec_dai; + struct snd_soc_codec *codec = rtd->codec; + struct snd_soc_card *card = codec->card; + struct omap_abe_twl6040_data *pdata = dev_get_platdata(card->dev); int clk_id, freq; int ret;
clk_id = twl6040_get_clk_id(rtd->codec); if (clk_id == TWL6040_SYSCLK_SEL_HPPLL) - freq = 38400000; + freq = pdata->mclk_freq; else if (clk_id == TWL6040_SYSCLK_SEL_LPPLL) freq = 32768; else @@ -298,6 +301,11 @@ static __devinit int omapabe_probe(struct platform_device *pdev) return -ENODEV; }
+ if (!pdata->mclk_freq) { + dev_err(&pdev->dev, "MCLK frequency missing\n"); + return -ENODEV; + } + if (pdata->has_dmic) { card->dai_link = twl6040_dmic_dai; card->num_links = ARRAY_SIZE(twl6040_dmic_dai);
On Tue, Jan 24, 2012 at 01:52:28PM +0200, Peter Ujfalusi wrote:
Avoid using hardwired configuration for MCLK frequency. Different board design might use other MCLK frequency.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com
So, apparently this one isn't an actual resend! Since you flagged the entire series up as a resend I didn't actually read it as I'd presumably already reviewed it.
Acked-by: Mark Brown broonie@opensource.wolfsonmicro.com
PandaBoard has twl6040 codec for audio. Register the omap4-abe-twl6040 platform device. Add platform data to enable the twl6040 codec. Since there is a difference in audio between PandaBoard 4430 and PandaBoard ES (4460): Use different name for the sound card: "PandaBoard" for PandaBoard 4430 "PandaBoardES" for PandaBoard ES
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com CC: Santosh Shilimkar santosh.shilimkar@ti.com CC: David Anders x0132446@ti.com Acked-by: Tony Lindgren tony@atomide.com Acked-by: Santosh Shilimkar santosh.shilimkar@ti.com --- arch/arm/mach-omap2/board-omap4panda.c | 60 +++++++++++++++++++++++++++++++- 1 files changed, 59 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c index 30ad40d..eada955 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c @@ -28,6 +28,7 @@ #include <linux/regulator/machine.h> #include <linux/regulator/fixed.h> #include <linux/wl12xx.h> +#include <linux/platform_data/omap-abe-twl6040.h>
#include <mach/hardware.h> #include <asm/hardware/gic.h> @@ -90,9 +91,34 @@ static struct platform_device leds_gpio = { }, };
+static struct omap_abe_twl6040_data panda_abe_audio_data = { + /* Audio out */ + .has_hs = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT, + /* HandsFree through expasion connector */ + .has_hf = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT, + /* PandaBoard: FM TX, PandaBoardES: can be connected to audio out */ + .has_aux = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT, + /* PandaBoard: FM RX, PandaBoardES: audio in */ + .has_afm = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT, + /* No jack detection. */ + .jack_detection = 0, + /* MCLK input is 38.4MHz */ + .mclk_freq = 38400000, + +}; + +static struct platform_device panda_abe_audio = { + .name = "omap-abe-twl6040", + .id = -1, + .dev = { + .platform_data = &panda_abe_audio_data, + }, +}; + static struct platform_device *panda_devices[] __initdata = { &leds_gpio, &wl1271_device, + &panda_abe_audio, };
static const struct usbhs_omap_board_data usbhs_bdata __initconst = { @@ -251,8 +277,25 @@ static int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers) return 0; }
+static struct twl4030_codec_data twl6040_codec = { + /* single-step ramp for headset and handsfree */ + .hs_left_step = 0x0f, + .hs_right_step = 0x0f, + .hf_left_step = 0x1d, + .hf_right_step = 0x1d, +}; + +static struct twl4030_audio_data twl6040_audio = { + .codec = &twl6040_codec, + .audpwron_gpio = 127, + .naudint_irq = OMAP44XX_IRQ_SYS_2N, + .irq_base = TWL6040_CODEC_IRQ_BASE, +}; + /* Panda board uses the common PMIC configuration */ -static struct twl4030_platform_data omap4_panda_twldata; +static struct twl4030_platform_data omap4_panda_twldata = { + .audio = &twl6040_audio, +};
/* * Display monitor features are burnt in their EEPROM as EDID data. The EEPROM @@ -475,6 +518,20 @@ void omap4_panda_display_init(void) omap_hdmi_init(0); }
+static void omap4_panda_init_rev(void) +{ + if (cpu_is_omap4430()) { + /* PandaBoard 4430 */ + /* ASoC audio configuration */ + panda_abe_audio_data.card_name = "PandaBoard"; + panda_abe_audio_data.has_hsmic = 1; + } else { + /* PandaBoard ES */ + /* ASoC audio configuration */ + panda_abe_audio_data.card_name = "PandaBoardES"; + } +} + static void __init omap4_panda_init(void) { int package = OMAP_PACKAGE_CBS; @@ -486,6 +543,7 @@ static void __init omap4_panda_init(void) if (wl12xx_set_platform_data(&omap_panda_wlan_data)) pr_err("error setting wl12xx data\n");
+ omap4_panda_init_rev(); omap4_panda_i2c_init(); platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices)); platform_device_register(&omap_vwlan_device);
Enable ASoC audio support for OMAP4 based machines with twl6040 codec via the omap-abe-twl6040 machine driver.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com Acked-by: Mark Brown broonie@opensource.wolfsonmicro.com --- sound/soc/omap/Kconfig | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig index 98410b8..47b23fe 100644 --- a/sound/soc/omap/Kconfig +++ b/sound/soc/omap/Kconfig @@ -99,7 +99,7 @@ config SND_OMAP_SOC_SDP3430
config SND_OMAP_SOC_OMAP_ABE_TWL6040 tristate "SoC Audio support for OMAP boards using ABE and twl6040 codec" - depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP_4430SDP + depends on TWL4030_CORE && SND_OMAP_SOC && ARCH_OMAP4 select SND_OMAP_SOC_DMIC select SND_OMAP_SOC_MCPDM select SND_SOC_TWL6040 @@ -108,6 +108,8 @@ config SND_OMAP_SOC_OMAP_ABE_TWL6040 Say Y if you want to add support for SoC audio on OMAP boards using ABE and twl6040 codec. This driver currently supports: - SDP4430/Blaze boards + - PandaBoard (4430) + - PandaBoardES (4460)
config SND_OMAP_SOC_OMAP4_HDMI tristate "SoC Audio support for Texas Instruments OMAP4 HDMI"
On Tue, Jan 24, 2012 at 01:52:17PM +0200, Peter Ujfalusi wrote:
the following series will add ASoC support for PandaBoards.
Please try not to use quite such verbose prefixes for your serieses - here's what the mail I'm replying to looks like in my mail client:
-> 90 T 01/24 Peter Ujfalusi (2.3K) [PATCH v4 - resend 00/13] OMAP4: ASoC:
so it's really not obvious what it's about :) The " - resend" isn't adding a huge amount, I'd suggest dropping that.
On 24 January 2012 17:22, Peter Ujfalusi peter.ujfalusi@ti.com wrote:
Hello,
the following series will add ASoC support for PandaBoards. PandaBoards have different audio routings compared to SDP4430/Blaze boards, but the differences not that big to justify a new ASoC machine driver.
The v3 series did not made it to 3.3 kernel. This set contains all the patches needed to enable the audio support on the PandaBoard family. The machine driver has been converted to a generic OMAP4 driver which can support wide range of machines using OMAP4 with twl6040 codec.
I have remove the hardcoded MCLK clock frequency use in the machine driver (there can be devices with different MCLK configuration). This changed patch 04, 05, and 12. Since this does not affect the functionality I kept the acks for these patches. Patch 11 did not existed in the v3 series.
Hi Peter, I tried the patchset on my 4430 Panda. Playback works ok, but not Capture. All is get is a hiss. Is capture supposed to work ? If yes, any amixer settings that need to be done?
Thanks, -Jassi
On 01/25/2012 12:50 PM, Jassi Brar wrote:
Hi Peter, I tried the patchset on my 4430 Panda. Playback works ok, but not Capture. All is get is a hiss. Is capture supposed to work ? If yes, any amixer settings that need to be done?
Thanks for testing the series.
I do not have Panda on my own, but the capture depends on Panda version: PandaBoard (4430): You record from HSMIC PandaBoardES (4460): You record from AFML (line in).
Can you try: amixer sset 'Analog Left' 'Headset Mic' amixer sset 'Analog Right' 'Headset Mic' Or amixer sset 'Analog Left' 'Aux/FM Left' amixer sset 'Analog Right' 'Aux/FM Right'
On 01/25/2012 11:50 AM, Jassi Brar wrote:
On 24 January 2012 17:22, Peter Ujfalusipeter.ujfalusi@ti.com wrote:
Hello,
the following series will add ASoC support for PandaBoards. PandaBoards have different audio routings compared to SDP4430/Blaze boards, but the differences not that big to justify a new ASoC machine driver.
The v3 series did not made it to 3.3 kernel. This set contains all the patches needed to enable the audio support on the PandaBoard family. The machine driver has been converted to a generic OMAP4 driver which can support wide range of machines using OMAP4 with twl6040 codec.
I have remove the hardcoded MCLK clock frequency use in the machine driver (there can be devices with different MCLK configuration). This changed patch 04, 05, and 12. Since this does not affect the functionality I kept the acks for these patches. Patch 11 did not existed in the v3 series.
Hi Peter, I tried the patchset on my 4430 Panda. Playback works ok, but not Capture. All is get is a hiss. Is capture supposed to work ? If yes, any amixer settings that need to be done?
Hi Jassi,
With the next update the PandaBoard 4430 is working fine. cpu_is_omap4430() macro is not define. We should use cpu_is_omap443x() macro in order to select correctly PandaBoard and not PandaBoardES board. Due to this error the heaset Mic pin is not enable so record is not working (use for Panda 4430 recording).
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach- omap2/board-omap4panda.c index 5f27387..6a397e9 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c @@ -580,7 +580,7 @@ void omap4_panda_display_init(void)
static void omap4_panda_init_rev(void) { - if (cpu_is_omap4430()) { + if (cpu_is_omap443x()) { /* PandaBoard 4430 */ /* ASoC audio configuration */ panda_abe_audio_data.card_name = "PandaBoard";
Hi Sebastien,
On 28 January 2012 04:21, Guiriec, Sebastien s-guiriec@ti.com wrote:
Hi Peter, I tried the patchset on my 4430 Panda. Playback works ok, but not Capture. All is get is a hiss. Is capture supposed to work ? If yes, any amixer settings that need to be done?
Hi Jassi,
With the next update the PandaBoard 4430 is working fine. cpu_is_omap4430() macro is not define. We should use cpu_is_omap443x() macro in order to select correctly PandaBoard and not PandaBoardES board. Due to this error the heaset Mic pin is not enable so record is not working (use for Panda 4430 recording).
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach- omap2/board-omap4panda.c index 5f27387..6a397e9 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c @@ -580,7 +580,7 @@ void omap4_panda_display_init(void)
static void omap4_panda_init_rev(void) {
- if (cpu_is_omap4430()) {
- if (cpu_is_omap443x()) {
/* PandaBoard 4430 */ /* ASoC audio configuration */ panda_abe_audio_data.card_name = "PandaBoard";
Thanks, the patch make it work for Panda-4430 too.
Thanks Peter for the amixer settings.
Cheers, Jassi
participants (4)
-
Guiriec, Sebastien
-
Jassi Brar
-
Mark Brown
-
Peter Ujfalusi