* ASoC/DAPM: How to make the DAPM routing complete?
@ 2011-09-16 14:07 Bas Vermeulen
2011-09-17 13:32 ` Mark Brown
0 siblings, 1 reply; 7+ messages in thread
From: Bas Vermeulen @ 2011-09-16 14:07 UTC (permalink / raw)
To: alsa-devel
I am using a slightly modified version of the 88pm860x-codec.c driver
from 3.x in an android modified 2.6.35 kernel.
I have had to make some changes to allow both capture and playback work
on the same (I2S) interface, but so far things are working.
I am however having some problems getting the DAPM framework to set the
correct switches needed to get the complete route to actually start.
What would be needed to get this working as it should? I can post or
send the driver on request, but basically the same question rises for
the current driver in the 3.x kernel.
I want/need to go from HS1/HS2 to DIN for playback, and from MIC1 to
DOUT for capture. In order to do that, I have to set the following switches:
amixer -q sset 'DAC HS1 Mux' 'Right'
amixer -q sset 'DAC HS2 Mux' 'Left'
amixer -q sset 'I2S Mic Mux' 'ADC'
amixer -q sset 'ADC Left Mux' 'ADCL'
I would like to make this automatic, but I am unsure how to express this
in my dapm routing table.
Note that in order to be able to use playback and capture independently
on the I2S interface (within reason, it is not possible to use a
different rate for instance), I had to add a SUPPLY control to the dapm
widgets that turns on the I2S clock when needed.
Any help, hints or pointers to the right manual to read would be
appreciated.
Bas Vermeulen
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: ASoC/DAPM: How to make the DAPM routing complete?
2011-09-16 14:07 ASoC/DAPM: How to make the DAPM routing complete? Bas Vermeulen
@ 2011-09-17 13:32 ` Mark Brown
2011-09-19 11:35 ` [ASoC] 88pm860x - Allow independent use of I2S capture and playback Bas Vermeulen
2011-09-19 11:38 ` [ASoC] 88pm860x - Incorporate the marvell errata regarding Audio Power-up Delay Bas Vermeulen
0 siblings, 2 replies; 7+ messages in thread
From: Mark Brown @ 2011-09-17 13:32 UTC (permalink / raw)
To: Bas Vermeulen; +Cc: alsa-devel
On Fri, Sep 16, 2011 at 04:07:13PM +0200, Bas Vermeulen wrote:
> I want/need to go from HS1/HS2 to DIN for playback, and from MIC1 to
> DOUT for capture. In order to do that, I have to set the following switches:
> amixer -q sset 'DAC HS1 Mux' 'Right'
> amixer -q sset 'DAC HS2 Mux' 'Left'
> amixer -q sset 'I2S Mic Mux' 'ADC'
> amixer -q sset 'ADC Left Mux' 'ADCL'
> I would like to make this automatic, but I am unsure how to express this
> in my dapm routing table.
You shouldn't do this in kernel, decisions like this should be deferred
to userspace. Most distributions have init scripts which can apply
settings or you can use the use case management code in alsa-lib from your
app. Not putting this in kernel gives more runtime flexibility which is
especially useful when you get things like reference boards which can
run multiple distributions that may not always agree about the best setup.
> Note that in order to be able to use playback and capture independently
> on the I2S interface (within reason, it is not possible to use a
> different rate for instance), I had to add a SUPPLY control to the dapm
> widgets that turns on the I2S clock when needed.
Can you send a patch for this please?
^ permalink raw reply [flat|nested] 7+ messages in thread
* [ASoC] 88pm860x - Allow independent use of I2S capture and playback
2011-09-17 13:32 ` Mark Brown
@ 2011-09-19 11:35 ` Bas Vermeulen
2011-09-20 11:34 ` Mark Brown
2011-09-21 14:55 ` Mark Brown
2011-09-19 11:38 ` [ASoC] 88pm860x - Incorporate the marvell errata regarding Audio Power-up Delay Bas Vermeulen
1 sibling, 2 replies; 7+ messages in thread
From: Bas Vermeulen @ 2011-09-19 11:35 UTC (permalink / raw)
To: Mark Brown; +Cc: alsa-devel@alsa-project.org
[-- Attachment #1: Type: text/plain, Size: 552 bytes --]
On 09/17/2011 03:32 PM, Mark Brown wrote:
> On Fri, Sep 16, 2011 at 04:07:13PM +0200, Bas Vermeulen wrote:
>> Note that in order to be able to use playback and capture independently
>> on the I2S interface (within reason, it is not possible to use a
>> different rate for instance), I had to add a SUPPLY control to the dapm
>> widgets that turns on the I2S clock when needed.
> Can you send a patch for this please?
Attached is a patch to turn the I2S clock on for both of I2S capture and
playback instead of just playback.
Regards,
Bas Vermeulen
[-- Attachment #2: 0001-ASoC-88pm860x-codec-Allow-independent-use-of-both-I2.patch --]
[-- Type: text/x-patch, Size: 1756 bytes --]
>From a02c4f024daeae6f0708467bc1adbe20bc7458bb Mon Sep 17 00:00:00 2001
From: Bas Vermeulen <bas.vermeulen@novero.com>
Date: Mon, 19 Sep 2011 12:57:09 +0200
Subject: [PATCH 1/2] [ASoC] 88pm860x-codec - Allow independent use of both I2S playback and capture
Introduce a I2S CLK supply so playback and capture can operate independently.
Signed-off-by: Bas Vermeulen <bas.vermeulen@novero.com>
---
sound/soc/codecs/88pm860x-codec.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/88pm860x-codec.c b/sound/soc/codecs/88pm860x-codec.c
index 1924157..0198dbb 100644
--- a/sound/soc/codecs/88pm860x-codec.c
+++ b/sound/soc/codecs/88pm860x-codec.c
@@ -772,11 +772,12 @@ static const struct snd_soc_dapm_widget pm860x_dapm_widgets[] = {
SND_SOC_DAPM_AIF_IN("I2S DIN", "I2S Playback", 0,
- PM860X_DAC_EN_2, 0, 0),
+ SND_SOC_NOPM, 0, 0),
SND_SOC_DAPM_AIF_IN("I2S DIN1", "I2S Playback", 0,
- PM860X_DAC_EN_2, 0, 0),
+ SND_SOC_NOPM, 0, 0),
SND_SOC_DAPM_AIF_OUT("I2S DOUT", "I2S Capture", 0,
PM860X_I2S_IFACE_3, 5, 1),
+ SND_SOC_DAPM_SUPPLY("I2S CLK", PM860X_DAC_EN_2, 0, 0, NULL, 0),
SND_SOC_DAPM_MUX("I2S Mic Mux", SND_SOC_NOPM, 0, 0, &i2s_mic_mux),
SND_SOC_DAPM_MUX("ADC Left Mux", SND_SOC_NOPM, 0, 0, &adcl_mux),
SND_SOC_DAPM_MUX("ADC Right Mux", SND_SOC_NOPM, 0, 0, &adcr_mux),
@@ -868,6 +869,11 @@ static const struct snd_soc_dapm_route audio_map[] = {
{"Left ADC", NULL, "Left ADC MOD"},
{"Right ADC", NULL, "Right ADC MOD"},
+ /* I2S Clock */
+ {"I2S DIN", NULL, "I2S CLK"},
+ {"I2S DIN1", NULL, "I2S CLK"},
+ {"I2S DOUT", NULL, "I2S CLK"},
+
/* PCM/AIF1 Inputs */
{"PCM SDO", NULL, "ADC Left Mux"},
{"PCM SDO", NULL, "ADCR EC Mux"},
--
1.7.0.4
[-- Attachment #3: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [ASoC] 88pm860x - Incorporate the marvell errata regarding Audio Power-up Delay.
2011-09-17 13:32 ` Mark Brown
2011-09-19 11:35 ` [ASoC] 88pm860x - Allow independent use of I2S capture and playback Bas Vermeulen
@ 2011-09-19 11:38 ` Bas Vermeulen
2011-09-20 11:34 ` Mark Brown
1 sibling, 1 reply; 7+ messages in thread
From: Bas Vermeulen @ 2011-09-19 11:38 UTC (permalink / raw)
To: Mark Brown
Cc: Bas Vermeulen (CentricTSolve/Bochum), alsa-devel@alsa-project.org
[-- Attachment #1: Type: text/plain, Size: 492 bytes --]
On 09/17/2011 03:32 PM, Mark Brown wrote:
>> Note that in order to be able to use playback and capture independently
>> on the I2S interface (within reason, it is not possible to use a
>> different rate for instance), I had to add a SUPPLY control to the dapm
>> widgets that turns on the I2S clock when needed.
> Can you send a patch for this please?
This patch implements the audio power-up delay errata for the 88PM8607,
meaning the codec will actually be reset.
Regards,
Bas Vermeulen
[-- Attachment #2: 0002-ASoC-88pm860x-codec-reset-the-codec-correctly.patch --]
[-- Type: text/x-patch, Size: 1127 bytes --]
>From 55d78799fc7e492f582bc7feb4cb3251e8ef895d Mon Sep 17 00:00:00 2001
From: Bas Vermeulen <bas.vermeulen@novero.com>
Date: Mon, 19 Sep 2011 13:09:10 +0200
Subject: [PATCH 2/2] [ASoC] 88pm860x-codec - reset the codec correctly
Reset the codec according to the Audio power-up delay errata for the 88PM8607.
Signed-off-by: Bas Vermeulen <bas.vermeulen@novero.com>
---
sound/soc/codecs/88pm860x-codec.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/sound/soc/codecs/88pm860x-codec.c b/sound/soc/codecs/88pm860x-codec.c
index 0198dbb..df7b4a0 100644
--- a/sound/soc/codecs/88pm860x-codec.c
+++ b/sound/soc/codecs/88pm860x-codec.c
@@ -1179,6 +1179,9 @@ static int pm860x_set_bias_level(struct snd_soc_codec *codec,
case SND_SOC_BIAS_STANDBY:
if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) {
/* Enable Audio PLL & Audio section */
+ data = AUDIO_PLL | AUDIO_SECTION_ON;
+ pm860x_reg_write(codec->control_data, REG_MISC2, data);
+ udelay(300);
data = AUDIO_PLL | AUDIO_SECTION_RESET
| AUDIO_SECTION_ON;
pm860x_reg_write(codec->control_data, REG_MISC2, data);
--
1.7.0.4
[-- Attachment #3: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [ASoC] 88pm860x - Allow independent use of I2S capture and playback
2011-09-19 11:35 ` [ASoC] 88pm860x - Allow independent use of I2S capture and playback Bas Vermeulen
@ 2011-09-20 11:34 ` Mark Brown
2011-09-21 14:55 ` Mark Brown
1 sibling, 0 replies; 7+ messages in thread
From: Mark Brown @ 2011-09-20 11:34 UTC (permalink / raw)
To: Bas Vermeulen, lrg; +Cc: alsa-devel@alsa-project.org
On Mon, Sep 19, 2011 at 01:35:57PM +0200, Bas Vermeulen wrote:
> Attached is a patch to turn the I2S clock on for both of I2S capture
> and playback instead of just playback.
Please follow the process in SubmittingPatches - CC maintainers (I've
added Liam), don't send as attachments and use subject lines which match
up with the standard for the subsystem.
> From a02c4f024daeae6f0708467bc1adbe20bc7458bb Mon Sep 17 00:00:00 2001
> From: Bas Vermeulen <bas.vermeulen@novero.com>
> Date: Mon, 19 Sep 2011 12:57:09 +0200
> Subject: [PATCH 1/2] [ASoC] 88pm860x-codec - Allow independent use of both I2S playback and capture
>
> Introduce a I2S CLK supply so playback and capture can operate independently.
>
> Signed-off-by: Bas Vermeulen <bas.vermeulen@novero.com>
> ---
> sound/soc/codecs/88pm860x-codec.c | 10 ++++++++--
> 1 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/sound/soc/codecs/88pm860x-codec.c b/sound/soc/codecs/88pm860x-codec.c
> index 1924157..0198dbb 100644
> --- a/sound/soc/codecs/88pm860x-codec.c
> +++ b/sound/soc/codecs/88pm860x-codec.c
> @@ -772,11 +772,12 @@ static const struct snd_soc_dapm_widget pm860x_dapm_widgets[] = {
>
>
> SND_SOC_DAPM_AIF_IN("I2S DIN", "I2S Playback", 0,
> - PM860X_DAC_EN_2, 0, 0),
> + SND_SOC_NOPM, 0, 0),
> SND_SOC_DAPM_AIF_IN("I2S DIN1", "I2S Playback", 0,
> - PM860X_DAC_EN_2, 0, 0),
> + SND_SOC_NOPM, 0, 0),
> SND_SOC_DAPM_AIF_OUT("I2S DOUT", "I2S Capture", 0,
> PM860X_I2S_IFACE_3, 5, 1),
> + SND_SOC_DAPM_SUPPLY("I2S CLK", PM860X_DAC_EN_2, 0, 0, NULL, 0),
> SND_SOC_DAPM_MUX("I2S Mic Mux", SND_SOC_NOPM, 0, 0, &i2s_mic_mux),
> SND_SOC_DAPM_MUX("ADC Left Mux", SND_SOC_NOPM, 0, 0, &adcl_mux),
> SND_SOC_DAPM_MUX("ADC Right Mux", SND_SOC_NOPM, 0, 0, &adcr_mux),
> @@ -868,6 +869,11 @@ static const struct snd_soc_dapm_route audio_map[] = {
> {"Left ADC", NULL, "Left ADC MOD"},
> {"Right ADC", NULL, "Right ADC MOD"},
>
> + /* I2S Clock */
> + {"I2S DIN", NULL, "I2S CLK"},
> + {"I2S DIN1", NULL, "I2S CLK"},
> + {"I2S DOUT", NULL, "I2S CLK"},
> +
> /* PCM/AIF1 Inputs */
> {"PCM SDO", NULL, "ADC Left Mux"},
> {"PCM SDO", NULL, "ADCR EC Mux"},
> --
> 1.7.0.4
>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
--
"You grabbed my hand and we fell into it, like a daydream - or a fever."
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [ASoC] 88pm860x - Incorporate the marvell errata regarding Audio Power-up Delay.
2011-09-19 11:38 ` [ASoC] 88pm860x - Incorporate the marvell errata regarding Audio Power-up Delay Bas Vermeulen
@ 2011-09-20 11:34 ` Mark Brown
0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2011-09-20 11:34 UTC (permalink / raw)
To: lrg; +Cc: Bas Vermeulen (CentricTSolve/Bochum), alsa-devel@alsa-project.org
On Mon, Sep 19, 2011 at 01:38:11PM +0200, Bas Vermeulen wrote:
> This patch implements the audio power-up delay errata for the
> 88PM8607, meaning the codec will actually be reset.
Adding Liam to this one too.
> From 55d78799fc7e492f582bc7feb4cb3251e8ef895d Mon Sep 17 00:00:00 2001
> From: Bas Vermeulen <bas.vermeulen@novero.com>
> Date: Mon, 19 Sep 2011 13:09:10 +0200
> Subject: [PATCH 2/2] [ASoC] 88pm860x-codec - reset the codec correctly
>
> Reset the codec according to the Audio power-up delay errata for the 88PM8607.
>
> Signed-off-by: Bas Vermeulen <bas.vermeulen@novero.com>
> ---
> sound/soc/codecs/88pm860x-codec.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/sound/soc/codecs/88pm860x-codec.c b/sound/soc/codecs/88pm860x-codec.c
> index 0198dbb..df7b4a0 100644
> --- a/sound/soc/codecs/88pm860x-codec.c
> +++ b/sound/soc/codecs/88pm860x-codec.c
> @@ -1179,6 +1179,9 @@ static int pm860x_set_bias_level(struct snd_soc_codec *codec,
> case SND_SOC_BIAS_STANDBY:
> if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) {
> /* Enable Audio PLL & Audio section */
> + data = AUDIO_PLL | AUDIO_SECTION_ON;
> + pm860x_reg_write(codec->control_data, REG_MISC2, data);
> + udelay(300);
> data = AUDIO_PLL | AUDIO_SECTION_RESET
> | AUDIO_SECTION_ON;
> pm860x_reg_write(codec->control_data, REG_MISC2, data);
> --
> 1.7.0.4
>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
--
"You grabbed my hand and we fell into it, like a daydream - or a fever."
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [ASoC] 88pm860x - Allow independent use of I2S capture and playback
2011-09-19 11:35 ` [ASoC] 88pm860x - Allow independent use of I2S capture and playback Bas Vermeulen
2011-09-20 11:34 ` Mark Brown
@ 2011-09-21 14:55 ` Mark Brown
1 sibling, 0 replies; 7+ messages in thread
From: Mark Brown @ 2011-09-21 14:55 UTC (permalink / raw)
To: Bas Vermeulen; +Cc: alsa-devel@alsa-project.org
On Mon, Sep 19, 2011 at 01:35:57PM +0200, Bas Vermeulen wrote:
> Attached is a patch to turn the I2S clock on for both of I2S capture
> and playback instead of just playback.
Since Liam is now travelling I've applied this and your other patch,
thanks.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-09-21 14:55 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-16 14:07 ASoC/DAPM: How to make the DAPM routing complete? Bas Vermeulen
2011-09-17 13:32 ` Mark Brown
2011-09-19 11:35 ` [ASoC] 88pm860x - Allow independent use of I2S capture and playback Bas Vermeulen
2011-09-20 11:34 ` Mark Brown
2011-09-21 14:55 ` Mark Brown
2011-09-19 11:38 ` [ASoC] 88pm860x - Incorporate the marvell errata regarding Audio Power-up Delay Bas Vermeulen
2011-09-20 11:34 ` Mark Brown
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).