From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Ajye Huang <ajye_huang@compal.corp-partner.google.com>,
linux-kernel@vger.kernel.org
Cc: "Mark Brown" <broonie@kernel.org>,
"Liam Girdwood" <lgirdwood@gmail.com>,
"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
"Rob Herring" <robh+dt@kernel.org>,
linux-mediatek@lists.infradead.org,
"chunxu . li" <chunxu.li@mediatek.com>,
"Takashi Iwai" <tiwai@suse.com>,
"Jaroslav Kysela" <perex@perex.cz>,
"Jiaxin Yu" <jiaxin.yu@mediatek.com>,
"Matthias Brugger" <matthias.bgg@gmail.com>,
"Nícolas F . R . A . Prado" <nfraprado@collabora.com>,
linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
alsa-devel@alsa-project.org
Subject: Re: [PATCH v5 2/2] ASoC: mediatek: mt8186-rt5682: Modify machine driver for two DMICs case
Date: Wed, 2 Nov 2022 11:44:13 +0100 [thread overview]
Message-ID: <549e1ff6-821a-1c26-0a4f-021bed27b093@collabora.com> (raw)
In-Reply-To: <20221031122224.1846221-3-ajye_huang@compal.corp-partner.google.com>
Il 31/10/22 13:22, Ajye Huang ha scritto:
> Having two DMICs, a front DMIC and a Rear DMIC,
> but only host audio input AUX port0 is used for these two Dmics.
> A "dmic-gpios" property is used for a mixer control to switch
> the dmic signal source between the Front and Rear Dmic.
>
> Refer to this one as an example,
> commit 3cfbf07c6d27
> ("ASoC: qcom: sc7180: Modify machine driver for 2mic")
>
> Signed-off-by: Ajye Huang <ajye_huang@compal.corp-partner.google.com>
> ---
> .../mt8186/mt8186-mt6366-rt1019-rt5682s.c | 102 +++++++++++++++++-
> 1 file changed, 101 insertions(+), 1 deletion(-)
>
> diff --git a/sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.c b/sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.c
> index 2414c5b77233..75351734464c 100644
> --- a/sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.c
> +++ b/sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.c
> @@ -7,6 +7,8 @@
> // Author: Jiaxin Yu <jiaxin.yu@mediatek.com>
> //
>
> +#include <linux/gpio.h>
> +#include <linux/gpio/consumer.h>
> #include <linux/input.h>
> #include <linux/module.h>
> #include <linux/of_device.h>
> @@ -39,6 +41,8 @@
>
> struct mt8186_mt6366_rt1019_rt5682s_priv {
> struct snd_soc_jack headset_jack, hdmi_jack;
> + struct gpio_desc *dmic_sel;
> + int dmic_switch;
> };
>
> /* Headset jack detection DAPM pins */
> @@ -68,6 +72,94 @@ static struct snd_soc_codec_conf mt8186_mt6366_rt1019_rt5682s_codec_conf[] = {
> },
> };
>
> +static int dmic_get(struct snd_kcontrol *kcontrol,
> + struct snd_ctl_elem_value *ucontrol)
> +{
> + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol);
> + struct mtk_soc_card_data *soc_card_data =
> + snd_soc_card_get_drvdata(dapm->card);
> + struct mt8186_mt6366_rt1019_rt5682s_priv *priv = soc_card_data->mach_priv;
> +
> + ucontrol->value.integer.value[0] = priv->dmic_switch;
> + return 0;
> +}
> +
> +static int dmic_set(struct snd_kcontrol *kcontrol,
> + struct snd_ctl_elem_value *ucontrol)
> +{
> + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol);
> + struct mtk_soc_card_data *soc_card_data =
> + snd_soc_card_get_drvdata(dapm->card);
> + struct mt8186_mt6366_rt1019_rt5682s_priv *priv = soc_card_data->mach_priv;
> +
> + priv->dmic_switch = ucontrol->value.integer.value[0];
> + if (priv->dmic_sel) {
> + gpiod_set_value(priv->dmic_sel, priv->dmic_switch);
> + dev_info(dapm->card->dev, "dmic_set_value %d\n",
> + priv->dmic_switch);
> + }
> + return 0;
> +}
> +
> +static const char * const dmic_mux_text[] = {
> + "FrontMic",
> + "RearMic",
Why are the two words joined?
s/FrontMic/Front Mic/g
s/RearMic/Rear Mic/g
Like that, we keep it consistent with the naming that was given in the commit
that you mentioned in the commit description.
Regards,
Angelo
next prev parent reply other threads:[~2022-11-02 10:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-31 12:22 [PATCH v5 0/2] Modify documentation and machine driver for mt8186_rt1019_rt5682s sound card Ajye Huang
2022-10-31 12:22 ` [PATCH v5 1/2] ASoC: mediatek: dt-bindings: modify machine bindings for two MICs case Ajye Huang
2022-11-02 16:10 ` Rob Herring
2022-10-31 12:22 ` [PATCH v5 2/2] ASoC: mediatek: mt8186-rt5682: Modify machine driver for two DMICs case Ajye Huang
2022-11-02 10:44 ` AngeloGioacchino Del Regno [this message]
2022-11-02 12:13 ` Ajye Huang
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=549e1ff6-821a-1c26-0a4f-021bed27b093@collabora.com \
--to=angelogioacchino.delregno@collabora.com \
--cc=ajye_huang@compal.corp-partner.google.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=chunxu.li@mediatek.com \
--cc=devicetree@vger.kernel.org \
--cc=jiaxin.yu@mediatek.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=nfraprado@collabora.com \
--cc=perex@perex.cz \
--cc=robh+dt@kernel.org \
--cc=tiwai@suse.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
all inboxes | Powered by JetHome®