From: leoy@marvell.com (Leo Yan)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/4] ASoC: add mmp brownstone support
Date: Tue, 29 May 2012 11:04:35 +0800 [thread overview]
Message-ID: <4FC43CC3.3020506@marvell.com> (raw)
In-Reply-To: <20120528151305.GL4032@opensource.wolfsonmicro.com>
On 05/28/2012 11:13 PM, Mark Brown wrote:
> 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.
We wrote the code which has referred the spitz.c. :-) We want to provide
brownstone_ext_control is for upper level user space's
interface; So we can remove this control function, and user space can
directly set the swtich for Mic/HS, right?
>
>> + 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?
for brownstone, it used wm8994's auto-detecting function, so it used
driver/mfd/wm8994-irq.c, so we need create secondary irq for it, and
need debug for the irq.
Now we don't use soc-jack related APIs, we will change to use soc-jack
related APIs for that.
>
>> + 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".
prev parent reply other threads:[~2012-05-29 3:04 UTC|newest]
Thread overview: 42+ 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 7:53 ` Vinod Koul
2012-05-25 8:05 ` Russell King - ARM Linux
2012-05-25 8:05 ` Russell King - ARM Linux
2012-05-25 8:47 ` zhangfei gao
2012-05-25 8:47 ` [alsa-devel] " zhangfei gao
2012-05-25 9:42 ` Russell King - ARM Linux
2012-05-25 9:42 ` [alsa-devel] " Russell King - ARM Linux
2012-05-29 5:14 ` zhangfei gao
2012-05-29 5:14 ` [alsa-devel] " zhangfei gao
2012-05-29 5:18 ` Vinod Koul
2012-05-29 5:18 ` [alsa-devel] " Vinod Koul
2012-05-29 7:33 ` Russell King - ARM Linux
2012-05-29 7:33 ` [alsa-devel] " Russell King - ARM Linux
2012-05-29 7:57 ` zhangfei gao
2012-05-29 7:57 ` [alsa-devel] " zhangfei gao
2012-05-29 8:01 ` Russell King - ARM Linux
2012-05-29 8:01 ` Russell King - ARM Linux
2012-05-29 9:02 ` Mark Brown
2012-05-29 9:02 ` [alsa-devel] " Mark Brown
2012-05-29 9:21 ` Russell King - ARM Linux
2012-05-29 9:21 ` [alsa-devel] " Russell King - ARM Linux
2012-05-29 11:03 ` Lars-Peter Clausen
2012-05-29 11:03 ` [alsa-devel] " Lars-Peter Clausen
2012-05-29 13:14 ` Mark Brown
2012-05-29 13:14 ` [alsa-devel] " Mark Brown
2012-05-29 13:46 ` Russell King - ARM Linux
2012-05-29 13:46 ` [alsa-devel] " Russell King - ARM Linux
2012-05-29 23:55 ` Mark Brown
2012-05-29 23:55 ` [alsa-devel] " 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-28 14:59 ` Mark Brown
2012-05-29 5:23 ` zhangfei gao
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
2012-05-28 15:13 ` Mark Brown
2012-05-29 3:04 ` Leo Yan [this message]
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=4FC43CC3.3020506@marvell.com \
--to=leoy@marvell.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 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.