Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2986774rwb; Sat, 8 Oct 2022 19:05:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM67VhqFrMZWir9pCw9hzh13NukpgNRM0vS2ZeUEjACfOJJuGRueK8Z1kIEPaXnk8jCziEUW X-Received: by 2002:a65:558b:0:b0:460:d98a:542e with SMTP id j11-20020a65558b000000b00460d98a542emr2938020pgs.249.1665281157766; Sat, 08 Oct 2022 19:05:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665281157; cv=none; d=google.com; s=arc-20160816; b=WgVIWGlfs5QMPFeqKM7dUuNYzLioQLOMJXCu0eMB555MZ4BfeRl5B+kKeB1gpSdJS1 xo9CxChtCLYHPFIDea+rRZZ750QHddWCqyoz39LxKFrVIDzCO6zqgrJxxB0TdQzjjUmp ysGPSJqLXEyBj7+WHTrNLTmOCHhvZy/gWvF9o/bI7G3ENKQn1dSgRyASG18Mx3QG8MQ6 tRWjET4yH6W1/KplelB/sWQ6YiTV4cB7yCjFJW5i6NgaX+XFUQ81xZIvGyK+J7KXPPh0 XdAUztZfXjKmb0scaLUxI3U/RfRgJ9XKRqE6VGaGV07xLIVnPG8YxThhw4RCe1yU8YIL 0Qcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=P5HaFroFXHgbxThoT0RIR6rsbRVYC8ZGOScKtFyRa64=; b=nJi0nF/FhkKlo7D1bGrsrl0O7yh98+8bngT+YbqMeySBvAVu9lVwohjhWwClSC57Ym AcqfYGaBTKzn9lQts1RdVeFBw3BI0uWi/mCK1Idu/vGt/owHRVz1y9D6neGsRoMZsTbq NZXbUcDhiIQPNmLedYr2nKae+fIXnquj3N/gNjPFQmESuL4wOv6j8jfaTKoaGihtiiZd QL3oSicwsoqg2kAmK9k5Le7hnc01RderOItqXwaeT1SKuI0wfa7JLyoWaXk4BwmjjSOW ftd6dooLIzpQSR39MkVq+y1kF6hVuKEKyvwjoDmqRG2hiVXQc+y8l/5BICmAjxsGRkrN cJNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=FnUB16h8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y186-20020a638ac3000000b0044cedfa9dd5si7632161pgd.756.2022.10.08.19.05.30; Sat, 08 Oct 2022 19:05:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=FnUB16h8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229747AbiJIAs6 (ORCPT + 99 others); Sat, 8 Oct 2022 20:48:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229489AbiJIAsz (ORCPT ); Sat, 8 Oct 2022 20:48:55 -0400 Received: from mail-il1-x130.google.com (mail-il1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40420357E5; Sat, 8 Oct 2022 17:48:54 -0700 (PDT) Received: by mail-il1-x130.google.com with SMTP id r20so4194117ilt.11; Sat, 08 Oct 2022 17:48:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=P5HaFroFXHgbxThoT0RIR6rsbRVYC8ZGOScKtFyRa64=; b=FnUB16h8kIXSKk8rS8AZG3S1iJ1AU1VMvwgRkl5zRkeyT+qG6TW9bpQDZ0bqlWLK54 KKZvD9wPHUExyUaVu4rj7wRNyIjW/U2Qywofk7FIDZlbNrA0aHGMX6nrLnom08JS1geJ 1wHiW9QVTYZSNCxr2bvPlDc0Lbib/s1sjqY1d5/7lopTTQu5cLaIbAu6TD90l9OQy/KD 4pRMoyHNjywJaUamq91j6Bzzgh04fXOCcR1Yqy2J4kov055d8QcazOs+ipUNwFetbutJ yo6MVQ4Ed2AonUgIIIQFuSx0Ad8uJ10B8RFLzE+nCuDPe4JOTY19rYIHTpH+me3ghe0D t2NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=P5HaFroFXHgbxThoT0RIR6rsbRVYC8ZGOScKtFyRa64=; b=5Tuf+7lHVN8rrZiafWyeKhOJZ0dkJSVU/GW+Fx42ZWsdL4HhNUn44GqpMXdnLyGWki 0Dv4lqVQURB/Rjob90WaTJITz0VySCbqxwG9I3+VpJF7JBOTP6IOxWXpyy1UcFj4P5SJ 3iL2zeN1gxCxGuuB4zHyh6vWp93jvPIXqcEY3pcRiKiDAKnnvllIdzmk98Ozkv1mtic5 JJhG1ikzxoHkforcjqk8As9cYZSMepkvOVr3M2g8B2QgToftoCVnnBvBGjky4JZTophN xq6DcErWsglrQhzxIwUQYEjBEizWCx/X4cqKc0WC6H7VM9cspnnWmvf8fMMQdlEFBmXH YMQA== X-Gm-Message-State: ACrzQf1685zdfdMAlzTLe/2LHKx48FQWauxpXnp9nLgANKyqnouB6THW NEtVUeagWXBQPA+brDbVttG+vYLtOE8= X-Received: by 2002:a05:6e02:1bc7:b0:2fa:876e:95a7 with SMTP id x7-20020a056e021bc700b002fa876e95a7mr5798035ilv.240.1665276533543; Sat, 08 Oct 2022 17:48:53 -0700 (PDT) Received: from ?IPV6:2604:2d80:4d87:cd00:9f51:32d7:1177:67d? ([2604:2d80:4d87:cd00:9f51:32d7:1177:67d]) by smtp.gmail.com with ESMTPSA id t22-20020a026416000000b00349c45fd3a8sm2546894jac.29.2022.10.08.17.48.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 08 Oct 2022 17:48:53 -0700 (PDT) Message-ID: <36657a31-2d34-e5eb-f7c4-ffcf86481c9d@gmail.com> Date: Sat, 8 Oct 2022 19:48:51 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.1.2 Subject: Re: [PATCH v2] sound: soc: codecs: wcd-mbhc-v2: expose ALSA control for jack Content-Language: en-US To: Dylan Van Assche , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, linux-arm-msm@vger.kernel.org, phone-devel@vger.kernel.org References: <20221007155716.10594-1-me@dylanvanassche.be> From: Joel Selvaraj In-Reply-To: <20221007155716.10594-1-me@dylanvanassche.be> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Can confirm that this is required for Pulseaudio to pick up the headphones properly. I tested this in my Xiaomi Poco F1 running postmarketOS (Phosh Mobile Desktop Environment). You can check the following pulseaudio issue for some more info. Link: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1377 Tested-by: Joel Selvaraj On 07/10/22 10:57, Dylan Van Assche wrote: > Jack detection is currently fully functional via the input > interface together with multimedia buttons, but is not exposed > as an ALSA control. Therefore, ALSA clients such as PulseAudio > do not pick up the jack detection events as they only support > one of the possible interface (ALSA control or input interface, > but not both). Expose the jack events as an ALSA control and input > interface to provide ALSA clients both interfaces. > > Signed-off-by: Dylan Van Assche > --- > sound/soc/codecs/wcd-mbhc-v2.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/sound/soc/codecs/wcd-mbhc-v2.c b/sound/soc/codecs/wcd-mbhc-v2.c > index 1911750f7445..1b75f49b2858 100644 > --- a/sound/soc/codecs/wcd-mbhc-v2.c > +++ b/sound/soc/codecs/wcd-mbhc-v2.c > @@ -725,6 +725,10 @@ static int wcd_mbhc_initialise(struct wcd_mbhc *mbhc) > > mutex_lock(&mbhc->lock); > > + ret = snd_jack_add_new_kctl(mbhc->jack->jack, "Headset Jack", WCD_MBHC_JACK_MASK); > + if (ret) > + dev_warn(component->dev, "failed creating Headset Jack kctl with err: %d\n", ret); > + > /* enable HS detection */ > if (mbhc->mbhc_cb->hph_pull_up_control_v2) > mbhc->mbhc_cb->hph_pull_up_control_v2(component,