alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* Sound record on Devkit8000 with DT boot issue
@ 2013-02-10 15:21 Anil Kumar
  2013-02-11 13:17 ` Peter Ujfalusi
  0 siblings, 1 reply; 5+ messages in thread
From: Anil Kumar @ 2013-02-10 15:21 UTC (permalink / raw)
  To: linux-kernel, devicetree-discuss, alsa-devel
  Cc: tony, thomas, perex, tiwai, lrg, Peter Ujfalusi

Hi All,

I am working on Devkit8000 and adding DT support for that. I am trying
to add sound DT node support for this boards.
I have nearly done with this but facing issue on record. I do not have
much knowledge of twl4030 audio codec but with
small Hack[1] (as MainMic connected to the input jack)  i am able to
record sound on Devkit8000.
I do not know that MICBIAS1_EN can be enable by amixer commands.
Could you please help me to get out of this ?


1) Hack [1]

diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
index 63b280b..6780681 100644
--- a/sound/soc/codecs/twl4030.c
+++ b/sound/soc/codecs/twl4030.c
@@ -1473,7 +1473,7 @@ static const struct snd_soc_dapm_widget
twl4030_dapm_widgets[] = {
        SND_SOC_DAPM_SUPPLY("micbias2 select", TWL4030_REG_MICBIAS_CTL, 6, 0,
                            NULL, 0),

-       SND_SOC_DAPM_MICBIAS("Mic Bias 1", TWL4030_REG_MICBIAS_CTL, 0, 0),
+       SND_SOC_DAPM_MICBIAS("Mic Bias 1", TWL4030_REG_MICBIAS_CTL, 0, 1),
        SND_SOC_DAPM_MICBIAS("Mic Bias 2", TWL4030_REG_MICBIAS_CTL, 1, 0),
        SND_SOC_DAPM_MICBIAS("Headset Mic Bias", TWL4030_REG_MICBIAS_CTL, 2, 0),


2) Sound DT node patch for Devkit8000

diff --git a/arch/arm/boot/dts/omap3-
devkit8000.dts b/arch/arm/boot/dts/omap3-devkit8000.dts
index dc59272..5f3eec0 100644
--- a/arch/arm/boot/dts/omap3-devkit8000.dts
+++ b/arch/arm/boot/dts/omap3-devkit8000.dts
@@ -44,11 +44,22 @@
                 };

        };
+
+       sound {
+               compatible = "ti,omap-twl4030";
+               ti,model = "devkit8000";
+
+               ti,mcbsp = <&mcbsp2>;
+               ti,codec = <&twl_audio>;
+       };
 };

 &omap3_pmx_core {
        pinctrl-names = "default";
-       pinctrl-0 = <&i2c1_pins>;
+       pinctrl-0 = <
+                       &i2c1_pins
+                       &mcbsp2_pins
+               >;

        leds_pins: pinmux_led_pins {
                pinctrl-single,pins = <
@@ -65,6 +76,21 @@
                        0x18c 0x118     /* I2C1_SDA */
                 >;
        };
+
+       mcbsp2_pins: pinmux_mcbsp2_pins {
+                pinctrl-single,pins = <
+                       /*
+                        * MCBSP2_FSX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT,
+                        * MCBSP2_CLKX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT
+                        */
+                       0x10c 0x01000100
+                       /*
+                        * MCBSP2_DR, OMAP_MUX_MODE0 | OMAP_PIN_INPUT,
+                        * MCBSP2_DX, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT
+                        */
+                       0x110 0x00000100
+               >;
+       };
 };

 &i2c1 {
@@ -74,6 +100,14 @@
                reg = <0x48>;
                interrupts = <7>;       /* SYS_NIRQ cascaded to intc */
                interrupt-parent = <&intc>;
+
+               twl_audio: audio {
+                       compatible = "ti,twl4030-audio";
+                       codec {
+                               ti,ramp_delay_value = <3>;
+                               ti,offset_cncl_path = <0x31>;
+                       };
+               };
        };
 };

3) Playback amixer commands
   amixer set 'PredriveR Mixer AudioR2' on
   amixer set 'PredriveL Mixer AudioL2' on
   amixer set PreDriv 100 unmute
   amixer set 'DAC2 Digital Fine' 100

Thanks,
Anil

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: Sound record on Devkit8000 with DT boot issue
  2013-02-10 15:21 Sound record on Devkit8000 with DT boot issue Anil Kumar
@ 2013-02-11 13:17 ` Peter Ujfalusi
  2013-02-11 17:58   ` Anil Kumar
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Ujfalusi @ 2013-02-11 13:17 UTC (permalink / raw)
  To: Anil Kumar
  Cc: alsa-devel, tony, devicetree-discuss, linux-kernel, Liam Girdwood,
	tiwai, thomas

On 02/10/2013 04:21 PM, Anil Kumar wrote:
> Hi All,
> 
> I am working on Devkit8000 and adding DT support for that. I am trying
> to add sound DT node support for this boards.
> I have nearly done with this but facing issue on record. I do not have
> much knowledge of twl4030 audio codec but with
> small Hack[1] (as MainMic connected to the input jack)  i am able to
> record sound on Devkit8000.
> I do not know that MICBIAS1_EN can be enable by amixer commands.
> Could you please help me to get out of this ?

You need to pass the routing information via DT for Devkit8000. This is not
done for the BeagleBoard since it works without it (no need for MICBIAS for
example)

> 
> 
> 1) Hack [1]
> 
> diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
> index 63b280b..6780681 100644
> --- a/sound/soc/codecs/twl4030.c
> +++ b/sound/soc/codecs/twl4030.c
> @@ -1473,7 +1473,7 @@ static const struct snd_soc_dapm_widget
> twl4030_dapm_widgets[] = {
>         SND_SOC_DAPM_SUPPLY("micbias2 select", TWL4030_REG_MICBIAS_CTL, 6, 0,
>                             NULL, 0),
> 
> -       SND_SOC_DAPM_MICBIAS("Mic Bias 1", TWL4030_REG_MICBIAS_CTL, 0, 0),
> +       SND_SOC_DAPM_MICBIAS("Mic Bias 1", TWL4030_REG_MICBIAS_CTL, 0, 1),

Yes, this is HACK and it is wrong at the same time.

>         SND_SOC_DAPM_MICBIAS("Mic Bias 2", TWL4030_REG_MICBIAS_CTL, 1, 0),
>         SND_SOC_DAPM_MICBIAS("Headset Mic Bias", TWL4030_REG_MICBIAS_CTL, 2, 0),
> 
> 
> 2) Sound DT node patch for Devkit8000
> 
> diff --git a/arch/arm/boot/dts/omap3-
> devkit8000.dts b/arch/arm/boot/dts/omap3-devkit8000.dts
> index dc59272..5f3eec0 100644
> --- a/arch/arm/boot/dts/omap3-devkit8000.dts
> +++ b/arch/arm/boot/dts/omap3-devkit8000.dts
> @@ -44,11 +44,22 @@
>                  };
> 
>         };
> +
> +       sound {
> +               compatible = "ti,omap-twl4030";
> +               ti,model = "devkit8000";
> +
> +               ti,mcbsp = <&mcbsp2>;
> +               ti,codec = <&twl_audio>;

Here you should have something like:
ti,audio-routing =
	"Ext Spk", "PREDRIVEL",
	"Ext Spk", "PREDRIVER",
	"MAINMIC", "Main Mic",
	"Main Mic", "Mic Bias 1";

So you connect the MicBias1 to Main Mic. When you start playback MicBias1 will
be turned on for you.

> +       };
>  };
> 
>  &omap3_pmx_core {
>         pinctrl-names = "default";
> -       pinctrl-0 = <&i2c1_pins>;
> +       pinctrl-0 = <
> +                       &i2c1_pins
> +                       &mcbsp2_pins
> +               >;
> 
>         leds_pins: pinmux_led_pins {
>                 pinctrl-single,pins = <
> @@ -65,6 +76,21 @@
>                         0x18c 0x118     /* I2C1_SDA */
>                  >;
>         };
> +
> +       mcbsp2_pins: pinmux_mcbsp2_pins {
> +                pinctrl-single,pins = <
> +                       /*
> +                        * MCBSP2_FSX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT,
> +                        * MCBSP2_CLKX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT
> +                        */
> +                       0x10c 0x01000100
> +                       /*
> +                        * MCBSP2_DR, OMAP_MUX_MODE0 | OMAP_PIN_INPUT,
> +                        * MCBSP2_DX, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT
> +                        */
> +                       0x110 0x00000100
> +               >;
> +       };
>  };
> 
>  &i2c1 {
> @@ -74,6 +100,14 @@
>                 reg = <0x48>;
>                 interrupts = <7>;       /* SYS_NIRQ cascaded to intc */
>                 interrupt-parent = <&intc>;
> +
> +               twl_audio: audio {
> +                       compatible = "ti,twl4030-audio";
> +                       codec {
> +                               ti,ramp_delay_value = <3>;
> +                               ti,offset_cncl_path = <0x31>;
> +                       };
> +               };
>         };
>  };
> 
> 3) Playback amixer commands
>    amixer set 'PredriveR Mixer AudioR2' on
>    amixer set 'PredriveL Mixer AudioL2' on
>    amixer set PreDriv 100 unmute
>    amixer set 'DAC2 Digital Fine' 100
> 
> Thanks,
> Anil
> 


-- 
Péter

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Sound record on Devkit8000 with DT boot issue
  2013-02-11 13:17 ` Peter Ujfalusi
