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: 13688284 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED1692E639 for ; Thu, 6 Jun 2024 10:49:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717670972; cv=none; b=JSZAaRiognLFFAQjUHGlySiyWqtkrB1/dUShLLcksCKC5W8N97PIjCrwAa5QHgC96RMlk9FT2nPcSgezGgwTMqtNjri6kASZeJUqPSAd6kPe+CoyJv6Ff8gNkjgap5Ir2PnqDEnnytP0jC0+ygB189SCGnL1MW6UkZXoMbpMtow= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717670972; c=relaxed/simple; bh=A6SXqGkyXxxcgHrEZHtDmBI/tOkvX/XnW5ssJY9STpY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qmUCI/5ZJ3DZNKgBAK/hUt/1r9NAlcFVH16b8RCdnjCf/EmQxsbbIxaf7uGukvXCdQu15tQ/mHUnSG3jJVnsjH5/f7t7itCuSm7A5r2IABmBzyjV0f8NMj7udoj11AEvvCKnXEt8jGn1W3HNgCIlZw079ordYWFdbnTwTqFL7M0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=ncFqx3Pi; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ncFqx3Pi" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-4215b0bffe1so4467705e9.0 for ; Thu, 06 Jun 2024 03:49:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717670969; x=1718275769; darn=vger.kernel.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=ncFqx3Pi+v/GVLF4h3HueB4Mg5izbr6ghey6c+x8IkhWROlJGucWpqIxCONo/yRk9p 5Y7rW6PQ52bHX666Ui1cqraW1lggKOKbwigpbK0Ly+CWNBmkQr1lXg+gj+vyXxbA8R2p 55A1jaCb5cx7sy+pG8Xn1J21JYuClBFvgIkbEYg+xzDFBSgoV+tYyFvSxVBsF3ZZehtB lFbtRk5G0eAopV0t0GfUoXloNyNPS3AkWlLO9+z0ecupcCsrrsSPkUZxsvGpBH0AqfZv oagEbVnDIrcVys8nPUMr2MQk4OuD3ik+6+nLyABro2zrxFfTmrVUGMEKC5/vgOmfAiu8 ainw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717670969; x=1718275769; 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=Z11Smg6Dl0x4SvL+q6yItFyfwJWVrDxgYXUUUUAUweu74q9OCI2BpbTzJPCPyqjmzO O0AcWTAtWRuRW8QNQJlcCbJHOVPGtNATU57ed9VKeRiGx7pX8akzskW/d63D9T0wAHVI BF8qM5Y3tHclqkSWCX2KscKqS2W5x75vfZzZCRfWC9c5rhBh7OVuRAy130+wBpUJbhOJ IHayMc5nuGDiJLbbjCUtRVUMQl69UZl1+EjmLr9NBhQVqZFeLRDFkJwNG4SYUjrbJb/r 0bnOuz7BGBRC6+n7tXuO0NNsu1vru55PuSZxCRNGIIq4R9/BSl1Aa/JVs3SOoXZiTRha JgLw== X-Forwarded-Encrypted: i=1; AJvYcCX7eNwCP+fqw7IS3+lx8d0aAUNUzBU24nHmLew9g+wey33i4VG6IsLR3yeRtotbzD4czJmONHsJmPfVu2QY0LXnlFR5RhaQvgTPmBSkXA== X-Gm-Message-State: AOJu0Yxaqvk7NNtzOVIILSui0Z57802waYcChVW1AxZPvJInumA3epGx Y4QTnSflpOgzCR1LbucHIlsNsBrccFiFD6Zohht/MsPTkKd6KgWJMFmcSCXoAmA= 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> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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: 13688285 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 61C541953A8 for ; Thu, 6 Jun 2024 10:49:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717670974; cv=none; b=W5pjFnrqdeF6WB2WYtqnhYtMjsy4Ssm35WbghBoo2IiBVT+sNFZ4joJ88aiG4egYA8HvkWNjMdL8BmrIWWyRE8BWR4vzeLy4VIJkh8MYVFbjr4yILSZxtLMTI2Cfih9EDD5bBII387FiqisZabH5Xzdr35KlJ+bM18H4a7v98Q8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717670974; c=relaxed/simple; bh=lI2Wr+WdCGDlmOKaaq/1DavWKIHY7PEWV8jOUjaMVnY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SK9IhctTHzNTOaZMarkwech7To1TtpzvZqNhBY81GHBtyp4acHR9fnIX/xtx2wYEDxDen4r1srbK4oc7rL1aBxOx9S8zlDhFUgaV8DG6C5xWjyk/Ne7/OcwscUA+V26NyqrYNmyhUKef2L5Sh9v4EwLo4qTq8m+q8KbLdfz0Gwc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=ioC6nXik; arc=none smtp.client-ip=209.85.221.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ioC6nXik" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-354be94c874so592844f8f.3 for ; Thu, 06 Jun 2024 03:49:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717670971; x=1718275771; darn=vger.kernel.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=ioC6nXikL2EWG/mvScj7D3ZA8PskI58nTszkIurzpiP4rXETB7Q3qa+BItKKDOemna iGUbYSY3y1lla1E4zhMs7Z3WY9dsXLYcEPKySHtZe0SWKBqgNNIqhp4th6XHULUWVNod MiOmwM89GRJ2UNE/RPQ1jEtdB8wqab+4Norc3rkvv/wmXM8pku1kVJ4nOKvp0Ozxn2P5 y/6WIkrbpj2DX3nphqx2kvdwUsMQTBDb08CDurI9mn8Nxe7RqLfhbCoz7Gpoyl59uly0 E8mTVgOCdLMyI2jqnF50Q5F1aEoFjMfbxNrKfKI3BvLslS0GLReN1is5PbdOMLkRm8lJ 8l1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717670971; x=1718275771; 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=LyjZHancNivgmXmNuV6cYkRuJZR5ve1hi83U/CGKHdW9HMiO3kSihJn2BAnM9n+kjk IJXKI69Of/dGGFAS6jQpmwGbdcoFL2qSrmTC6rWlDSOh9JXqTqGnBFLNC8OSa0RS684W IjveWIuoPSp18CP+KDcgEJd7SYNmwW1F7/7Z1MQD4yBlWwulU6Ikhd4kpnM6LKP9jObP 1H7ItaaWc8gW4Q/15WTzP9fWUd6yJief2qkMvl0EoXZHtCMxmDXMkGFaWD3E7GWcc2IL ElsXRw0IITK4oimd9FAXPqLRYB3iKu79Bn43byCCeYGXDXcQANgdEumu8VrGGpR9v6LU Whlw== X-Forwarded-Encrypted: i=1; AJvYcCUaQhFAjsjTQkhHjH/Cslkqu7LuDLJiJ/IWqikcBY7oFQqW0+vPMZb0EwXhgGaxZAOfLy1aaFYnRxZNzar4XOzkTcetBnWwO6Oegd+LOQ== X-Gm-Message-State: AOJu0YzWy8a4vNsDJrcQ3ySHfyKekr4zYRjjGspXTkwaU27WENH6btuv pzuJmCRWjq6e/Fe8JyIE/R7BmZ7beAkbJ6xvJDkOrGVCgGkLHqCP/u/GKwn+cLF78kdwAp024+8 4 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> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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: 13688286 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C9B8719539E for ; Thu, 6 Jun 2024 10:49:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717670975; cv=none; b=sNy0YR6rxmgjZbhlWMetMvuZ1gmDdHv3hoteyHpBT28/g996IbcyOkEVCmF1Pl5BORKnYRHlDkIFXQi8r+lJmi0+z617DBJ22EH+QkCwvOzyHuj4Upj63x390+LH40bDq43g0JVNy/lePCwfBTc6XmPI8A6sdIrNPqGyNNP+/7Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717670975; c=relaxed/simple; bh=I+6UZi7puKUhYGtPeWzvnTaY52v4RHJIizpINfnLSYM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=MjrrMI/eu1FIYy36+6gwvATk+8sfNKpbnzKotX1ObWWL0pFUIC/CT8t22IkyERcFEV0Wz/g4cAT2KLgkdK6sW2NFP2nfo/LBqWy4MbowlRKjgDf9RyhDDDA/lnZlR1TklmG8L/ZcwLSgIwNNi72QAO9/OeGXfeKZp/BfDOCg9WM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=J5y9E9Js; arc=none smtp.client-ip=209.85.221.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="J5y9E9Js" Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-354b722fe81so800466f8f.3 for ; Thu, 06 Jun 2024 03:49:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717670972; x=1718275772; darn=vger.kernel.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=J5y9E9JsW/9b5GZLkXIoSOhH8lfOvA9NOonPKiYEAO9pmhToBVACHaXBv1ZAwbKn7b 2riQsD96L9gty7tagAqQ1u1zk7iMPASWcIMocBUGGqZUTqWcprWks596VWffBz3mQyTw gelrc3W7rKgIjyWbxphu3KkzdCCfM+56DnJpY0gPViKKY6zrVzyRH6zcdB3e9D4Yi2Up 4rMExAWkWTQax6jOSNPPCW/PDfLaLjPiMIxUFMhdkSz2hYEpO9plc7mZJ+MwV9bFjiCx 1FwfIsOU5N5ms+wSoZtIy9KsIhZqJ4Z/l4Zwad7EdjvFOmw4o2zW7PtwQ1U6UJpgj4gg 1KSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717670972; x=1718275772; 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=pv72beMemQwt8cdIJc4xUImdXSle8BlRQA9cctZ08WcKF1ZYKjjxx9z6wX/kQ+eDe9 ZwRuYbmPyrpzfSJ/RL4e6KtSl+gDOCa93Qri3aSCjx9suAViH3zmSrpa0NercQegXl1x lB35rbg7DzDhePkA5lovJTneaz8zYZbxsqwF3m6KOBU9k/tINborpJNXHpedc42HPP0A PFYJIGN9fDiq8idCStaqPC567+HH2TpSOF5pkLz3oWeMOyTAiVyr3xMZPrxfvuyzmzBP 8W5FlhbMtk1eQRZD/pP8PZMXtO/FnCUXcBgvh8mbfPex8OYXT2WJo8NgfAXtmbntLJX9 Zd4w== X-Forwarded-Encrypted: i=1; AJvYcCWHMpkeD98LTFY9Pgcp0qhQDP/HbeT6vLB65fmUb3xHdkTDgZ+ix2J43XmiE7GYBs4Uc+gGAR2Bkh4BwEGk9WALQG5sLeP3JBnG7ciR9g== X-Gm-Message-State: AOJu0YyuKXmoHd7Gk9CMK2Zg0OFdIf/SErhRCW9206iOul9fhJGlG8ZG l6lD/4nUpba3azIn15c1xdpeb7wXgUgGi/RV2Looieh6IN/n3MjtvvmxNPen9JQ= 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> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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: 13688287 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 37958195812 for ; Thu, 6 Jun 2024 10:49:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717670976; cv=none; b=LwNrxiD8ct1WMa9hhZ86r0+4e7NiDxTgnYOUq1BWXY13eSFHZod2wgqmvgq8XnHQ1xArtGDV464nO1Xb1eN9ma0exC+ol+jmLJS7s66q2U2rTy+T2CTKSmDhCYz+zW8KUf3MEVzeRAC0YMKSf06sdm4wcSlFCIzVmg0kEg2R6GU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717670976; c=relaxed/simple; bh=qHWlxpFKIi4ZJRKhFJ6yviYELggHBICqrfli+fF5mFU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Dmlrg9wRJmpJRNdhkMWuAVAiVxLguCgKTk897NfQsBdhO9eyZLGI82lFi4i6W+AJ+xpy6/YZ9+9ow/5ZfaPvqCYJwdSA0nPTxF0YBYfPxYKHbP+ce9PIi03daGg3WaRF66qgSsyt6SAe62TIL01DvQY36RMqaffvVk7nc2asRlM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=TkisQcDZ; arc=none smtp.client-ip=209.85.221.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="TkisQcDZ" Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-35dc984b3d2so565063f8f.1 for ; Thu, 06 Jun 2024 03:49:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717670973; x=1718275773; darn=vger.kernel.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=TkisQcDZsl7zltFJQcgC4sKszUKGADkrskwPJXcfUq1vHaxKgYaK/G1F5TawdEJz83 FDydauRoRgeImMdMrTPfE147oC4VTs5C1EvVXhUC38VdvD8yhdhlUJtwRHDz4NKEMqNf kz/3AMS07RguBP4q5nBVLHxaB+EAPh1V2HHce6hUSCeGxAA7qYU/VWubBVjhiPXo6zBj wOKo45IU9JDvEp1jixME3GV8VE8fo/fjTY0KA90AiL1Qz0q9lmAQquiq5lTxqkqERI7m 2pMf/rTNzyyix4Oht8kdfrniX0qWsphUQKZe3emAOcny++stEsUBxQlX8gN7+e4PmnBK dG/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717670973; x=1718275773; 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=H7vjikwuKM68KDWxzQ4qtB4BUJN9aNPog1pMp8t9JuFpXNhMc6zdo/u6Q3PDzADECA tRUv4f98F4cFL178E372Mr8P0yHJ9ty/ylj6S6as2vFnriXAiHke6/tj0itQgXTuZKDK PZxa6EGibZcnGQyT0HmBPblvn6/EW9DVpBh/hWwQq8b9r1R9wblpOksDtfb+OVhy+Q8D R/KhjhX/klf7JQXgGgd3q+t+HDm9MfqbZu3t/rSQPV1hR5vM9GPgTAIjcikxM7Lj/7lc LKObqPh3B93blyNQX49CwZdCS3fPwl2gyh2edT0v92WR8/nbmptXuwsgdChKPXNQeM5E ILLg== X-Forwarded-Encrypted: i=1; AJvYcCUnKVOlB3KGE8XtpCYaABr8WDpgk2cRZ4dEdTR/3qCR+kbN4qX2LBulKymqSm75DCzSHkB2TR6OLN/SZG+ilwcm8sSX3OnUF2T57/FBng== X-Gm-Message-State: AOJu0YzoqTGE7sB+uR/NMagflD1UCRXG5Ks9XxhSTXITQZAajn6IYCpj Y2/gcHQ7CHiqTjMz8pSQGvbb7rHB/jVGtJywDfQTt88lgo8Inn5qAGk+LlFYVgymvAwwcoOpj7P 0 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> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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); }