lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <009fc5d3-9ee2-c153-f208-df10b62d7467@linaro.org>
Date:   Wed, 26 Jul 2017 17:31:28 +0100
From:   Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
To:     Damien Riegel <damien.riegel@...oirfairelinux.com>,
        alsa-devel@...a-project.org
Cc:     linux-kernel@...r.kernel.org, Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>,
        Jaroslav Kysela <perex@...ex.cz>,
        Takashi Iwai <tiwai@...e.com>,
        Patrick Lai <plai@...eaurora.org>,
        Banajit Goswami <bgoswami@...eaurora.org>,
        kernel@...oirfairelinux.com
Subject: Re: [PATCH v1 3/3] ASoC: qcom: apq8016-sbc: enable jack detection



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@...oirfairelinux.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,
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