alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: Damien Riegel <damien.riegel@savoirfairelinux.com>
Cc: alsa-devel@alsa-project.org,
	Banajit Goswami <bgoswami@codeaurora.org>,
	linux-kernel@vger.kernel.org, Patrick Lai <plai@codeaurora.org>,
	Takashi Iwai <tiwai@suse.com>, Mark Brown <broonie@kernel.org>
Subject: Re: [PATCH v2 4/6] ASoC: codecs: msm8916-wcd-analog: add MBHC support
Date: Thu, 3 Aug 2017 14:10:18 +0100	[thread overview]
Message-ID: <6fd8f95f-6378-c6bf-acd7-a4e0a9d1cc5e@linaro.org> (raw)
In-Reply-To: <20170803125355.l5m5mk5utl4nlbwk@workotop.localdomain>



On 03/08/17 13:53, Damien Riegel wrote:
> On Thu, Aug 03, 2017 at 12:11:04PM +0100, Srinivas Kandagatla wrote:
>>
>>
>> On 03/08/17 00:33, Damien Riegel wrote:
>>> Hi Srinivas,
>>>
>>>
>>> On Wed, Aug 02, 2017 at 07:09:28PM +0200, srinivas.kandagatla@linaro.org wrote:
>>>> From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>>>>
>>>> MBHC (MultiButton Headset Control) support is available in pm8921 in two
>>>> blocks, one to detect mechanical headset insertion and removal and other
>>>> block to support headset type detection and 5 button detection and othe
>>>> features like impedance calculation.
>>>>
>>>> This patch adds support to:
>>>> 1> Support to NC and NO type of headset Jacks.
>>>> 2> Mechanical insertion and detection of headset jack.
>>>> 3> Detect a 3 pole Headphone and a 4 pole Headset.
>>>> 4> Detect 5 buttons.
>>>>
>>>> Tested it on DB410c with Audio Mezz board with 4 pole and 3 pole
>>>> headset/headphones.
>>>
>>
>>> Good news! This version has better results. I still have an issue where
>>> a headphone is reported as a headset when I do this sequence:
>>
>> Hi Damien,
>>
>> Thanks for testing..
>>
>>
>>> 	1. connect headset
>>> 	2. disconnect headset
>>> 	3. connect headphone
>>
>>> Following headphone connections/disconnections are reported correctly.
>>> Note that I don't press the media key, it's wrongly detected when I pull
>>> off the cable.
>>
>> If you do step 3 slowly there is a chance that we get KEY_MEDIA events, as
>> headphone is a 3 pole, during hp inserting we would end up shorting the MIC
>> and GND lines on the connector, as 3-pole connectors have longer GND
>> pole/connector length, this action is same as pressing MEDIA KEY.
>>
>> The logic in the driver uses this MEDIA KEY press release as advantage to
>> detect the accessory type before hs insertion, but this logic could break if
>> we are inserting headphone slowly, which is not a normal usecase.
>>
>> Any solution to this issue can be always break if we are doing slow
>> insertion of hs or we endup making the driver complex. I will think about
>> this once again and see how other drivers handle this usecase.
> 
> Understood, and you're right we should keep this driver as simple as
> possible.
> 
> I get the KEY_MEDIA event when doing step 2 (disconnecting headset), and
> I understand why it's doing that (and I think it's okay if we don't
> filter out that spurious event), but we should at least get a KEY_MEDIA
> release event at the same time as SW_{MICROPHONE,HEADPHONE}_INSERT
> removal. It doesn't really matter if I disconnect it fast or slowly,
> sometimes I'll get the KEY_MEDIA, some other times I won't.

I will see if I can fix this in a much better way and let you know.

> 
> Shouldn't mbhc_btn0_pressed be reset to false when physical removal is
> detected? I think that would solve the issue of headphone being detected
> as headset.
> 
Yes, I have considered that change to my next version.

> 
> Regards,
> 

  reply	other threads:[~2017-08-03 13:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-02 17:09 [PATCH v2 0/6] ASoC: codecs: msm8916-wcd-analog: Add support to MBHC srinivas.kandagatla
2017-08-02 17:09 ` [PATCH v2 1/6] ASoC: jack: fix snd_soc_codec_set_jack return error srinivas.kandagatla
2017-08-02 17:09 ` [PATCH v2 2/6] ASoC: codecs: msm8916-wcd-analog: move codec reset to probe srinivas.kandagatla
2017-08-02 17:09 ` [PATCH v2 3/6] ASoC: codecs: msm8916-wcd-analog: get micbias voltage from dt srinivas.kandagatla
2017-08-02 17:09 ` [PATCH v2 4/6] ASoC: codecs: msm8916-wcd-analog: add MBHC support srinivas.kandagatla
2017-08-02 23:33   ` Damien Riegel
2017-08-03 11:11     ` Srinivas Kandagatla
2017-08-03 12:53       ` Damien Riegel
2017-08-03 13:10         ` Srinivas Kandagatla [this message]
2017-08-02 17:09 ` [PATCH v2 5/6] ASoC: qcom: apq8016-sbc: Add support to Headset JACK srinivas.kandagatla
2017-08-21 18:33   ` Applied "ASoC: qcom: apq8016-sbc: Add support to Headset JACK" to the asoc tree Mark Brown
2017-08-02 17:09 ` [PATCH v2 6/6] arm64: dts: apq8016-sbc: add mbhc buttons support srinivas.kandagatla

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=6fd8f95f-6378-c6bf-acd7-a4e0a9d1cc5e@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=linux-kernel@vger.kernel.org \
    --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).