alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Anil Kumar <anilk4.v@gmail.com>
Cc: alsa-devel@alsa-project.org, tony@atomide.com,
	devicetree-discuss@lists.ozlabs.org,
	linux-kernel@vger.kernel.org,
	Liam Girdwood <liam.r.girdwood@linux.intel.com>,
	tiwai@suse.de, thomas@tomweber.eu
Subject: Re: Sound record on Devkit8000 with DT boot issue
Date: Mon, 11 Feb 2013 14:17:41 +0100	[thread overview]
Message-ID: <5118EF75.30107@ti.com> (raw)
In-Reply-To: <CABYxbz5ECxoWZtkfL3UbZ=R4LVoNeMVxjYbPdZoarstCod-gQw@mail.gmail.com>

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

  reply	other threads:[~2013-02-11 13:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-10 15:21 Sound record on Devkit8000 with DT boot issue Anil Kumar
2013-02-11 13:17 ` Peter Ujfalusi [this message]
2013-02-11 17:58   ` Anil Kumar
2013-02-11 18:14     ` Peter Ujfalusi
2013-02-12  3:20       ` Anil Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5118EF75.30107@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=anilk4.v@gmail.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thomas@tomweber.eu \
    --cc=tiwai@suse.de \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).