From patchwork Wed Aug 2 17:57:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alper Nebi Yasak X-Patchwork-Id: 130044 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f41:0:b0:3e4:2afc:c1 with SMTP id v1csp641939vqx; Wed, 2 Aug 2023 11:17:23 -0700 (PDT) X-Google-Smtp-Source: APBJJlG+0tRack7LSHwC+bAlKe1MTbaLucX8CfeL2TaYCZMZMP+yjVrrVSfF3gPNF9eL76bApBxx X-Received: by 2002:a17:902:f54e:b0:1ba:fe6a:3845 with SMTP id h14-20020a170902f54e00b001bafe6a3845mr23573308plf.11.1691000243140; Wed, 02 Aug 2023 11:17:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691000243; cv=none; d=google.com; s=arc-20160816; b=gLcOb20eAPxaFG30GlXr9sWLyTH6e4oTAnUAAyq+tDz+4gDNV6WBUKtcWO8lXP31lH 3nftlNzlBaFac1dw5bO40rVgxfnkASC3BP32yN//MsAz+YRqcVQWv6Y3Vjhn2mJm/HwJ vam21+hOiHFIk/tRgjETs8OlgvLaTYH7sOMNkvKZ8Z4X6eo8UoyzzhgD+oxkBbpQR096 4JpqK0MFO8NLIREJgA/MC0Bw9qcSiRZOwvPzDx/6DZL0wlDY18sql+i61Op3AUS1U3sp KceHx0nS4XT0XGanf65+UTfNMXsq9lIw4q0tSM9L6bQd1u/H0x+aFgA/v/CJ/UHsIxE3 saCg== 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=l9P3TP3wzncRhOXgecZRN30Iatpmdu19th61qwxb3TI=; fh=GUNhzEJfka7aU6InG/mqeUgtNKAejFmk0vy+CY7S+VM=; b=PVgRna7XN0dNzMe/9C0LFr9j+7inKVkfbBMLvHnTsHN5tkMsl3DCGyuTlPTc8H4JnN gPN6oAB816GadG1i60ZiXUrkEftQjIforPAyhg7g/AnK/oD9YffXm6bEOW9M4ETrUoOz N5jiNMoQ1g8J6vNB4vATidVV7NMJ9r0p8YKVrDIvKrA5vubn8umAixogndjNAfbn0CpW fDCT+hI5VTF74IR4dK0CzqDZT3AF9UcrEpogSzWFoFIn74BCmvPGTghnFnZU5UKTl1Q3 vF5k9APtF/nNdsENJG5BejFCJqX+tfSn+ozor6UEudGQnHtuxYhTLl0Kj/PN5CMPZHII wWyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=bnCWrvBW; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o4-20020a170903300400b001b8c4168e20si10998599pla.58.2023.08.02.11.17.07; Wed, 02 Aug 2023 11:17:23 -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=20221208 header.b=bnCWrvBW; 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 S234160AbjHBR6f (ORCPT + 99 others); Wed, 2 Aug 2023 13:58:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234166AbjHBR6I (ORCPT ); Wed, 2 Aug 2023 13:58:08 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE59CA3 for ; Wed, 2 Aug 2023 10:58:07 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-3fe2ba3e260so1395665e9.2 for ; Wed, 02 Aug 2023 10:58:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690999086; x=1691603886; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=l9P3TP3wzncRhOXgecZRN30Iatpmdu19th61qwxb3TI=; b=bnCWrvBW33Hc3lH7E3ojnUXu9Ro8w0Y5gsvpJtoeUNAkcrDtks3psfwf5mrnHNwCyT 3deFDBbk+9b8/B2aEH7EyMbouK0typo/n9x3MJ998k97nDuFHx2dcxRPVaHPQyvb4nN9 0TUe+jsmNGDMxGiNEoqWQ9YBTaFZe5aDkOwmBKuQuB5WJ/r1GGlG3mi/JZfbYNYJc4gz aTczta8+OM12jgy7iZ8C8/xvbhiMXRAeDuLwC44bv82QfsukQS8UcpvgkYK7GYZRSr7M gcB7pFpv2kCTwlPyicYgRdMsnu6pGZ0ZNouy0H0z0Jsfy68v5Q6uzHsE6ARmN85VSsO2 blIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690999086; x=1691603886; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=l9P3TP3wzncRhOXgecZRN30Iatpmdu19th61qwxb3TI=; b=PI8rMnZ/0PYaLvfCo4ukuvJL2tM0YEeCWsBvHd7jFvAF1kSN3mdPtFuJYIK9sXDAg0 HbDSoiUrS1ZEZb6DypfniznamNuf9tgAoPOj1pARFhwwYLQ6jqulvKNO/skXUtG5pXb5 JDhTj5RIqAwi0PYNxNisQiDgfE5N7ZhEvbC4KqCvV6f9CHtUeYRTKYX/kfTM895VADa/ 0Peoow0VnSFlGO+kjruDH3kT/HEO6Y9EIj2VqsdJ8m20vnKWTqQLXFtebGubYn6lmOhq noKgXWlm+BopaHujL6YZRfuU/TtVzGmbJqIPD1GlGeiZcHk4QB+wnXv1GOmt8ju8OJpf /E/w== X-Gm-Message-State: ABy/qLbuE5Z9czRwXuUS9koZ+wz99n95jevuiH+9apgJpKaB+MQZ03/G Mdp42tIZdekWb+wTB5Q5ifc= X-Received: by 2002:a05:600c:2198:b0:3fe:e1e:5041 with SMTP id e24-20020a05600c219800b003fe0e1e5041mr5573612wme.32.1690999086221; Wed, 02 Aug 2023 10:58:06 -0700 (PDT) Received: from ALPER-PC.. ([178.233.24.1]) by smtp.gmail.com with ESMTPSA id l23-20020a7bc457000000b003fe20db88ebsm2192439wmi.31.2023.08.02.10.58.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Aug 2023 10:58:05 -0700 (PDT) From: Alper Nebi Yasak To: alsa-devel@alsa-project.org Cc: Cezary Rojewski , Alper Nebi Yasak , Mark Brown , Liam Girdwood , Takashi Iwai , AngeloGioacchino Del Regno , Jaroslav Kysela , linux-kernel@vger.kernel.org, Akihiko Odaki , Pierre-Louis Bossart , Matthias Brugger , =?utf-8?q?N=C3=ADcolas_F_=2E_R_?= =?utf-8?q?=2E_A_=2E_Prado?= Subject: [PATCH 06/27] ASoC: Intel: bxt_da7219_max98357a: Map missing Line Out jack kcontrol Date: Wed, 2 Aug 2023 20:57:16 +0300 Message-Id: <20230802175737.263412-7-alpernebiyasak@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230802175737.263412-1-alpernebiyasak@gmail.com> References: <20230802175737.263412-1-alpernebiyasak@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773142270641938877 X-GMAIL-MSGID: 1773142270641938877 Commit bbdd4ea2190b4 ("ASoC: Intel: bxt_da7219_max98357a: remap jack pins") maps kcontrols for Headphone and Headset Mic jacks for this driver so that PulseAudio and PipeWire can handle detection events for these peripherals. The DA7219 codec used here can also distinguish between Headphone and Line Out connections that go into the same physical port. Expose the latter to userspace as a kcontrol as well and add the necessary widgets. Signed-off-by: Alper Nebi Yasak --- Tested on a "Lick" Chromebook. sound/soc/intel/boards/bxt_da7219_max98357a.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sound/soc/intel/boards/bxt_da7219_max98357a.c b/sound/soc/intel/boards/bxt_da7219_max98357a.c index c593995facaa..cbfff466c5c8 100644 --- a/sound/soc/intel/boards/bxt_da7219_max98357a.c +++ b/sound/soc/intel/boards/bxt_da7219_max98357a.c @@ -90,6 +90,7 @@ static int platform_clock_control(struct snd_soc_dapm_widget *w, static const struct snd_kcontrol_new broxton_controls[] = { SOC_DAPM_PIN_SWITCH("Headphone Jack"), SOC_DAPM_PIN_SWITCH("Headset Mic"), + SOC_DAPM_PIN_SWITCH("Line Out"), }; static const struct snd_kcontrol_new max98357a_controls[] = { @@ -104,6 +105,7 @@ static const struct snd_kcontrol_new max98390_controls[] = { static const struct snd_soc_dapm_widget broxton_widgets[] = { SND_SOC_DAPM_HP("Headphone Jack", NULL), SND_SOC_DAPM_MIC("Headset Mic", NULL), + SND_SOC_DAPM_LINE("Line Out", NULL), SND_SOC_DAPM_MIC("SoC DMIC", NULL), SND_SOC_DAPM_SPK("HDMI1", NULL), SND_SOC_DAPM_SPK("HDMI2", NULL), @@ -150,6 +152,7 @@ static const struct snd_soc_dapm_route audio_map[] = { { "Headphone Jack", NULL, "Platform Clock" }, { "Headset Mic", NULL, "Platform Clock" }, + { "Line Out", NULL, "Platform Clock" }, }; static const struct snd_soc_dapm_route max98357a_routes[] = { @@ -194,6 +197,10 @@ static struct snd_soc_jack_pin jack_pins[] = { .pin = "Headset Mic", .mask = SND_JACK_MICROPHONE, }, + { + .pin = "Line Out", + .mask = SND_JACK_LINEOUT, + }, }; static int broxton_ssp_fixup(struct snd_soc_pcm_runtime *rtd,