@ 2013-02-11 17:58   ` Anil Kumar
  2013-02-11 18:14     ` Peter Ujfalusi
  0 siblings, 1 reply; 5+ messages in thread
From: Anil Kumar @ 2013-02-11 17:58 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: linux-kernel, devicetree-discuss, alsa-devel, tony, thomas, perex,
	tiwai, Liam Girdwood

Hi Peter,

Thanks for helping me. please see my comment inline

On Mon, Feb 11, 2013 at 6:47 PM, Peter Ujfalusi <peter.ujfalusi@ti.com> wrote:
> On 02/10/2013 04:21 PM, Anil Kumar wrote:
>> Hi All,
>>
>> I am working on Devkit8000 and adding DT support for that. I am trying
>> to add sound DT node support for this boards.
>> I have nearly done with this but facing issue on record. I do not have
>> much knowledge of twl4030 audio codec but with
>> small Hack[1] (as MainMic connected to the input jack)  i am able to
>> record sound on Devkit8000.
>> I do not know that MICBIAS1_EN can be enable by amixer commands.
>> Could you please help me to get out of this ?
>
> You need to pass the routing information via DT for Devkit8000. This is not
> done for the BeagleBoard since it works without it (no need for MICBIAS for
> example)
>
>>
>>
>> 1) Hack [1]
>>
>> diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
>> index 63b280b..6780681 100644
>> --- a/sound/soc/codecs/twl4030.c
>> +++ b/sound/soc/codecs/twl4030.c
>> @@ -1473,7 +1473,7 @@ static const struct snd_soc_dapm_widget
>> twl4030_dapm_widgets[] = {
>>         SND_SOC_DAPM_SUPPLY("micbias2 select", TWL4030_REG_MICBIAS_CTL, 6, 0,
>>                             NULL, 0),
>>
>> -       SND_SOC_DAPM_MICBIAS("Mic Bias 1", TWL4030_REG_MICBIAS_CTL, 0, 0),
>> +       SND_SOC_DAPM_MICBIAS("Mic Bias 1", TWL4030_REG_MICBIAS_CTL, 0, 1),
>
> Yes, this is HACK and it is wrong at the same time.

Agree

>
>>         SND_SOC_DAPM_MICBIAS("Mic Bias 2", TWL4030_REG_MICBIAS_CTL, 1, 0),
>>         SND_SOC_DAPM_MICBIAS("Headset Mic Bias", TWL4030_REG_MICBIAS_CTL, 2, 0),
>>
>>
>> 2) Sound DT node patch for Devkit8000
>>
>> diff --git a/arch/arm/boot/dts/omap3-
>> devkit8000.dts b/arch/arm/boot/dts/omap3-devkit8000.dts
>> index dc59272..5f3eec0 100644
>> --- a/arch/arm/boot/dts/omap3-devkit8000.dts
>> +++ b/arch/arm/boot/dts/omap3-devkit8000.dts
>> @@ -44,11 +44,22 @@
>>                  };
>>
>>         };
>> +
>> +       sound {
>> +               compatible = "ti,omap-twl4030";
>> +               ti,model = "devkit8000";
>> +
>> +               ti,mcbsp = <&mcbsp2>;
>> +               ti,codec = <&twl_audio>;
>
> Here you should have something like:
> ti,audio-routing =
>         "Ext Spk", "PREDRIVEL",
>         "Ext Spk", "PREDRIVER",
>         "MAINMIC", "Main Mic",
>         "Main Mic", "Mic Bias 1";
>
> So you connect the MicBias1 to Main Mic. When you start playback MicBias1 will
> be turned on for you.

I tried with this routing (next-20130211 tag kernel). But it is not
working for me.
So i have gone through other board and found snd_soc_dapm_route for

1) zoom2.c
       {"MAINMIC", NULL, "Mic Bias 1"},
       {"Mic Bias 1", NULL, "Ext Mic"},

