From patchwork Wed Aug 2 17:57:36 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: 130081 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f41:0:b0:3e4:2afc:c1 with SMTP id v1csp668520vqx; Wed, 2 Aug 2023 12:08:42 -0700 (PDT) X-Google-Smtp-Source: APBJJlEPIqWgxEW6iWX3zTdHePu+oqHvPUfd4/HHvX51931rX1TaNRPyWwB2naXWGHdwByFDvA2B X-Received: by 2002:a05:6a00:a20:b0:67b:f249:35e3 with SMTP id p32-20020a056a000a2000b0067bf24935e3mr18341757pfh.26.1691003322450; Wed, 02 Aug 2023 12:08:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691003322; cv=none; d=google.com; s=arc-20160816; b=Dbrnt+Ib49a9SJwYIo2CBQ6t/szp2eg3HRd8qO3TdOcdtMIvCjfH+GPUqNXlxwkscJ rLq1/9s6qi/Vt2BIuOwpU9REzhrf7GBS318/3c5wETTzA2A+1Z0ZrUb0UwGPGEpgMe6t GC5d2RrJ4Tha9dFsq7PgjdwYh5PjOfcEOfTHLGQqBl0BZKBOQV/uEjJGwJi+JC5+hO5d 7OjspgdnaW1C18LPDuvMtiOcfl/WaB3fkKI7nkFFauEN+74dGwgGBm/PJfKDoA7wW3xi RqyEt8dgII8I4Fo6OoGWqFfdnpKQXpx38q8/CSEZjSqqbsRZxB6uXJlYqwk33j/hSCwW cutQ== 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=0QAIWP4M6rBKtTpn/rRinZikOOxcMUXJXPcYbOcWh7A=; fh=GUNhzEJfka7aU6InG/mqeUgtNKAejFmk0vy+CY7S+VM=; b=dDxyjHZwqCHWmENlbxx6qV1EoOyWwk5BGllnSTgJUNWKaOmhcSxN9fgISW1rxLVc47 lPKMX9SyB74A+1fy9TgWoCS/B7VoiQ4gS0IamEa54u7+XXbKvQdgntUK1LSRq/vD5N6w m2715n9aqc1fQ0aa4VEYfjsaTNDN1nWqsOzRi0O46eKZk+a0sSSj5F1/z6frzSIemy2R Zp28W5QcfzGK+dsUVXcUgM78B0uNQxA6kUpVGI9u4lPpuyHWHlegTkqn+AB0lgW7Ji8z 92rS+fniSjjeLfj0z7fyQzC/tI8rqq5w7A8v+SQvuDa9IG04YABektTTQQ5Ygv6ltqOo urMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=jG029gDz; 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 h3-20020a056a00218300b0064d3e917a90si7836554pfi.180.2023.08.02.12.08.29; Wed, 02 Aug 2023 12:08:42 -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=jG029gDz; 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 S234240AbjHBSA3 (ORCPT + 99 others); Wed, 2 Aug 2023 14:00:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234205AbjHBR7x (ORCPT ); Wed, 2 Aug 2023 13:59:53 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DA7C3C11 for ; Wed, 2 Aug 2023 10:58:52 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-3fbab0d0b88so8096785e9.0 for ; Wed, 02 Aug 2023 10:58:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690999125; x=1691603925; 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=0QAIWP4M6rBKtTpn/rRinZikOOxcMUXJXPcYbOcWh7A=; b=jG029gDzx1VlaSJ6xc7aVKpj0Yef+5LN2PYEenXcXD3VNalatBnZxvLwaxFCBLAjwI pCU5V57NMxEkbzjVj7F28GLT9ocP47sWxQkPY+L7VYTFULVtn4pHf9a5Tihq1TE076Ho gRUFUZ7hQflSR1jA0q8oBDeJn96GDbIoCE8e5iKcEAb9D1qMkOu+S6PPk43/1HG8lGJV Y4hObvXevJX5xCJrPb7FVXhkZJCJmgvYmgSku5qWRfrNjtspBZcIe/HmUwqQVwOjUkOO tAeRA1MRPXTPmr8YW2KSiqix3l1nC7oPSZdEB1hmbcPePoeOax5Uysacrx6N2ELLkZkS G2Ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690999125; x=1691603925; 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=0QAIWP4M6rBKtTpn/rRinZikOOxcMUXJXPcYbOcWh7A=; b=ZZmhaySxg+55uYRBFzGAlX5hONYiIV1xlcA6cFtQhVzdv+DrzmYAPVIGRkJ023DwtF EXa7Ac118kNRkpF1eI0mwPaXg7royNtmSCj+49a1FIGSU1yVGZi9FtfMwPulNAM+s4qa 7eaIJ5wLkK7IImMBYvf4ce9TCyUSo9MXQHGwcbW0ssct2tXLOWOmLlofmrw9WEb8+vnU CT3uJdj+mURebY9TjcXI8CbXFOsj//a9yHsJkZ2FaBILEnHQDnx8LB6eXE3yz/zTaqRn PZtrHWrC1T2/Be96g3WgUQJaS0I4P1henV7Ek0JI/3UEaL7vr/LiCeg7r8M4vNnfiMcj JYbA== X-Gm-Message-State: ABy/qLYEpszgPa7c2AF6QnpkEduO3DcoSmSUEYmJVl8P+eCdEYzdkBnX aCQR7ogzRjBMWwwx0L+Vr8Q= X-Received: by 2002:a05:600c:4f06:b0:3fa:88b4:bff3 with SMTP id l6-20020a05600c4f0600b003fa88b4bff3mr5859273wmq.11.1690999125540; Wed, 02 Aug 2023 10:58:45 -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.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Aug 2023 10:58:45 -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 26/27] ASoC: samsung: lowland: Split Line Out jack kcontrol from Headphone Date: Wed, 2 Aug 2023 20:57:36 +0300 Message-Id: <20230802175737.263412-27-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: 1773145500034278142 X-GMAIL-MSGID: 1773145500034278142 This driver has correctly mapped jack kcontrols for Headphone and Headset Mic. However, it is also mapping Line Out jack detection events to the Headphone kcontrol. The WM5100 codec used here can distinguish Line Out connections from Headphone connections. Decouple the two, expose Line Out to userspace as an independent kcontrol and add the necessary widget. Signed-off-by: Alper Nebi Yasak --- I'm not sure this is a good idea, but still... sound/soc/samsung/lowland.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sound/soc/samsung/lowland.c b/sound/soc/samsung/lowland.c index 106770be6fc5..a79df871ea13 100644 --- a/sound/soc/samsung/lowland.c +++ b/sound/soc/samsung/lowland.c @@ -22,12 +22,16 @@ static struct snd_soc_jack lowland_headset; static struct snd_soc_jack_pin lowland_headset_pins[] = { { .pin = "Headphone", - .mask = SND_JACK_HEADPHONE | SND_JACK_LINEOUT, + .mask = SND_JACK_HEADPHONE, }, { .pin = "Headset Mic", .mask = SND_JACK_MICROPHONE, }, + { + .pin = "Line Out", + .mask = SND_JACK_LINEOUT, + }, }; static int lowland_wm5100_init(struct snd_soc_pcm_runtime *rtd) @@ -140,11 +144,13 @@ static const struct snd_kcontrol_new controls[] = { SOC_DAPM_PIN_SWITCH("WM1250 Input"), SOC_DAPM_PIN_SWITCH("WM1250 Output"), SOC_DAPM_PIN_SWITCH("Headphone"), + SOC_DAPM_PIN_SWITCH("Line Out"), }; static const struct snd_soc_dapm_widget widgets[] = { SND_SOC_DAPM_HP("Headphone", NULL), SND_SOC_DAPM_MIC("Headset Mic", NULL), + SND_SOC_DAPM_LINE("Line Out", NULL), SND_SOC_DAPM_SPK("Main Speaker", NULL),