alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* Re: [alsa-devel] [PATCH v1 5/6] ASoC: codecs: msm8916-wcd-analog: add MBHC support
@ 2017-07-26 19:35 Damien Riegel
  2017-07-27 10:03 ` Srinivas Kandagatla
  0 siblings, 1 reply; 5+ messages in thread
From: Damien Riegel @ 2017-07-26 19:35 UTC (permalink / raw)
  To: Srinivas Kandagatla; +Cc: alsa-devel, linux-kernel

[Sorry for breaking the thread, but I don't have the initial message to
reply to.]

I tried your patchset and faced some issues regarding removal detection:
the driver detects headphone and microphone removal as soon as I press a
button on the headset.

evtest logs:

	[Headset insertion]
Event: time 10207.841157, type 1 (EV_KEY), code 226 (KEY_MEDIA), value 1
Event: time 10207.841157, -------------- SYN_REPORT ------------
Event: time 10208.039105, type 1 (EV_KEY), code 226 (KEY_MEDIA), value 0
Event: time 10208.039105, -------------- SYN_REPORT ------------
Event: time 10208.075519, type 5 (EV_SW), code 2 (SW_HEADPHONE_INSERT), value 1
Event: time 10208.075519, type 5 (EV_SW), code 4 (SW_MICROPHONE_INSERT), value 1
Event: time 10208.075519, -------------- SYN_REPORT ------------
	[Pressing Volume up Button]
Event: time 10210.590403, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 1
Event: time 10210.590403, type 5 (EV_SW), code 2 (SW_HEADPHONE_INSERT), value 0
Event: time 10210.590403, type 5 (EV_SW), code 4 (SW_MICROPHONE_INSERT), value 0
Event: time 10210.590403, -------------- SYN_REPORT ------------
Event: time 10210.719560, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 0
Event: time 10210.719560, -------------- SYN_REPORT ------------
	[Unplugging]
Event: time 10221.926156, type 1 (EV_KEY), code 226 (KEY_MEDIA), value 1
Event: time 10221.926156, -------------- SYN_REPORT ------------
Event: time 10222.026466, type 1 (EV_KEY), code 226 (KEY_MEDIA), value 0
Event: time 10222.026466, -------------- SYN_REPORT ------------


Also, the KEY_MEDIA is wrongly reported but I don't see that every time,
I think it depends on how fast I plug in the headset. Anyway, I think
that can easily be filtered out by testing the presence of the
microphone.


Regards,
-- 
Damien

^ permalink raw reply	[flat|nested] 5+ messages in thread
* [PATCH v1 0/6] ASoC: codecs: msm8916-wcd-analog: Add support to MBHC
@ 2017-07-26  0:35 srinivas.kandagatla
  2017-07-26  0:35 ` [PATCH v1 5/6] ASoC: codecs: msm8916-wcd-analog: add MBHC support srinivas.kandagatla
  0 siblings, 1 reply; 5+ messages in thread
From: srinivas.kandagatla @ 2017-07-26  0:35 UTC (permalink / raw)
  To: Mark Brown, Banajit Goswami, alsa-devel
  Cc: linux-kernel, Patrick Lai, Srinivas Kandagatla, Takashi Iwai

From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

This patchset adds support to MBHC(Multibutton headset control) block in PM8916
analog block. MBHC support comes from2 blocks first mechanical headset detection
and second headset type, 5 button detection.

This patchset 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.

First patch fixes error code returned by snd_soc_codec_set_jack() to be
more precise for users. Second patch is patch from Damien, followed by few
fixes to codec driver w.r.t mbhc and final patch to add mbhc support.

Damien sent a similar patchset to add support to mechanical detection,
but that patch has issues and will not work on most usecases (for example
after a playback/capture session, multicodec case). So I only picked up
the BIT mask patch from that series.

Tested it on DB410c with Audio Mezz board with 4 pole and 3 pole
and during playback and recording use cases.

