From: broonie@opensource.wolfsonmicro.com (Mark Brown)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/4] ASoC: add mmp brownstone support
Date: Mon, 28 May 2012 16:13:06 +0100 [thread overview]
Message-ID: <20120528151305.GL4032@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1337929863-31885-5-git-send-email-zhangfei.gao@marvell.com>
On Fri, May 25, 2012 at 03:11:03PM +0800, Zhangfei Gao wrote:
> +config SND_MMP_SOC_BROWNSTONE
> + tristate "SoC Audio support for Marvell Brownstone"
> + depends on SND_MMP_SOC && MACH_BROWNSTONE
> + select SND_MMP_SOC_SSPA
> + select SND_SOC_WM8994
Should depend on MFD_WM8994.
> +static void brownstone_ext_control(struct snd_soc_dapm_context *dapm)
> +{
This stuff is really unexpected in a modern machine driver, it was used
on things like spitz due to the odd wiring but for modern stuff I'd not
expect to see it.
> + if (brownstone_spk_func == BROWNSTONE_SPK_ON) {
> + snd_soc_dapm_enable_pin(dapm, "Ext Left Spk");
> + snd_soc_dapm_enable_pin(dapm, "Ext Right Spk");
> + } else {
> + snd_soc_dapm_disable_pin(dapm, "Ext Left Spk");
> + snd_soc_dapm_disable_pin(dapm, "Ext Right Spk");
> + }
Just define a single widget for the speakers and use a
SND_SOC_DAPM_PIN_SWITCH().
> + /* set up jack connection */
> + switch (brownstone_jack_func) {
> + case BROWNSTONE_HP:
> + snd_soc_dapm_disable_pin(dapm, "Headset Mic");
> + snd_soc_dapm_enable_pin(dapm, "Main Mic");
> + snd_soc_dapm_enable_pin(dapm, "Headset Stereophone");
> + break;
This should all be autodetectable, users having to manually select it is
*very* unusual. Is there really no accessory detection hardware on the
board?
> + snd_soc_dapm_enable_pin(dapm, "Ext Left Spk");
> + snd_soc_dapm_enable_pin(dapm, "Ext Right Spk");
> + snd_soc_dapm_enable_pin(dapm, "Headset Stereophone");
> + snd_soc_dapm_enable_pin(dapm, "Headset Mic");
> + snd_soc_dapm_enable_pin(dapm, "Main Mic");
Everything is enable dby default.
> + /* turn on micbias 1/2 always */
> + snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_1,
> + WM8994_MICB1_ENA_MASK |
> + WM8994_MICB2_ENA_MASK,
> + WM8994_MICB1_ENA |
> + WM8994_MICB2_ENA);
If you need to do this force enable them with DAPM, this won't work
anyway as the widgets will be powered off as soon as DAPM notices
they're on.
> + snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S |
> + SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS);
> +
> + snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S |
> + SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS);
Set this in the dai_link.
> +static struct platform_driver mmp_driver = {
> + .driver = {
> + .name = "mmp-audio",
Should probably be something like "brownstone-audio".
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120528/cea85ab7/attachment-0001.sig>
next prev parent reply other threads:[~2012-05-28 15:13 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-25 7:10 [PATCH 0/4] mmp audio support Zhangfei Gao
2012-05-25 7:11 ` [PATCH] dmaengine: mmp_tdma: add mmp tdma support Zhangfei Gao
2012-05-25 7:11 ` [PATCH 2/4] ASoC: mmp: add audio dma support Zhangfei Gao
2012-05-25 7:53 ` Vinod Koul
2012-05-25 8:05 ` Russell King - ARM Linux
2012-05-25 8:47 ` [alsa-devel] " zhangfei gao
2012-05-25 9:42 ` Russell King - ARM Linux
2012-05-29 5:14 ` zhangfei gao
2012-05-29 5:18 ` Vinod Koul
2012-05-29 7:33 ` Russell King - ARM Linux
2012-05-29 7:57 ` zhangfei gao
2012-05-29 8:01 ` Russell King - ARM Linux
2012-05-29 9:02 ` Mark Brown
2012-05-29 9:21 ` Russell King - ARM Linux
2012-05-29 11:03 ` Lars-Peter Clausen
2012-05-29 13:14 ` Mark Brown
2012-05-29 13:46 ` Russell King - ARM Linux
2012-05-29 23:55 ` Mark Brown
2012-05-25 7:11 ` [PATCH 3/4] ASOC: mmp: add sspa support Zhangfei Gao
2012-05-28 14:59 ` Mark Brown
2012-05-29 5:23 ` [alsa-devel] " zhangfei gao
2012-05-25 7:11 ` [PATCH 4/4] ASoC: add mmp brownstone support Zhangfei Gao
2012-05-28 15:13 ` Mark Brown [this message]
2012-05-29 3:04 ` Leo Yan
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=20120528151305.GL4032@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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).