All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: NeilBrown <neilb@suse.de>
Cc: Mark@suse.de, alsa-devel@alsa-project.org,
	Brown <broonie@opensource.wolfsonmicro.com>
Subject: Re: Help with adding mic bias to omap-twl4030 audio driver
Date: Mon, 31 Dec 2012 11:33:03 +0100	[thread overview]
Message-ID: <50E169DF.2030304@ti.com> (raw)
In-Reply-To: <20121218101807.75187e8c@notabene.brown>

Hi Neil,

On 12/18/2012 12:18 AM, NeilBrown wrote:
> Hi Peter,
>  I recently discovered your omap-twl4030 driver and thought to use it to
>  replace the hacked-around driver I'm using for the GTA04 mobile phone
>  platform.
> 
>  It works fine for playing sound out the speaker, but the microphone doesn't
>  work - I think because there is no mechanism to enable the microphone bias.
> 
>  I copied some bits out of the old driver - just enough to make it work.
>  However this probably makes the code specific to my platform.
> 
>  So I'm wondering if you could give me some guidelines on how this "should"
>  be done.  Should these tables be passed in with the platform_data (I haven't
>  graduated to device-tree yet)?

I'm going to send a series soon to update the omap-twl4030 machine driver.
This update going to add support for microphones and all other routings as well.
With the upcoming series the omap-twl4030 will support zoom2 and sdp3430. I'll
CC you with the series so you can take a look if it is going to help with your
board.

> 
>  My 'hacked-up' driver has a few more entries in this table than just those
>  few, but I wanted to strip it down to what is needed for the main microphone
>  to work.
> 
>  Thanks for any help you can provide,
> NeilBrown
> 
> P.S is there some good reason to use the name
>   struct omap_tw4030_pdata
> rather than
>   struct omap_twl4030_pdata
> 
> (i.e. with the 'l')??
> 
> diff --git a/sound/soc/omap/omap-twl4030.c b/sound/soc/omap/omap-twl4030.c
> index 3b97b879..aa4d866 100644
> --- a/sound/soc/omap/omap-twl4030.c
> +++ b/sound/soc/omap/omap-twl4030.c
> @@ -87,6 +87,32 @@ static struct snd_soc_ops omap_twl4030_ops = {
>  	.hw_params = omap_twl4030_hw_params,
>  };
>  
> +static const struct snd_soc_dapm_widget gta04_dapm_widgets[] = {
> +	SND_SOC_DAPM_MIC("Internal Mic", NULL),
> +};
> +
> +static const struct snd_soc_dapm_route audio_map[] = {
> +	{"MAINMIC", NULL, "Mic Bias 1"},
> +	{"Mic Bias 1", NULL, "Internal Mic"},
> +};
> +
> +static int omap3gta04_init(struct snd_soc_pcm_runtime *runtime)
> +{
> +	int ret;
> +	struct snd_soc_codec *codec = runtime->codec;
> +	struct snd_soc_dapm_context *dapm = &codec->dapm;
> +
> +	ret = snd_soc_dapm_new_controls(dapm, gta04_dapm_widgets,
> +					ARRAY_SIZE(gta04_dapm_widgets));
> +	if (ret < 0)
> +		return ret;
> +
> +	snd_soc_dapm_add_routes(dapm, audio_map,
> +				ARRAY_SIZE(audio_map));
> +
> +	return snd_soc_dapm_sync(dapm);
> +}
> +
>  /* Digital audio interface glue - connects codec <--> CPU */
>  static struct snd_soc_dai_link omap_twl4030_dai_links[] = {
>  	{
> @@ -97,6 +123,7 @@ static struct snd_soc_dai_link omap_twl4030_dai_links[] = {
>  		.platform_name = "omap-pcm-audio",
>  		.codec_name = "twl4030-codec",
>  		.ops = &omap_twl4030_ops,
> +		.init = &omap3gta04_init,
>  	},
>  };
>  
> 


-- 
Péter

           reply	other threads:[~2012-12-31 10:33 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20121218101807.75187e8c@notabene.brown>]

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=50E169DF.2030304@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=Mark@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=neilb@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.