root@linaro-alip:~# evtest 
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:      pm8941_pwrkey
/dev/input/event1:      DB410c Headset Jack
/dev/input/event2:      gpio_keys
Select the device event number [0-2]: 1
Input driver version is 1.0.1
Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0
Input device name: "DB410c Headset Jack"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 114 (KEY_VOLUMEDOWN)
    Event code 115 (KEY_VOLUMEUP)
    Event code 226 (KEY_MEDIA)
    Event code 260 (BTN_4)
    Event code 582 (KEY_VOICECOMMAND)
  Event type 5 (EV_SW)
    Event code 2 (SW_HEADPHONE_INSERT) state 1
    Event code 4 (SW_MICROPHONE_INSERT) state 1
Properties:
Testing ... (interrupt to exit)
Event: time 1501001112.059684, type 1 (EV_KEY), code 226 (KEY_MEDIA), value 1
Event: time 1501001112.059684, type 5 (EV_SW), code 2 (SW_HEADPHONE_INSERT), value 0
Event: time 1501001112.059684, type 5 (EV_SW), code 4 (SW_MICROPHONE_INSERT), value 0
Event: time 1501001112.059684, -------------- SYN_REPORT ------------
Event: time 1501001112.254116, type 1 (EV_KEY), code 226 (KEY_MEDIA), value 0
Event: time 1501001112.254116, -------------- SYN_REPORT ------------
Event: time 1501001113.154184, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 1
Event: time 1501001113.154184, -------------- SYN_REPORT ------------
Event: time 1501001113.319658, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 0
Event: time 1501001113.319658, -------------- SYN_REPORT ------------
Event: time 1501001113.781084, type 1 (EV_KEY), code 226 (KEY_MEDIA), value 1
Event: time 1501001113.781084, -------------- SYN_REPORT ------------
Event: time 1501001114.024930, type 1 (EV_KEY), code 226 (KEY_MEDIA), value 0
Event: time 1501001114.024930, -------------- SYN_REPORT ------------
Event: time 1501001114.419082, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 1
Event: time 1501001114.419082, -------------- SYN_REPORT ------------
Event: time 1501001114.576011, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 0
Event: time 1501001114.576011, -------------- SYN_REPORT ------------
Event: time 1501001114.795281, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 1
Event: time 1501001114.795281, -------------- SYN_REPORT ------------
Event: time 1501001114.863333, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 0
Event: time 1501001114.863333, -------------- SYN_REPORT ------------
Event: time 1501001116.603372, type 1 (EV_KEY), code 226 (KEY_MEDIA), value 1
Event: time 1501001116.603372, -------------- SYN_REPORT ------------
Damien Riegel (1):
  ASoC: codecs: msm8916-analog: fix DIG_CLK_CTL_RXD3_CLK_EN define

Srinivas Kandagatla (5):
  ASoC: jack: fix snd_soc_codec_set_jack return error
  ASoC: codecs: msm8916-wcd-analog: move codec reset to probe
  ASoC: codecs: msm8916-wcd-analog: set default micbias voltage to 1.8
  ASoC: codecs: msm8916-wcd-analog: add MBHC support
  ASoC: qcom: apq8016-sbc: Add support to Headset JACK

 .../bindings/sound/qcom,msm8916-wcd-analog.txt     |   9 +
 sound/soc/codecs/msm8916-wcd-analog.c              | 359 +++++++++++++++++++--
 sound/soc/codecs/msm8916-wcd.h                     |  12 +
 sound/soc/qcom/apq8016_sbc.c                       |  52 +++
 sound/soc/soc-jack.c                               |   2 +-
 5 files changed, 410 insertions(+), 24 deletions(-)
 create mode 100644 sound/soc/codecs/msm8916-wcd.h

-- 
2.9.3

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-07-28 14:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-26 19:35 [alsa-devel] [PATCH v1 5/6] ASoC: codecs: msm8916-wcd-analog: add MBHC support Damien Riegel
2017-07-27 10:03 ` Srinivas Kandagatla
  -- strict thread matches above, loose matches on Subject: below --
2017-07-26  0:35 [PATCH v1 0/6] ASoC: codecs: msm8916-wcd-analog: Add support to MBHC srinivas.kandagatla
2017-07-26  0:35 ` [PATCH v1 5/6] ASoC: codecs: msm8916-wcd-analog: add MBHC support srinivas.kandagatla
2017-07-28 13:51   ` Mark Brown
2017-07-28 14:12     ` Srinivas Kandagatla

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).