2) omap3pandora.c
        {"MAINMIC", NULL, "Mic Bias 1"},
        {"Mic Bias 1", NULL, "Mic (internal)"},

But for omap-twl4030.c it is
        {"MAINMIC", NULL, "Main Mic"},
        {"Main Mic", NULL, "Mic Bias 1"},

 It Should will be as ?
        {"MAINMIC", NULL, "Mic Bias 1"},
        {"Mic Bias 1", NULL, "Main Mic"},

Because with this i am able to get audio on Devkit8000 as
             ti,audio-routing =
                        "Ext Spk", "PREDRIVEL",
                        "Ext Spk", "PREDRIVER",
                        "MAINMIC", "Mic Bias 1",
                        "Mic Bias 1", "Main Mic";

Sorry if i am saying nonsense.

Thanks,
Anil
[...]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Sound record on Devkit8000 with DT boot issue
  2013-02-11 17:58   ` Anil Kumar
@ 2013-02-11 18:14     ` Peter Ujfalusi
  2013-02-12  3:20       ` Anil Kumar
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Ujfalusi @ 2013-02-11 18:14 UTC (permalink / raw)
  To: Anil Kumar
  Cc: alsa-devel, tony, devicetree-discuss, linux-kernel, Liam Girdwood,
	tiwai, thomas

Hi,

On 02/11/2013 06:58 PM, Anil Kumar wrote:
>> Here you should have something like:
>> ti,audio-routing =
>>         "Ext Spk", "PREDRIVEL",
>>         "Ext Spk", "PREDRIVER",
>>         "MAINMIC", "Main Mic",
>>         "Main Mic", "Mic Bias 1";
>>
>> So you connect the MicBias1 to Main Mic. When you start playback MicBias1 will
>> be turned on for you.
> 
> I tried with this routing (next-20130211 tag kernel). But it is not
> working for me.
> So i have gone through other board and found snd_soc_dapm_route for
> 
> 1) zoom2.c
>        {"MAINMIC", NULL, "Mic Bias 1"},
>        {"Mic Bias 1", NULL, "Ext Mic"},
> 
> 2) omap3pandora.c
>         {"MAINMIC", NULL, "Mic Bias 1"},
>         {"Mic Bias 1", NULL, "Mic (internal)"},
> 
> But for omap-twl4030.c it is
>         {"MAINMIC", NULL, "Main Mic"},
>         {"Main Mic", NULL, "Mic Bias 1"},
> 
>  It Should will be as ?
>         {"MAINMIC", NULL, "Mic Bias 1"},
>         {"Mic Bias 1", NULL, "Main Mic"},
> 
> Because with this i am able to get audio on Devkit8000 as
>              ti,audio-routing =
>                         "Ext Spk", "PREDRIVEL",
>                         "Ext Spk", "PREDRIVER",
>                         "MAINMIC", "Mic Bias 1",
>                         "Mic Bias 1", "Main Mic";

In 3.9 this should not work...

linux-next should not have zoom2 at least and I converted the machine drivers
as well in regards to micbias handling:
e04d6e5 ASoC: twl4030: Convert MICBIAS to SUPPLY widget
57d61b9 ASoC: OMAP: Remove obsolete machine drivers for Zoom2 and SDP3430

-- 
Péter

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Sound record on Devkit8000 with DT boot issue
  2013-02-11 18:14     ` Peter Ujfalusi
