From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: Damien Riegel <damien.riegel@savoirfairelinux.com>,
alsa-devel@alsa-project.org
Cc: linux-kernel@vger.kernel.org, Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>, Patrick Lai <plai@codeaurora.org>,
Banajit Goswami <bgoswami@codeaurora.org>,
kernel@savoirfairelinux.com
Subject: Re: [PATCH v1 3/3] ASoC: qcom: apq8016-sbc: enable jack detection
Date: Wed, 26 Jul 2017 17:31:28 +0100 [thread overview]
Message-ID: <009fc5d3-9ee2-c153-f208-df10b62d7467@linaro.org> (raw)
In-Reply-To: <20170725175126.26578-4-damien.riegel@savoirfairelinux.com>
On 25/07/17 18:51, Damien Riegel wrote:
> Now that the pm8916 audio codec has support for jack detection, let the
> sound card driver use it.
>
> Signed-off-by: Damien Riegel <damien.riegel@savoirfairelinux.com>
> ---
> sound/soc/qcom/apq8016_sbc.c | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/sound/soc/qcom/apq8016_sbc.c b/sound/soc/qcom/apq8016_sbc.c
> index d084d7468299..5f03f6249397 100644
> --- a/sound/soc/qcom/apq8016_sbc.c
> +++ b/sound/soc/qcom/apq8016_sbc.c
> @@ -19,11 +19,14 @@
> #include <linux/of.h>
> #include <linux/clk.h>
> #include <linux/platform_device.h>
> +#include <sound/jack.h>
> #include <sound/pcm.h>
> #include <sound/pcm_params.h>
> #include <sound/soc.h>
> #include <dt-bindings/sound/apq8016-lpass.h>
>
> +#include "../codecs/msm8916-wcd-analog.h"
> +
> struct apq8016_sbc_data {
> void __iomem *mic_iomux;
> void __iomem *spkr_iomux;
> @@ -35,13 +38,26 @@ struct apq8016_sbc_data {
> #define MIC_CTRL_TLMM_SCLK_EN BIT(1)
> #define SPKR_CTL_PRI_WS_SLAVE_SEL_11 (BIT(17) | BIT(16))
>
> +static struct snd_soc_jack apq8016_jack;
> +
> static int apq8016_sbc_dai_init(struct snd_soc_pcm_runtime *rtd)
> {
> struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
> struct snd_soc_card *card = rtd->card;
> + struct snd_soc_codec *codec = rtd->codec;
This driver uses multicodec, so this will not work to start with.
Also this function is used for different codec devices on the SOC, so we
should take care that we are might be talking to 3 different possible
codecs.
> struct apq8016_sbc_data *pdata = snd_soc_card_get_drvdata(card);
> int rval = 0;
>
> + if (!apq8016_jack.jack) {
> + rval = snd_soc_card_jack_new(card, "headset",
> + SND_JACK_MECHANICAL,
> + &apq8016_jack, NULL, 0);
> + if (rval)
> + return rval;
> +
> + pm8916_wcd_analog_jack_detect(codec, &apq8016_jack);
We already have an api to do this snd_soc_codec_set_jack()
> + }
> +
> switch (cpu_dai->id) {
> case MI2S_PRIMARY:
> writel(readl(pdata->spkr_iomux) | SPKR_CTL_PRI_WS_SLAVE_SEL_11,
>
prev parent reply other threads:[~2017-07-26 16:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-25 17:51 [PATCH v1 0/3] add jack detection to MSM8916 analog Damien Riegel
2017-07-25 17:51 ` [PATCH v1 1/3] ASoC: codecs: msm8916-analog: fix DIG_CLK_CTL_RXD3_CLK_EN define Damien Riegel
2017-07-25 19:27 ` Srinivas Kandagatla
2017-07-27 19:02 ` Applied "ASoC: codecs: msm8916-analog: fix DIG_CLK_CTL_RXD3_CLK_EN define" to the asoc tree Mark Brown
2017-07-25 17:51 ` [PATCH v1 2/3] ASoC: codecs: msm8916-analog: support jack detection Damien Riegel
2017-07-26 16:21 ` Mark Brown
2017-07-26 16:23 ` Mark Brown
2017-07-26 16:44 ` Srinivas Kandagatla
2017-07-26 19:44 ` Damien Riegel
2017-07-25 17:51 ` [PATCH v1 3/3] ASoC: qcom: apq8016-sbc: enable " Damien Riegel
2017-07-26 16:31 ` Srinivas Kandagatla [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=009fc5d3-9ee2-c153-f208-df10b62d7467@linaro.org \
--to=srinivas.kandagatla@linaro.org \
--cc=alsa-devel@alsa-project.org \
--cc=bgoswami@codeaurora.org \
--cc=broonie@kernel.org \
--cc=damien.riegel@savoirfairelinux.com \
--cc=kernel@savoirfairelinux.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=plai@codeaurora.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;
as well as URLs for NNTP newsgroup(s).