From patchwork Wed Aug 2 17:57:20 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: 130112 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f41:0:b0:3e4:2afc:c1 with SMTP id v1csp684724vqx; Wed, 2 Aug 2023 12:40:13 -0700 (PDT) X-Google-Smtp-Source: APBJJlHn/+YLAduDo7ofEtJw++BOenvvxcwPsgDQsBnoovR4XUQ38jTEpZy80i1e1mtKQdE15o0P X-Received: by 2002:a17:90a:2ca2:b0:267:f9ab:15bb with SMTP id n31-20020a17090a2ca200b00267f9ab15bbmr13915711pjd.14.1691005212897; Wed, 02 Aug 2023 12:40:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691005212; cv=none; d=google.com; s=arc-20160816; b=oR9Ax7veIH3aEPRAHbbPDw8l52+7ktJjCFaJp3ited2JkqOVET4KKLm0FMRfvgzjZR n5qd9F1R4hVFQe7p38jJfh0PYhCicHjozwiDe1VwUTfHCW1tNoOvN8J0FTuS3BjgrtSd UjsUCKUHeNcKg33YYGr6ShrNpXcwJ2Cx/132erqrwRzfIXPQfsnM0jFSFR5NIYZFb0sN 7x3eGdA0j6vQYNm+YV/J52MxL6BfdNM+XTirASLBznlZsa8ezas034mqAALhPZsC7cip XSoDiohryfwYgrf8/XuPjajTS+ZKNR0VgiVbnOdd7XEndkdox0Y3LL3q0+2s/Pu3QmfM 0r6A== 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=kNnRUj13sGKYiaqiH+uUTgS+yS59+A+KbZaO7xd9beM=; fh=GUNhzEJfka7aU6InG/mqeUgtNKAejFmk0vy+CY7S+VM=; b=K2Cvyr1BqrBZNA5Vm948lDAR6V+tXkigL7uq3WpcvvqNuho5t4RPjhj2nC8Wqpfv3A r216N4aLO9JuAyYGlP5LtM9JoYVNxV39m9f4C5nXlUWWnx0uXRzW314zAfR1HGolOQ7U Lno0B5ih1mygSP0/1navNgBVvG/8vDHCZLDW7/u3N+EtvcKe6W5Y4KugztJF4IN8Hw4P qju/Fv/YTb9immBQHS31Ff2l2HoCQAGTj6CMuq8OKrxKAujMDr/mlcnm0mycv893ws/d KIOri0mUJ/D2J9mf2KYPM6Pz/Wv0MKSCzBRs6mfIseyb7ioDefXqQOtLQgzzj6d3nkeB uUHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=lkUVB3Er; 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 d1-20020a17090ae28100b0026829a94587si1578904pjz.176.2023.08.02.12.39.58; Wed, 02 Aug 2023 12:40:12 -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=lkUVB3Er; 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 S230112AbjHBR6n (ORCPT + 99 others); Wed, 2 Aug 2023 13:58:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234278AbjHBR6Q (ORCPT ); Wed, 2 Aug 2023 13:58:16 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1A8EA3 for ; Wed, 2 Aug 2023 10:58:15 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-3fe2d218eedso1552915e9.0 for ; Wed, 02 Aug 2023 10:58:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690999094; x=1691603894; 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=kNnRUj13sGKYiaqiH+uUTgS+yS59+A+KbZaO7xd9beM=; b=lkUVB3Er6Tk4LtvOzzFy83WjQTHW44mVzjLLbvGWYul576VCJEMkF8DHZhFSneRvs4 FHhPDUsl0A/XDlnt9uJF8cDUfJNEZwP9vEysWWdghsgRnZ0/chZeN9CqgxVrYZNy+nGP S0gj35ahl4JEC+1+TbxKtDq8zKkgPo1MxPc0qEHuq5C9EVtS31K2lokeftsT7+X+Dcec o/H5LdipYetf+g0AosAO0r2fZqfh4QTLs5x3W+te7VnKDkF8Z6QBeFAZKA10HjFmsNhp Ai9VwROFVoKnv9wDuN6mEgRS4+oo23cxN3arsslC19XbJHKaTBjVl067/MvGkhnY9Qch VAfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690999094; x=1691603894; 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=kNnRUj13sGKYiaqiH+uUTgS+yS59+A+KbZaO7xd9beM=; b=ELuC3l4e30E9vddg2GYu0Rp4Fkt9weWJHapRu40rPjb+QJReex8lXmXS7YnnAuAfNw oTv8eWC9BHESJJhfZQoOHPUOplaPJ8gNtY65vjAAGr/pRh2IXArkLnll8i7xQUzH/s+Q 8hcWSpzPPosrhM+9jk9D4EhVOdfkwPEMGeIuufzlEIUQsdUhVa92uh9M8Y7HEKeXj4V/ FDnji92MGVrXozxNaQ0WEt7YFBpLYoSzD+E/m9QAnUmrmV8ylBXs3wMxjUbZjXQlNOPJ jZg+/3eowJ7k6NZmAfRKIS0WNv6q9HDdfAehRwfkdeKF2w5mxID5OuGKrISgNU9kSWbi RSsw== X-Gm-Message-State: ABy/qLa0ivMAY8EyXf+McC1jJqOEz3SEGkTyc0gka+TxbBXwkZzX3SBM tH8ZD0TqUj6QnABZ0GVIE8c= X-Received: by 2002:a05:600c:281:b0:3fb:dff2:9f17 with SMTP id 1-20020a05600c028100b003fbdff29f17mr5479686wmk.15.1690999094138; Wed, 02 Aug 2023 10:58:14 -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.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Aug 2023 10:58:13 -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 10/27] ASoC: Intel: sof_da7219_max98373: Map missing Line Out jack kcontrol Date: Wed, 2 Aug 2023 20:57:20 +0300 Message-Id: <20230802175737.263412-11-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: 1773147482003432301 X-GMAIL-MSGID: 1773147482003432301 Commit 2913bb1f6830 ("ASoC: Intel: sof_da7219_max98373: 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/sof_da7219_max98373.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sound/soc/intel/boards/sof_da7219_max98373.c b/sound/soc/intel/boards/sof_da7219_max98373.c index 740aa11cb019..bbd47e7e4343 100644 --- a/sound/soc/intel/boards/sof_da7219_max98373.c +++ b/sound/soc/intel/boards/sof_da7219_max98373.c @@ -65,6 +65,7 @@ static int platform_clock_control(struct snd_soc_dapm_widget *w, static const struct snd_kcontrol_new controls[] = { SOC_DAPM_PIN_SWITCH("Headphone Jack"), SOC_DAPM_PIN_SWITCH("Headset Mic"), + SOC_DAPM_PIN_SWITCH("Line Out"), SOC_DAPM_PIN_SWITCH("Left Spk"), SOC_DAPM_PIN_SWITCH("Right Spk"), }; @@ -72,6 +73,7 @@ static const struct snd_kcontrol_new controls[] = { static const struct snd_kcontrol_new m98360a_controls[] = { SOC_DAPM_PIN_SWITCH("Headphone Jack"), SOC_DAPM_PIN_SWITCH("Headset Mic"), + SOC_DAPM_PIN_SWITCH("Line Out"), SOC_DAPM_PIN_SWITCH("Spk"), }; @@ -79,6 +81,7 @@ static const struct snd_kcontrol_new m98360a_controls[] = { static const struct snd_soc_dapm_widget 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_SPK("Left Spk", NULL), SND_SOC_DAPM_SPK("Right Spk", NULL), @@ -98,6 +101,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" }, { "Left Spk", NULL, "Left BE_OUT" }, { "Right Spk", NULL, "Right BE_OUT" }, @@ -110,6 +114,7 @@ static const struct snd_soc_dapm_route audio_map[] = { static const struct snd_soc_dapm_widget max98360a_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_SPK("Spk", NULL), @@ -128,6 +133,7 @@ static const struct snd_soc_dapm_route max98360a_map[] = { { "Headphone Jack", NULL, "Platform Clock" }, { "Headset Mic", NULL, "Platform Clock" }, + { "Line Out", NULL, "Platform Clock" }, {"Spk", NULL, "Speaker"}, @@ -144,6 +150,10 @@ static struct snd_soc_jack_pin jack_pins[] = { .pin = "Headset Mic", .mask = SND_JACK_MICROPHONE, }, + { + .pin = "Line Out", + .mask = SND_JACK_LINEOUT, + }, }; static struct snd_soc_jack headset;