Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1224568rwb; Fri, 7 Oct 2022 09:37:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4e7Hrs2IaLhrTuGZyfSjj+glJQsriEZUDrTqIozPVwNg1wm/nSedmQUOQ5te21f9kBtMOg X-Received: by 2002:a05:6402:1ccd:b0:459:aa70:9e12 with SMTP id ds13-20020a0564021ccd00b00459aa709e12mr5405471edb.206.1665160652649; Fri, 07 Oct 2022 09:37:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665160652; cv=none; d=google.com; s=arc-20160816; b=OQXMIGwB63bcZBdeeJ0KY6WnIB4tNJ0+tT5ljMSkmjxSFFtmVHA0wh/iSjstgR0OIk Z6BHSG5szv0MRMe9063/PgBZlSxQSLWAU6/xMGnxjSeN0oYO6lhdufUcfZ+xX24YnZ0E x48IMeaYMJfoAIyT8YbNldrg4h3KJS9KnOq5KQZp6Tt3+EvjMNS1PklZv/1uSkfayf6S qFLXegslN0gAGvJqWL0TU4Q0l3RTi5ivWB/64bQtI3GvEjtcS10Y5JOqWRKOVa+l8CZ7 7y1fRYys4UtQQjD+iUFaYkBCEdrfm8BSQoAXYYehLx7ZdSyjmNuHfkVVkzld+y1LZcC6 uTGw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=k35lImm5f5L+QWNkc7HMTUrpu9Bmr/eFTnLYAfMsySo=; b=w3APIpqKIr9zdbRh774aK8PyuaG5LdByTEZO6Lk0AU9CnJeY7Jx+sPHq79dTUXy6ed w/YEcpO1vdWBqasB3mXh9rhx+VIyvwFsZQ1XBeVkwqG29jRgVrfdB5+WuMf5/Pu9O4h7 wMJ00CSb/t9kB6Qbo7BMyW1LGM3i02n3wrreZ1vKefBNIkU/i4jTA62VpRvYnCTJEVdH KYON4quiFUmAGElcdpS4qlZVKg0XqQOkEaqRWNHqvaXsHfWSuqKqXdWINsoKXH8rqERB EUbdORbeTkp5pZpbsBvNmrLBioG/djm9QqDlv4tHEN4bSF5vr7cSvgFneYaYoLrCPiYK 4jUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dylanvanassche.be header.s=MBO0001 header.b=xNNjmk0w; 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 kk22-20020a170907767600b0077ef3eeca17si2552994ejc.155.2022.10.07.09.37.04; Fri, 07 Oct 2022 09:37:32 -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=xNNjmk0w; 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 S229888AbiJGP5v (ORCPT + 99 others); Fri, 7 Oct 2022 11:57:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229831AbiJGP5r (ORCPT ); Fri, 7 Oct 2022 11:57:47 -0400 Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [IPv6:2001:67c:2050:0:465::101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 142DD10C4E4; Fri, 7 Oct 2022 08:57:43 -0700 (PDT) Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1]) (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-101.mailbox.org (Postfix) with ESMTPS id 4MkXy85zXBz9sRG; Fri, 7 Oct 2022 17:57:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dylanvanassche.be; s=MBO0001; t=1665158256; 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; bh=k35lImm5f5L+QWNkc7HMTUrpu9Bmr/eFTnLYAfMsySo=; b=xNNjmk0wETjtFc8+yEGHj7biMko3UcZa68E1WWTBLCDslNz0iGtwm8BccG+ys+nhveoLoK LKDPO9PhD72itXKG4qZTLOxKk2wRy9ipB2DPiUS1u3aLHirm79s+nhwhzJH3CplYSCCYJP W7Sn/N7apRRnwvBlF4e6EobfDAeOyPJcQAH2ab/RCl+KrJ+M1iv0SquBgiFzPimbadYOsy myKknYM8fgjYYLP8OU4TOxrtofOWpewyISyVPMS/gCYawnoC92FsrCC68TmjXe781zdz5l otRNXAELmKW5KBzcEZeT3TED78pdwcEiQCEOzYSISH1TTi7ReW7YuiaK+lqYOA== From: Dylan Van Assche To: 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, Dylan Van Assche Subject: [PATCH v2] sound: soc: codecs: wcd-mbhc-v2: expose ALSA control for jack Date: Fri, 7 Oct 2022 17:57:16 +0200 Message-Id: <20221007155716.10594-1-me@dylanvanassche.be> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,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 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, -- 2.37.3