Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp583725rwl; Sat, 25 Mar 2023 07:27:03 -0700 (PDT) X-Google-Smtp-Source: AKy350Y2ZUZwVJRsN0LX148LGnDvh7p4yLT9su4s3x1mZNshga5gfqfVfAGiOzllLW++4bMBDFFL X-Received: by 2002:a17:906:7e4a:b0:93d:f7a6:219b with SMTP id z10-20020a1709067e4a00b0093df7a6219bmr6007536ejr.65.1679754422888; Sat, 25 Mar 2023 07:27:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679754422; cv=none; d=google.com; s=arc-20160816; b=t50oynkOmcDzncSx4eRSnDVcreYEeWxeMC8tFmsH5P7yOJZCu0Ze1RMV682HZcJZlv rOX+KnBXWNelBXXe9KSoAAclTntI12shMqIbIiJiB8t3aNFG6onc/AFJAnACUEybcxm7 T2NEVxsnj8khkQcJFLrwXhzWMTbDaulijL9Wt1rKNt2lq74oymPyvL7IzumtgP0evdBQ m3wIzGraNiVecD1xQtGV9Yk6I5DXG8Qj1yyOjn5hEGQm1Ljf0UhqH2dVZnaFiQ3ZHadt NLO/WvyKrB/8uAOLi5VUZur2ASEZ4uualVACxu02obDWkECd2/OLS+LRXEDJGv1gqRuw iNyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uo56ilykXnyoQsO7PNYE1eo/ncujGlXqfqKWuFiXTd8=; b=Krr7u74J/YLTQ1sSaqfesz4EsFyLYjSlSszLJOfyxuraqvQL6d+GMXS4UcHCAmWHfR EFuRBdJYLXJHzBpxlJDsW7aPQi2MICDjuidnPH/oIx8dDOT7qhU4iT1zo8Q/8WjKRifk 527p/4RJ2M49jSWiu+yEZWHisLS3ypT2q98dG+myQ9qSGtWUe3S68fvsYmhrZUr08rOn L5I7nPkkVNUkwrmfib1CBBAjqSzgiDYNzKHHBO2wq1a00eseGwKmVk+QenjGDrFkyO54 iKs3M5g2zeXB4hCHuU+PK5VemXWdymruDYqReg7K+5MIOIJR9Jh79lDwKykx6kVUnnJf iMqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dylanvanassche.be header.s=MBO0001 header.b=uc0SbByH; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=dylanvanassche.be Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n5-20020a170906688500b009320276666asi22206849ejr.793.2023.03.25.07.26.38; Sat, 25 Mar 2023 07:27:02 -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=@dylanvanassche.be header.s=MBO0001 header.b=uc0SbByH; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=dylanvanassche.be Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231423AbjCYOWI (ORCPT + 99 others); Sat, 25 Mar 2023 10:22:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230354AbjCYOWE (ORCPT ); Sat, 25 Mar 2023 10:22:04 -0400 Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [IPv6:2001:67c:2050:0:465::202]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97BFC12F3E; Sat, 25 Mar 2023 07:22:02 -0700 (PDT) Received: from smtp102.mailbox.org (unknown [10.196.197.102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4PkLqp72BJz9slh; Sat, 25 Mar 2023 15:21:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dylanvanassche.be; s=MBO0001; t=1679754119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uo56ilykXnyoQsO7PNYE1eo/ncujGlXqfqKWuFiXTd8=; b=uc0SbByHFJBINZfPbjEbTckBFejSkmSJpqHGDy5jtIB4+pnm+eQ1Db7KlQA0eDxpslWxi8 NDYaqBHn85hmfm+L8idgkpbZdCSosAuMA73bdQAB/RHEzPpUZTgtnjkL0Fzrc4V24iLp2q SwczWaznyqpXwEFbZzjfY3LOxjOFQSoEpkOTQjjVIr/0WWxGOBy0H0LVZ7J3xM+PPTDOs9 vwMpLJzQzBeoR3OWreCifLCx+OqrC9VFVtdW773TpTOw2Z+dJsyVtcWLF7hFhJxxxvAd0l gx+4+G9uGu5qjdRGtxlbWVyXy+HZ+6Ra2NL6E6QxtmV+3is6LlEhRPSRl7jtLA== From: Dylan Van Assche To: Banajit Goswami , Jaroslav Kysela , Takashi Iwai Cc: Srinivas Kandagatla , Liam Girdwood , Mark Brown , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Dylan Van Assche , Joel Selvaraj , Caleb Connolly Subject: [PATCH v3 1/1] sound: soc: codecs: wcd-mbhc-v2: expose ALSA control for jack Date: Sat, 25 Mar 2023 15:21:42 +0100 Message-Id: <20230325142142.24337-2-me@dylanvanassche.be> In-Reply-To: <20230325142142.24337-1-me@dylanvanassche.be> References: <20230325142142.24337-1-me@dylanvanassche.be> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 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 Tested-by: Joel Selvaraj Tested-by: Caleb Connolly --- 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, -- 2.39.2