@ 2013-02-12  3:20       ` Anil Kumar
  0 siblings, 0 replies; 5+ messages in thread
From: Anil Kumar @ 2013-02-12  3:20 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: linux-kernel, devicetree-discuss, alsa-devel, tony, thomas, perex,
	tiwai, Liam Girdwood

Hi Peter,

On Mon, Feb 11, 2013 at 11:44 PM, Peter Ujfalusi <peter.ujfalusi@ti.com> wrote:
> Hi,
>
> On 02/11/2013 06:58 PM, Anil Kumar wrote:
>>> Here you should have something like:
>>> ti,audio-routing =
>>>         "Ext Spk", "PREDRIVEL",
>>>         "Ext Spk", "PREDRIVER",
>>>         "MAINMIC", "Main Mic",
>>>         "Main Mic", "Mic Bias 1";
>>>
>>> So you connect the MicBias1 to Main Mic. When you start playback MicBias1 will
>>> be turned on for you.
>>
>> I tried with this routing (next-20130211 tag kernel). But it is not
>> working for me.
>> So i have gone through other board and found snd_soc_dapm_route for
>>
>> 1) zoom2.c
>>        {"MAINMIC", NULL, "Mic Bias 1"},
>>        {"Mic Bias 1", NULL, "Ext Mic"},

I was giving zoom2 reference from kernel 3.8-rc5.

>>
>> 2) omap3pandora.c
>>         {"MAINMIC", NULL, "Mic Bias 1"},
>>         {"Mic Bias 1", NULL, "Mic (internal)"},

same as above comment.

>>
>> But for omap-twl4030.c it is
>>         {"MAINMIC", NULL, "Main Mic"},
>>         {"Main Mic", NULL, "Mic Bias 1"},
>>
>>  It Should will be as ?
>>         {"MAINMIC", NULL, "Mic Bias 1"},
>>         {"Mic Bias 1", NULL, "Main Mic"},
>>
>> Because with this i am able to get audio on Devkit8000 as
>>              ti,audio-routing =
>>                         "Ext Spk", "PREDRIVEL",
>>                         "Ext Spk", "PREDRIVER",
>>                         "MAINMIC", "Mic Bias 1",
>>                         "Mic Bias 1", "Main Mic";
>
> In 3.9 this should not work...
>
> linux-next should not have zoom2 at least and I converted the machine drivers
> as well in regards to micbias handling:
> e04d6e5 ASoC: twl4030: Convert MICBIAS to SUPPLY widget
> 57d61b9 ASoC: OMAP: Remove obsolete machine drivers for Zoom2 and SDP3430

My board is not botting with linux-next ((next-20130211). So i have
taken omap-twl4030.c changes from next-20130211
and merged into 3.8-rc5 as it does have. But missed changes for
twl4030.c. With these all changes it is working for me now .
Sorry for noise.

I am really thanks for this.
Anil
[...]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-02-12  3:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-10 15:21 Sound record on Devkit8000 with DT boot issue Anil Kumar
2013-02-11 13:17 ` Peter Ujfalusi
2013-02-11 17:58   ` Anil Kumar
2013-02-11 18:14     ` Peter Ujfalusi
2013-02-12  3:20       ` Anil Kumar

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).