From patchwork Wed Aug 2 17:57:18 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: 130070 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f41:0:b0:3e4:2afc:c1 with SMTP id v1csp660802vqx; Wed, 2 Aug 2023 11:55:07 -0700 (PDT) X-Google-Smtp-Source: APBJJlGEUsNW2YnUDgHDg2kTPSChheUOeZZoCEFPB9noz34ThBTcpzNixSTuU1MhOpDx0QfooC+y X-Received: by 2002:aa7:d4d6:0:b0:522:c136:7422 with SMTP id t22-20020aa7d4d6000000b00522c1367422mr5382475edr.21.1691002507572; Wed, 02 Aug 2023 11:55:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691002507; cv=none; d=google.com; s=arc-20160816; b=poO6Gug8zzJL/xhRg0KGib+OTcqNBTT3t+LrXUIGkmgL3FFPn/gI8HueizaXwPRJWB 7gGwENLoRUonSnG2b1rYp8yJopP6UDTSoC9H3OCLv6vRLMnVygAz9xtTr/UzMd4NHWtM g+Bp2bBA8Wm+JwJDv/CyvBdVuMRfcG+BL2X8GnJuWt1s/YxoK7sgzPxBZcDMreSaZ4D/ NuNz3HKlOJrCao+3h5nyDZvdfrqnWNbuGDyc4cJIGfqWQYi68dVE48sSMe2CUZTofXXK 90w+GHCI+NTgzgHl8gDcLsMH2U22B0rgwVW06L0TXHrh5qmXUjYHrVqtxEVlgYdMAlS8 XkVw== 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=L5Agk2IhTlueKpAaOVZPmPiVBKk+AEjM8QiFyo+WrKQ=; fh=GUNhzEJfka7aU6InG/mqeUgtNKAejFmk0vy+CY7S+VM=; b=WDQzA6AsOObBVwzfO0Cdu/+x5sxE2f+kTKq+JxS73n0lxdx//VpAn9aMEs++8ZA5WD JJpSCQhx2aqsVY+dD7n6Rf5Qn/zmnjcnyhLFakTVa8gWznW2c8HISvFf1qVqgBsn4Qxe Lup5nF8FPImyw4GU7w7Y2y1FOjIqSKl7PRDrh7i5XogCZX6qZ2wRqDk7NU+6phENIJQe u1ZDBWe1oE7Q+ImUOw5yeyJfJRo4y7L/0GRPKZj0mo7Baoxn9lLF4XKFeFL77Z0U8duN KI0waHogOL/ph0JWuSex1LbE3bwKu474h2/iCx4uV5Fu9j3krZW+lQOzyvrjlj+LDgQU ZEyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=cH9DcH1D; 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 e3-20020aa7d7c3000000b0052229ec3e0dsi10086815eds.79.2023.08.02.11.54.43; Wed, 02 Aug 2023 11:55:07 -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=cH9DcH1D; 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 S234022AbjHBR62 (ORCPT + 99 others); Wed, 2 Aug 2023 13:58:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234236AbjHBR6N (ORCPT ); Wed, 2 Aug 2023 13:58:13 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 184C8A3 for ; Wed, 2 Aug 2023 10:58:12 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-3fbea147034so1550095e9.0 for ; Wed, 02 Aug 2023 10:58:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690999090; x=1691603890; 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=L5Agk2IhTlueKpAaOVZPmPiVBKk+AEjM8QiFyo+WrKQ=; b=cH9DcH1DxY4Yz9Q9s2/zqrXiaeWRqIgZsmXk5aOM5TA9zaAmZZtz4Ue5dckgnO/7PR LcDuoemcupnv+vTeCNJJqkCm8yylKBrOc40IT40+P6L8HWbHIzKll9CqbUlXScxvxEqK YBUi0vnpPisZkI8DvtYQsrZXm7eArwxev7rnIKr+BU6Aa1F8RDAyEdz5rqDYN7GmB1pY /zFPekPj6pIE04Pz5oCvTUYWillfyfKmFqAEA92JtC5znNz73IljhlYowHalEOkDIcQj bzr4b4xQLJDSuuEIYhHEJhe8I2WL9FetkV1cmP37LVhXf23zYFf3Jc/USF8Nqu5muPyn rUyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690999090; x=1691603890; 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=L5Agk2IhTlueKpAaOVZPmPiVBKk+AEjM8QiFyo+WrKQ=; b=Vi+1liv7gDPRw8NFzP4BaCzlErKjZQMDBHfGSNbpX9FCk2e95+IxRwMRs2i0jX7ZGi NtHutpLrpzlqi1oJ2W5PvPKoeMk4XTsjiy6jalelq7m7OAk0QTRI7Tkh0ZZHgmGzm+5b e0ozE3+cJgAzmU55Qt8g/SrVemFE8Jk86tlXEO74tyKyoH6irr12Th7R7U5Qh34z7I74 fAwtQcb8G85XrSn+c2cNB/1QQMYDNW3wRU+NDDNpkT9f6Vf+tG9Q2OEnkuIdPLHx0bU0 0w8DBPTHz0VPNODKI/eiUj2dzuUcL9nPEFie3RN77tagC+xSscSz777bSORqlOPxl3p/ YAMg== X-Gm-Message-State: ABy/qLZrMzT6sRVNVfDJM0ittOWhRmMxkwJ05pN/ZaSYDr/Bu/zthiOJ fZJ7URUJP/Mh3bQ/P98UO8I= X-Received: by 2002:a05:600c:2253:b0:3fd:3049:9496 with SMTP id a19-20020a05600c225300b003fd30499496mr5605696wmm.33.1690999090199; Wed, 02 Aug 2023 10:58:10 -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.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Aug 2023 10:58:09 -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 08/27] ASoC: Intel: kbl_da7219_max98357a: Map missing Line Out jack kcontrol Date: Wed, 2 Aug 2023 20:57:18 +0300 Message-Id: <20230802175737.263412-9-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: 1773144645107694824 X-GMAIL-MSGID: 1773144645107694824 Commit c2065d43ae85 ("ASoC: Intel: kbl_da7219_max98357a: remap jack pins") maps kcontrols for Headphone and Headset Mic jacks for this driver so that PulseAudio and PipeWire can handle jack 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 --- sound/soc/intel/boards/kbl_da7219_max98357a.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sound/soc/intel/boards/kbl_da7219_max98357a.c b/sound/soc/intel/boards/kbl_da7219_max98357a.c index 18365ce6bcba..97149513076f 100644 --- a/sound/soc/intel/boards/kbl_da7219_max98357a.c +++ b/sound/soc/intel/boards/kbl_da7219_max98357a.c @@ -83,12 +83,14 @@ static const struct snd_kcontrol_new kabylake_controls[] = { SOC_DAPM_PIN_SWITCH("Headphone Jack"), SOC_DAPM_PIN_SWITCH("Headset Mic"), SOC_DAPM_PIN_SWITCH("Spk"), + SOC_DAPM_PIN_SWITCH("Line Out"), }; static const struct snd_soc_dapm_widget kabylake_widgets[] = { SND_SOC_DAPM_HP("Headphone Jack", NULL), SND_SOC_DAPM_MIC("Headset Mic", NULL), SND_SOC_DAPM_SPK("Spk", 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), @@ -107,6 +109,10 @@ static struct snd_soc_jack_pin jack_pins[] = { .pin = "Headset Mic", .mask = SND_JACK_MICROPHONE, }, + { + .pin = "Line Out", + .mask = SND_JACK_LINEOUT, + }, }; static const struct snd_soc_dapm_route kabylake_map[] = { @@ -147,6 +153,7 @@ static const struct snd_soc_dapm_route kabylake_map[] = { { "Headphone Jack", NULL, "Platform Clock" }, { "Headset Mic", NULL, "Platform Clock" }, + { "Line Out", NULL, "Platform Clock" }, }; static int kabylake_ssp_fixup(struct snd_soc_pcm_runtime *rtd,