From patchwork Thu Jun 6 10:49:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 13688525 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 39C26C27C54 for ; Thu, 6 Jun 2024 13:39:05 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 85B3FDEC; Thu, 6 Jun 2024 15:38:53 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 85B3FDEC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1717681143; bh=A6SXqGkyXxxcgHrEZHtDmBI/tOkvX/XnW5ssJY9STpY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=qW5b07ImPXXGeNydhglhe/3XGuI2xqKfUHvH3c5lIbub4utzIDRURMofJpCxlQY+V Jsw63pcTDr8fN/doveuQCDFewulivO0jqNcH67xZ3p2UonQNvWKObzTX4iesT+IyJd GZtLlCNbATtpqyhAqpe26bVqYkf+fjyXv4Q3mR84= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 74A5CF805B2; Thu, 6 Jun 2024 15:38:31 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 15A6DF8055C; Thu, 6 Jun 2024 15:38:31 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E3305F804FF; Thu, 6 Jun 2024 15:38:26 +0200 (CEST) Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 3845FF804E5 for ; Thu, 6 Jun 2024 15:38:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3845FF804E5 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=krij4Iek Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a68ca4d6545so179482566b.0 for ; Thu, 06 Jun 2024 06:38:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717681104; x=1718285904; darn=alsa-project.org; 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=Z3FtJnXuanKqQrI14wMr56vQtXua9vfr0htfdfN4mK8=; b=krij4IekltPxkEo6kZhUTNCzR9EvP03I8M1lRY2ffF0ArXBr9BvDXyFdv20sMCBL3x 4xd6sWAZAe57nXs2dSevTvVwTyGir0t9PjTnT6LyiGbGDe2x8MMb/BpZ9Z+clymadqdd 80JjCVZaa89Ym62TWP4pwRaH+zvuBce3QQwapPiTAihbAZ1O1V8+OKuBJzVtq1rcL1QB p17Da8rR7y3/62ogvM6pbXXyZBgALLHHi0J3YxUIllgJGMARnrmbvwXrqFaRo6woNBrf Wv7/Q/yHeh8mdj6YdWz3nMaS1wCfRHnFFZxBQDb7qwrbo8sWjUbXn88HjHFu2YbAJKwm GhZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717681104; x=1718285904; 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=Z3FtJnXuanKqQrI14wMr56vQtXua9vfr0htfdfN4mK8=; b=snvP43umvmp5ynrK7KI0RHvc+Rs2YLHrs2DMIdmKGniKy36rCaOQRVRFADXCpmXsQ2 I8h7te3OmSYzigOsTnpd3IHgd+6zp6EOGe6oNCwTUCEnrPXLzzPPy08At8Kblr8gW0JM ks9EHv45P8zZrE8cuj9H4BgV8tHxLeiawlDCYTaGKqwaw86VcD5N8QV5Wug8jb6sVv7Z MQDyEv+LEIzOxv7Pm0TRyAM7hPRoTjk7T5tLeM/A+Z7O+gNbE6dTs++KVZFdLNZOhAzR qekLY3QLNCeLPtwTi+pzEWrpFBPmwdvM+ckSJPvExgqzDI48kN2Fr9kkWefi62FhuSWu qKhQ== X-Forwarded-Encrypted: i=1; AJvYcCX+xVG4PuOP9cMrnBTSJ5dZYW3HWTrJmmnBkB0k/gNqI3lNTEI0gjEa3LCisUgwWUKyFlXeJ+WnfnCB86FxxxQzkXGxCR281hWABIA= X-Gm-Message-State: AOJu0YwvUummVa5wQ4RAJqxybiypJs5yN1CtpVhrg33FB/00po0nDAyb l6qFV1POycm4xRD3VyQkyR+pKcJEYqwuaBlQZj3s4Jg5QUONFwCtqqokKt96O1bbS+JgwyYksfu Y X-Google-Smtp-Source: AGHT+IGGh1ki9EKzIXM30V5LNCm2Ko5lpV0vUeAV0GMLMi1Sr1y4SqZGh77dYQrdKIRcuwCFwEQ0Rg== X-Received: by 2002:a5d:5223:0:b0:354:db90:6df4 with SMTP id ffacd0b85a97d-35ef0da7179mr2046837f8f.23.1717670969348; Thu, 06 Jun 2024 03:49:29 -0700 (PDT) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35ef5e95bcesm1223185f8f.77.2024.06.06.03.49.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 03:49:28 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: broonie@kernel.org Cc: perex@perex.cz, lgirdwood@gmail.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, krzk+dt@kernel.org, Srinivas Kandagatla Subject: [PATCH v3 1/4] ASoC: qcom: q6dsp: parse Display port tokens Date: Thu, 6 Jun 2024 11:49:19 +0100 Message-Id: <20240606104922.114229-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240606104922.114229-1-srinivas.kandagatla@linaro.org> References: <20240606104922.114229-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1570; i=srinivas.kandagatla@linaro.org; h=from:subject; bh=ri4vhulg4ZINJtTQIuA7x2JtkitUZzfgA3Wq29ZBz3Q=; b=owEBbQGS/pANAwAKAXqh/VnHNFU3AcsmYgBmYZQxG2PLQMRgwWTkOxdJVbHoXpyRODp3JfC8D 48WQNk8tgiJATMEAAEKAB0WIQQi509axvzi9vce3Y16of1ZxzRVNwUCZmGUMQAKCRB6of1ZxzRV N7iQB/9w/lG+yandz7RnuLtqKi1u30/oeoJ2aJw1Z79swhcGbEJ7eMqMVbkZ9PaHhPOPUIZs9jR tctEaoWtuXyhgaPVGVzPg0/I0AUmXaw/hlzxuj6BdhA56PYB5vk678+6iL57kY5117PQzRqapOH by9WZRQJtaq6oAb8w3WlnJuxKlCjwVOklREKzMTTXqwYnuS7l+OZAFyesYus9XRLQ+cchSISBTN S8QQS5s7Pn2Cjiqcc8bpPYXS5pfr/JnE7wqkiOau9qLM1iIvyFn5wNszwxWPdbWdpbtjj17I5io rNZIQnU2vhuz4gZljD2QJWPBOIVj00r6VOtsicZ/9kVeWXZG X-Developer-Key: i=srinivas.kandagatla@linaro.org; a=openpgp; fpr=ED6472765AB36EC43B3EF97AD77E3FC0562560D6 Message-ID-Hash: I4WZF3WR65JWK2DWVPX2HSM6E6UDGEAJ X-Message-ID-Hash: I4WZF3WR65JWK2DWVPX2HSM6E6UDGEAJ X-MailFrom: srinivas.kandagatla@linaro.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Srinivas Kandagatla Signed-off-by: Srinivas Kandagatla --- sound/soc/qcom/qdsp6/topology.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/sound/soc/qcom/qdsp6/topology.c b/sound/soc/qcom/qdsp6/topology.c index 70572c83e101..27a5adb201c3 100644 --- a/sound/soc/qcom/qdsp6/topology.c +++ b/sound/soc/qcom/qdsp6/topology.c @@ -730,6 +730,29 @@ static int audioreach_widget_i2s_module_load(struct audioreach_module *mod, return 0; } +static int audioreach_widget_dp_module_load(struct audioreach_module *mod, + struct snd_soc_tplg_vendor_array *mod_array) +{ + struct snd_soc_tplg_vendor_value_elem *mod_elem; + int tkn_count = 0; + + mod_elem = mod_array->value; + + while (tkn_count <= (le32_to_cpu(mod_array->num_elems) - 1)) { + switch (le32_to_cpu(mod_elem->token)) { + case AR_TKN_U32_MODULE_FMT_DATA: + mod->data_format = le32_to_cpu(mod_elem->value); + break; + default: + break; + } + tkn_count++; + mod_elem++; + } + + return 0; +} + static int audioreach_widget_load_buffer(struct snd_soc_component *component, int index, struct snd_soc_dapm_widget *w, struct snd_soc_tplg_dapm_widget *tplg_w) @@ -760,6 +783,9 @@ static int audioreach_widget_load_buffer(struct snd_soc_component *component, case MODULE_ID_I2S_SOURCE: audioreach_widget_i2s_module_load(mod, mod_array); break; + case MODULE_ID_DISPLAY_PORT_SINK: + audioreach_widget_dp_module_load(mod, mod_array); + break; default: return -EINVAL; } From patchwork Thu Jun 6 10:49:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 13688504 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 34D6BC25B75 for ; Thu, 6 Jun 2024 13:28:38 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 3D64ADE5; Thu, 6 Jun 2024 15:28:26 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3D64ADE5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1717680516; bh=lI2Wr+WdCGDlmOKaaq/1DavWKIHY7PEWV8jOUjaMVnY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=fPQ47zZ8UXCco/Q3O7pnTZ8O4mgKjDY5WE970XMDr5P6Ct8AR42mhjiSxs0/BeLCt 5L87ILtr3ZWMPEfGjz8TN3vl9ylQxHnaJHq9r+qNTETzDI+auvePmIEPACgCzyqpYE b/E13y0QItSdV63YOnvPCdNoXTOIgQS7UOi25+sw= Received: by alsa1.perex.cz (Postfix, from userid 50401) id E0127F805D6; Thu, 6 Jun 2024 15:27:58 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 68C3CF805AE; Thu, 6 Jun 2024 15:27:58 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 90C9AF804B2; Thu, 6 Jun 2024 15:27:39 +0200 (CEST) Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C0758F8001D for ; Thu, 6 Jun 2024 15:27:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C0758F8001D Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=lPTKzBHw Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-42147970772so6433845e9.0 for ; Thu, 06 Jun 2024 06:27:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717680456; x=1718285256; darn=alsa-project.org; 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=PsLfgr3Xi6vscety5X2K0IsqtXVqaphhFy37TP99Jgk=; b=lPTKzBHwvFhOeiOdif5a10ChJpMo74QLX4GCqRdbSBeV7EGE6bBS4EDN39H88RAqTI qtv9pC49P42q6mcFIhe1wB22hLON9i/vj7XsHTok1C87ZN84NrfCDzwSINMO/02E2+C4 828pR5b9Lgiwb/RyKtoNzpG2sL9u1ouqZBA4VdCncluARnWVeRw7kCzCxgUel9t2KU7i oGymKT2wnwbkgPoCg0G00MbQS2LMt2ixC4bRpElJyDeM/fRRnYe/41JbysM+zcjm/ha+ aWlbYi2BpVvrHSpMbUaHuNUyB1FVA3HhpAMYE9CZcdvzdB7ISDvZx1DD39y0nBtfbZ7R inzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717680456; x=1718285256; 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=PsLfgr3Xi6vscety5X2K0IsqtXVqaphhFy37TP99Jgk=; b=tdWkjheW08sFG1FPat/mT+eiShSUr4Ne+MzGU0JCrTIUYscUM7JwTUcKvk99/dHA1V n286e1ojnjaLq9ze/0dHXmf6EcGGNsXdxeBDVN6iha4xMPAqsUTELjyZO6JIZJHc90TH syBMunCfEhkxQyoS6EZfdT4qbXxvwNTcGPIBqPGXtGyc17/gpZQFyLtoJ7Hy5/+6/40Z tK8zCbtFV83+l2MWw5IQpHXdEnWMq0Hd+NZ8T8EGwvKjQ6xMEOaPFzOclSPjmMKIzXvp Ev9ValcnPjXpJx+7AEDGjvKJY+WO23vvYSpg5mPlOHWxUKfNjfpIGwYmdb+UO+EYkNYY mDAQ== X-Forwarded-Encrypted: i=1; AJvYcCVRzDukb2TlD7nVWdo4I5mfs/b34DJPZQFL9tOqqpUHmdGZfpdY+HqMETdIpGQXGbGupqhM3dTQjW1ZyV6ilJ+44/qNYG+nQNtlv24= X-Gm-Message-State: AOJu0YxApbUaZcpNpnzjJeqxXhQMUZ1oUajn3NsR5xdxRupuTDsJFJ7u Rcw1LBaqcH0kDM1uNtSs2CQhchjR/B8p+zOwzAnGyK9iUGw3CRE2MpJK2ZpOu5SDPsBnsjSWKqb g X-Google-Smtp-Source: AGHT+IGFWMaUquMnVfZp3UMZFdvZP9pMC5U96cQtmVXdFBaIGSzynEYzdADNTXephojkOl4Dp7zQiA== X-Received: by 2002:adf:a1d5:0:b0:34c:f507:84b6 with SMTP id ffacd0b85a97d-35e8ef1b8dcmr4182580f8f.41.1717670970844; Thu, 06 Jun 2024 03:49:30 -0700 (PDT) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35ef5e95bcesm1223185f8f.77.2024.06.06.03.49.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 03:49:29 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: broonie@kernel.org Cc: perex@perex.cz, lgirdwood@gmail.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, krzk+dt@kernel.org, Srinivas Kandagatla Subject: [PATCH v3 2/4] ASoC: qcom: common: add Display port Jack function Date: Thu, 6 Jun 2024 11:49:20 +0100 Message-Id: <20240606104922.114229-3-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240606104922.114229-1-srinivas.kandagatla@linaro.org> References: <20240606104922.114229-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2545; i=srinivas.kandagatla@linaro.org; h=from:subject; bh=0xU05ks6euG6v2ZrWI75v4FiGnhWGBYPQDcPdDGOsmw=; b=owEBbQGS/pANAwAKAXqh/VnHNFU3AcsmYgBmYZQxQDX4PXA+5exUK/ygVrKmwpjaWWHAxm69M qofEzm+QaGJATMEAAEKAB0WIQQi509axvzi9vce3Y16of1ZxzRVNwUCZmGUMQAKCRB6of1ZxzRV N0RUB/0UByxBo38zMz7xEXFAgYCc7m6SkHWnWqEk85cHJRTF4UvdMRTpdmKgawEmhSM3BBqWzZZ LilAuQ4/TlKP/M4j/ahCdkGDUUuUQVMC97IK+6DjhoA3+b8PyZgI1luoQWogoKF/mMNlSHV8DNO Dpl8ZgJicd4yE2jzNFslCg8uoOwIIZ4xsi1EIcNXN56Ep56U+Sk93mDSlHOExGpSm6xzfr/zmJx 7hxjXz+I5bqk0N+WXKLvEZppv5NW29z+6NK5k3ONnR+h3MCx9oDjOv348ckD3kfXx++H0Km5azk QkITat4rhsNn7wpF9GLuuxubkjoNwPVoATee/bOo4f93KpND X-Developer-Key: i=srinivas.kandagatla@linaro.org; a=openpgp; fpr=ED6472765AB36EC43B3EF97AD77E3FC0562560D6 Message-ID-Hash: MLTYHVRGGOR6ELJPGPZRU73OWD7VOO64 X-Message-ID-Hash: MLTYHVRGGOR6ELJPGPZRU73OWD7VOO64 X-MailFrom: srinivas.kandagatla@linaro.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: <> List-Archive: <> List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Srinivas Kandagatla Add a common function to add Display port jack. Signed-off-by: Srinivas Kandagatla --- sound/soc/qcom/common.c | 35 +++++++++++++++++++++++++++++++++++ sound/soc/qcom/common.h | 3 +++ 2 files changed, 38 insertions(+) diff --git a/sound/soc/qcom/common.c b/sound/soc/qcom/common.c index 3d02aa3844f2..56b4a3654aec 100644 --- a/sound/soc/qcom/common.c +++ b/sound/soc/qcom/common.c @@ -8,9 +8,19 @@ #include #include "common.h" +#define NAME_SIZE 32 + static const struct snd_soc_dapm_widget qcom_jack_snd_widgets[] = { SND_SOC_DAPM_HP("Headphone Jack", NULL), SND_SOC_DAPM_MIC("Mic Jack", NULL), + SND_SOC_DAPM_SPK("DP0 Jack", NULL), + SND_SOC_DAPM_SPK("DP1 Jack", NULL), + SND_SOC_DAPM_SPK("DP2 Jack", NULL), + SND_SOC_DAPM_SPK("DP3 Jack", NULL), + SND_SOC_DAPM_SPK("DP4 Jack", NULL), + SND_SOC_DAPM_SPK("DP5 Jack", NULL), + SND_SOC_DAPM_SPK("DP6 Jack", NULL), + SND_SOC_DAPM_SPK("DP7 Jack", NULL), }; int qcom_snd_parse_of(struct snd_soc_card *card) @@ -240,5 +250,30 @@ int qcom_snd_wcd_jack_setup(struct snd_soc_pcm_runtime *rtd, } EXPORT_SYMBOL_GPL(qcom_snd_wcd_jack_setup); +int qcom_snd_dp_jack_setup(struct snd_soc_pcm_runtime *rtd, + struct snd_soc_jack *dp_jack, int dp_pcm_id) +{ + struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0); + struct snd_soc_card *card = rtd->card; + char jack_name[NAME_SIZE]; + int rval, i; + + snprintf(jack_name, sizeof(jack_name), "DP%d Jack", dp_pcm_id); + rval = snd_soc_card_jack_new(card, jack_name, SND_JACK_AVOUT, dp_jack); + if (rval) + return rval; + + for_each_rtd_codec_dais(rtd, i, codec_dai) { + rval = snd_soc_component_set_jack(codec_dai->component, dp_jack, NULL); + if (rval != 0 && rval != -ENOTSUPP) { + dev_warn(card->dev, "Failed to set jack: %d\n", rval); + return rval; + } + } + + return 0; +} +EXPORT_SYMBOL_GPL(qcom_snd_dp_jack_setup); + MODULE_DESCRIPTION("ASoC Qualcomm helper functions"); MODULE_LICENSE("GPL"); diff --git a/sound/soc/qcom/common.h b/sound/soc/qcom/common.h index d7f80ee5ae26..1b8d3f90bffa 100644 --- a/sound/soc/qcom/common.h +++ b/sound/soc/qcom/common.h @@ -9,5 +9,8 @@ int qcom_snd_parse_of(struct snd_soc_card *card); int qcom_snd_wcd_jack_setup(struct snd_soc_pcm_runtime *rtd, struct snd_soc_jack *jack, bool *jack_setup); +int qcom_snd_dp_jack_setup(struct snd_soc_pcm_runtime *rtd, + struct snd_soc_jack *dp_jack, int id); + #endif From patchwork Thu Jun 6 10:49:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 13688528 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C7355C25B75 for ; Thu, 6 Jun 2024 13:46:34 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id EE426DF8; Thu, 6 Jun 2024 15:46:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz EE426DF8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1717681593; bh=I+6UZi7puKUhYGtPeWzvnTaY52v4RHJIizpINfnLSYM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=hEzN2HZf4mndjOmf/37PN7+2eSZpYJUOTSuOP+/g95mjUVc9peE+bRSsBmocmcELk znaaO6bXeDKCHcgkxnYV4x2kYzCDsxYnlFk1WuCq2v0EL6t6b4YhL5TnMZ8EIvpa9y d+gFbkpSfFo06C4+uuL3QM9O+APuLmEYkcGdJCf8= Received: by alsa1.perex.cz (Postfix, from userid 50401) id C3427F80587; Thu, 6 Jun 2024 15:46:02 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 6E6E7F8057A; Thu, 6 Jun 2024 15:46:02 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 74849F804E5; Thu, 6 Jun 2024 15:45:58 +0200 (CEST) Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C897AF80171 for ; Thu, 6 Jun 2024 15:45:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C897AF80171 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=LleEPhyx Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-354b722fe81so986806f8f.3 for ; Thu, 06 Jun 2024 06:45:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717681555; x=1718286355; darn=alsa-project.org; 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=KotxQBLtmDzRH6QGny55WAgb9csIi+0GRil2s7zETak=; b=LleEPhyxYIjSkn7f7yz88N0581EG/8QACzNy1hCt5rr+TejAxy+OIFIknwmhgSAjAX w6BiwrW+y9ByUnf8nU1ZszerXlM4o8rpCugFSwO2FK5krZ2VCjHngNPdeIvNr1rYxOx0 LBnEmckXGUnd6zEJbFkO9K+m5ba3RLakhyvfSHqS+3sTCAA2dnaiMUI/aFRG6XoDWJYt 9GAT5rm3D1tk9Ptz4UXzxM8UXKl+LPNpFmNUInP5/85jhHZDAbpJi35nbR6OHtOBT/md pPEUhuQ+na3xs1KuXyrByehLe8dS2iJLWZJL0JgL3PrLCB023t6Tph2mRqJHQA/jbdQB qxZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717681555; x=1718286355; 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=KotxQBLtmDzRH6QGny55WAgb9csIi+0GRil2s7zETak=; b=QtkK7EQvNOtoxNvxp73xAeZB8VIm98rLQ/JWz2CfHlF/a1O14iPmMVAxDDV4GH4oLy 5emlVva5VjKExBEIECA+yb8pBIDOYci9JyvTRameig4pwGrERHCH7PnBfdrWabpI/U6s Mk8sUQ/zJK1mWzAEnK49tJqsSBRCQOSfob65jalFdSgYo+H/qu7x3kwS0m2QxzjLIVh9 CHxs7Qg6IDWW4Lz43czC7nH0UL43xiaeJQr2hBF3+Y1/62+Y9I4sNQZLyfpxj2dT20X4 /wYbn/av5leG5su3siiiXTihJLOmvN8ZAcHl0K2JpxnwpTNqnNNTHamlIhDXZ4J9r4bY r8Pw== X-Forwarded-Encrypted: i=1; AJvYcCWINGkqZWIqb15swpeUvw1cRwSi2PObUj4RRe0cKVJ/LilR2/xnShH4zLOvD4KFtIajuqjes0+cNsDZqDT6BvVUrkmcOLCwssdg4uc= X-Gm-Message-State: AOJu0YzaL48r18m6r1vij/SCrgTC/Ivn0rgbZ/DyDO1TECMbZAW1Zfwy EuGLAR/G6dEMcm6I+10iAt8CJIUFIvV2zTsYCHirTKMg66dMPb8Q3mnvpt3UOM9P683xLiHMLGi + X-Google-Smtp-Source: AGHT+IGSCQvrfLW6lE08ifHKvN4Un/+EhdFM2F5Aprg72ymHaQ2v3OqZe8dulDUIdlz+hHyK3pMwDg== X-Received: by 2002:a05:6000:2aa:b0:355:161:b7e3 with SMTP id ffacd0b85a97d-35e8ef7ea4dmr4949893f8f.48.1717670972249; Thu, 06 Jun 2024 03:49:32 -0700 (PDT) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35ef5e95bcesm1223185f8f.77.2024.06.06.03.49.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 03:49:31 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: broonie@kernel.org Cc: perex@perex.cz, lgirdwood@gmail.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, krzk+dt@kernel.org, Srinivas Kandagatla Subject: [PATCH v3 3/4] ASoC: qcom: sc8280xp: add Display port Jack Date: Thu, 6 Jun 2024 11:49:21 +0100 Message-Id: <20240606104922.114229-4-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240606104922.114229-1-srinivas.kandagatla@linaro.org> References: <20240606104922.114229-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1694; i=srinivas.kandagatla@linaro.org; h=from:subject; bh=TUQWW37BE+q1mcU0pxnwMPllf5GS98Hiri3+qX4bwus=; b=owEBbQGS/pANAwAKAXqh/VnHNFU3AcsmYgBmYZQxDaK2PB42LioKGSzptd4+OTAK4jxQS4jwi DlhPDmFu/eJATMEAAEKAB0WIQQi509axvzi9vce3Y16of1ZxzRVNwUCZmGUMQAKCRB6of1ZxzRV NxfBCACAAfrzfsr30IYlz/hLdxCQonofqYtWX6I8ONji38oi22ss31ptXN0pbuEYDSPe2RdSqiC DAlRv6829tTjTaalLZXL7aKaxgFqo1stJ17dLbmJ+Z+m7ZJ4rIN1ZWobe29FG+OcI8T2ibz/DHN of4UIqGvxRS3xZYLu1bPelt/PvKB/x+7j+NB23W4815+wDLqkbOaS475xslL6hbrHSVXnLtI0c2 lRrFAMR5Y4LGVfqjipp8sMtL7yLUZhV2v/n/TATY3GssQ91wgO6UZ4xdERIEPZddcInsNtS72Ag xrXug3OgfXaAwYh+J8kaPIUVct08OZ6SqhacKTVtryk9NwaC X-Developer-Key: i=srinivas.kandagatla@linaro.org; a=openpgp; fpr=ED6472765AB36EC43B3EF97AD77E3FC0562560D6 Message-ID-Hash: O64J65VOSFTJEMUJ7FMTJ3NXVJ4XV3H7 X-Message-ID-Hash: O64J65VOSFTJEMUJ7FMTJ3NXVJ4XV3H7 X-MailFrom: srinivas.kandagatla@linaro.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Srinivas Kandagatla Add support for Display Port Jack events. Signed-off-by: Srinivas Kandagatla --- sound/soc/qcom/sc8280xp.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sound/soc/qcom/sc8280xp.c b/sound/soc/qcom/sc8280xp.c index 06fd47c4178f..922ecada1cd8 100644 --- a/sound/soc/qcom/sc8280xp.c +++ b/sound/soc/qcom/sc8280xp.c @@ -19,6 +19,7 @@ struct sc8280xp_snd_data { struct snd_soc_card *card; struct sdw_stream_runtime *sruntime[AFE_PORT_MAX]; struct snd_soc_jack jack; + struct snd_soc_jack dp_jack[8]; bool jack_setup; }; @@ -27,6 +28,8 @@ static int sc8280xp_snd_init(struct snd_soc_pcm_runtime *rtd) struct sc8280xp_snd_data *data = snd_soc_card_get_drvdata(rtd->card); struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0); struct snd_soc_card *card = rtd->card; + struct snd_soc_jack *dp_jack = NULL; + int dp_pcm_id = 0; switch (cpu_dai->id) { case WSA_CODEC_DMA_RX_0: @@ -41,10 +44,22 @@ static int sc8280xp_snd_init(struct snd_soc_pcm_runtime *rtd) snd_soc_limit_volume(card, "SpkrLeft PA Volume", 17); snd_soc_limit_volume(card, "SpkrRight PA Volume", 17); break; + case DISPLAY_PORT_RX_0: + /* DISPLAY_PORT dai ids are not contiguous */ + dp_pcm_id = 0; + dp_jack = &data->dp_jack[dp_pcm_id]; + break; + case DISPLAY_PORT_RX_1 ... DISPLAY_PORT_RX_7: + dp_pcm_id = cpu_dai->id - DISPLAY_PORT_RX_1 + 1; + dp_jack = &data->dp_jack[dp_pcm_id]; + break; default: break; } + if (dp_jack) + return qcom_snd_dp_jack_setup(rtd, dp_jack, dp_pcm_id); + return qcom_snd_wcd_jack_setup(rtd, &data->jack, &data->jack_setup); } From patchwork Thu Jun 6 10:49:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 13688526 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3B84BC25B75 for ; Thu, 6 Jun 2024 13:39:25 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 4AE5F850; Thu, 6 Jun 2024 15:39:13 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4AE5F850 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1717681163; bh=qHWlxpFKIi4ZJRKhFJ6yviYELggHBICqrfli+fF5mFU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=asA8FpqW/rgmowYmSEsCBhMX+DVEBSmIt0R8OR4nYi5gMLXmlnpof53h0CGDwOluY DbDyF7kr2sS6Zbqlt6aLCfHNLocyh2lZFnJYNSZDwpGy7urS2XoXfCGSimwamu9uok sOWewB9Am+3QqRF7W66FDIGPhUdXZ3UrTPlE1DVc= Received: by alsa1.perex.cz (Postfix, from userid 50401) id C43B8F805D7; Thu, 6 Jun 2024 15:38:38 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 717C0F805C7; Thu, 6 Jun 2024 15:38:38 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 50F3FF805B6; Thu, 6 Jun 2024 15:38:34 +0200 (CEST) Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 26943F80088 for ; Thu, 6 Jun 2024 15:38:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 26943F80088 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=DA6+OVHj Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-354be94c874so720508f8f.3 for ; Thu, 06 Jun 2024 06:38:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717681104; x=1718285904; darn=alsa-project.org; 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=YFjmjZCpuVMeVMSSZ9J5s/fgM9j+bExLlEMG9Wd+tX4=; b=DA6+OVHjzsQffD2KGOtCqvQrkDREvao62p1hJ0ASgUBbZyTbV+Bu7EIDpN3zNgI5nJ Tev4B45PATggPK+fpf1SU1ek0JT6zoh8uakcg7Di1+587nccEaIi9hjh83hIpk6Ey6XM mLmNSO5xWiubTkpU/QpuaJmjDwjAXonthffknD/d/qBMxfNHn6ebkKdncftI8fjd0l7T pFGb3LyL09PRryCnjp2wHw1m8KAKSya+YOn0ifL8sUEpp2Ws+P3YR26DKKzA8YkNyQlu gIGRT4RYGt2Pjq4UYz9OCL4EJqnr5PoaSZeH+iqJo3eyDhnlgIsSpRrgVlACyPAkdUsU Degg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717681104; x=1718285904; 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=YFjmjZCpuVMeVMSSZ9J5s/fgM9j+bExLlEMG9Wd+tX4=; b=FCYVRN/10+tKZIgv0cDK8Nn9f9o4y9mdQC/qSy5PUc9TVuit7zXjnjhNSR0Ug07gXH C9RSU8FICKbl3rwc8rVBE9XMrxehhSC4OfRLE9pL0iycLGEKpxYMP47dTfxDjtQW6Dza cGsPtKAe8mXaqbR4SQCJp327LiTLcxeKc1KzSYckpD8dywmz0o/uDCjmuKrMRpSoCCDk uWJehhUUOsQ0QAC+ZoC03LnALyU8t5p0qZy2yVXwObzCi3VmDbXiF/lzTDelIE/VJRMv VAluSlQq053uI0Eht5gZOBFEgWoSKle7ZE4ZJjgtTWrRuU0g2AcchMy0rQzpOpzlOnHy VqWw== X-Forwarded-Encrypted: i=1; AJvYcCW4Ak+Q32obrcqySDtg3WGXR0dUWNAbxcZgySvtpw6LU4zSAOpsjUsiA2Y26T1US1DFS4lniCb9TKMG1BEj4t6cB2DmjIsAhnhvSRY= X-Gm-Message-State: AOJu0Yy+RLN7bzok9yq1S0czrE1aQ7LfKWJOQcw8opODwU6pVOIMGJ2y 3K1Pnt6Xic9hQ//96qtEAqR7fj/xBVpDNnLHHwvSqBFprRMx5XfzzYgUsYvsVb5LpZWKGhfwg1t e X-Google-Smtp-Source: AGHT+IFrJTWqZqxqkmRXJjiBbTJRhM5hctfxjX7aPSnP6H7xrVvbFZndee+upzSGoOZpViZqPllHig== X-Received: by 2002:adf:f1cb:0:b0:35e:83f4:3e6c with SMTP id ffacd0b85a97d-35e84068663mr4179223f8f.1.1717670973671; Thu, 06 Jun 2024 03:49:33 -0700 (PDT) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35ef5e95bcesm1223185f8f.77.2024.06.06.03.49.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 03:49:32 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: broonie@kernel.org Cc: perex@perex.cz, lgirdwood@gmail.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, krzk+dt@kernel.org, Krzysztof Kozlowski , Srinivas Kandagatla Subject: [PATCH v3 4/4] ASoC: qcom: x1e80100: Add USB DisplayPort plug support Date: Thu, 6 Jun 2024 11:49:22 +0100 Message-Id: <20240606104922.114229-5-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240606104922.114229-1-srinivas.kandagatla@linaro.org> References: <20240606104922.114229-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1439; i=srinivas.kandagatla@linaro.org; h=from:subject; bh=aELUqEAbcStwE5eRIXyqcVJh7MVh9ydfsnLQA9m5aQM=; b=owEBbQGS/pANAwAKAXqh/VnHNFU3AcsmYgBmYZQyleYwhYg7GUGgaJK8aE6/zw2kc1Ju8QTt5 ZQIM5rziDSJATMEAAEKAB0WIQQi509axvzi9vce3Y16of1ZxzRVNwUCZmGUMgAKCRB6of1ZxzRV NwZwCACWECAUPnMVqnsYVA8kkFJLMatOnY4Uo6a5LdtFl6yj+PfWPe/zTI3ZM2H26/l2nlZ3x48 SvMA3uJZRqUeh+VXApLea7IdpznQDLzMWq3nWXSHZMoOe/xrXPAcFIm26hndm/G9h8oeqKeQ0HD AR2+GI5TWtZn9nWvTYlSi3P5BMwxMFvVsOtAu57x48GVJP+OgG1pW0nNPYPuMl0nYk2jEyN+8x6 iFRGevvk5HZF8nXiREKEtLoIG/Xz+uoKDidFhrgajnFYmVcA7/2ZqmFwEYPz7pVg6R4lfAVmkeT qhN6Pmso/nRR3bl589QsGTVrxCcu7rawXUj4j9SYCQ4YSOl7 X-Developer-Key: i=srinivas.kandagatla@linaro.org; a=openpgp; fpr=ED6472765AB36EC43B3EF97AD77E3FC0562560D6 Message-ID-Hash: MZ5UH5OXM4XYJLMJV2WG4WOWBVAOG7KP X-Message-ID-Hash: MZ5UH5OXM4XYJLMJV2WG4WOWBVAOG7KP X-MailFrom: srinivas.kandagatla@linaro.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Krzysztof Kozlowski Add support for handling jack events of USB (DisplayPort). Signed-off-by: Krzysztof Kozlowski Signed-off-by: Srinivas Kandagatla --- sound/soc/qcom/x1e80100.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/sound/soc/qcom/x1e80100.c b/sound/soc/qcom/x1e80100.c index 0e0773a85809..789d833bcd2f 100644 --- a/sound/soc/qcom/x1e80100.c +++ b/sound/soc/qcom/x1e80100.c @@ -19,12 +19,32 @@ struct x1e80100_snd_data { struct snd_soc_card *card; struct sdw_stream_runtime *sruntime[AFE_PORT_MAX]; struct snd_soc_jack jack; + struct snd_soc_jack dp_jack[8]; bool jack_setup; }; static int x1e80100_snd_init(struct snd_soc_pcm_runtime *rtd) { struct x1e80100_snd_data *data = snd_soc_card_get_drvdata(rtd->card); + struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0); + struct snd_soc_jack *dp_jack = NULL; + int dp_pcm_id = 0; + + switch (cpu_dai->id) { + case DISPLAY_PORT_RX_0: + dp_pcm_id = 0; + dp_jack = &data->dp_jack[dp_pcm_id]; + break; + case DISPLAY_PORT_RX_1 ... DISPLAY_PORT_RX_7: + dp_pcm_id = cpu_dai->id - DISPLAY_PORT_RX_1 + 1; + dp_jack = &data->dp_jack[dp_pcm_id]; + break; + default: + break; + } + + if (dp_jack) + return qcom_snd_dp_jack_setup(rtd, dp_jack, dp_pcm_id); return qcom_snd_wcd_jack_setup(rtd, &data->jack, &data->jack_setup); }