From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=205.220.168.131 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796129315; b=kSpihF2VJl7Kkhxbvdc4yRk+MnoAJ1G4+2ZHVo/DKQdrJN48g9LuG1kQQW3XdzN4RWd2 bs4P1dSPiVBn8dTxQnEEYhCYokQQj102nDalqgc/uEObMIUX9m7g0pl+SoIakED72e6yD p+h9bxYw088VMEI2LLvru+P3cxk3dNOURwfx7xvzL7jtFor8iGwTQ5DDQkpdrigZQI5TB HihJQ0ng9B2I9jt+8na5Vlp9DQco0FMUDubt0sqbcNRX+DV/pBWyn4yH4FoYT26DLYZeg grgl2FWs9OffV7wa6hAbO7cR3boLc2I+uHVqeAqfI2tO+aRNHuSC6dVNrxt12IjQ0Jg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796129315; h=DMARC-Filter:Received:DKIM-Signature:Received:Received: DKIM-Signature:X-Google-DKIM-Signature:X-Forwarded-Encrypted: X-Gm-Message-State:X-Gm-Gg:X-Received:X-Received:Received:From:To:Cc: Subject:Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:X-Proofpoint-ORIG-GUID:X-Proofpoint-GUID: X-Proofpoint-Spam-Details-Enc:X-Proofpoint-Spam-Info: X-Authority-Analysis:X-Proofpoint-Virus-Version: X-Proofpoint-Spam-Details; bh=2/sjUyl3AjOqVtUlPY2RbAu/Wi14boF7Nv6tjUsPmAs=; b=iKUNog1L/ER4tpKBuDW+guIo0M9th6KgDbZgs3rsi+xvkPS0JVfmourQxb7GFmMwxyza lt1S8AHzOSueDwp50nWMJHQIcDBBrJ6D1upEQY73+poQPkfLzjD++epGl1DwSBNZJfTBz I1wfT+7BBHUr7tWCdRb7yDMG9VBFcq1cwSB5DmZW79Qqo+Dl3VM/ljlVmPWBi20b3HNxn 0EWjUMdiQFoaszu7VaXrqOV/z31zKftGnV/oookBJq8WpUT6oqbcBT7fbt1tqhog3WOUV 57iTDQIKMvp6sJgww+KwfktkdbwqxFNohQrVNP9/T3PUtaXBh1rGN6AIpCmSuvhNz7g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=oNg+tD27; dkim=pass header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=dmy9jbkk; arc=none smtp.remote-ip=205.220.168.131 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 67455606BBF6 for ; Tue, 1 Dec 2026 12:48:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 67455606BBF6 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=oNg+tD27; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=dmy9jbkk Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B1AQAA63856975 for ; Tue, 1 Dec 2026 12:48:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=2/sjUyl3AjO qVtUlPY2RbAu/Wi14boF7Nv6tjUsPmAs=; b=oNg+tD27bWc1oV5swErBYoiZPyf GaxfLmQ8xXDUAEgBtFrpAho49sMD6VON/VyDK2BmlXmHYTC1sACQbiCLBOIVxHuk CZGnnyAITKtRk6yZjQ4oNnmlhIe/uEci2ROdZH/XJEusNfHiQDnyka5y/6O6l5X7 1kJJyj2kmUWVQYPCnx4a6BGmqNFp56uI+na5caq/3vlXsmb8oU/tSHa6+cV/c20/ b162Y8PkyWCKvl1qommWY0iP61XSoPKgvKZ2WkhOMKcNcAoNMY7wl/UsPLu0kw+7 IP10iSxi9p1o5VcXy2+8Ym3s/MYYAzLq54RPhT8jxk9j+ecIGZi69dPvXjQ== Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4j9tng14mq-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 01 Dec 2026 12:48:34 +0000 (GMT) Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-94960bd17b5so1783300085a.0 for ; Tue, 01 Dec 2026 04:48:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1796129313; x=1796734113; 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:content-type; bh=2/sjUyl3AjOqVtUlPY2RbAu/Wi14boF7Nv6tjUsPmAs=; b=dmy9jbkkKBQoKtPG9kMWSr9loi/bb4G1uyl1CZM35l1/j9H33YLweN7ysw3njBoVCV L+FAuDAdzHnKWKRdIl5FTtia9B+3iUjBsBXED+LEk/OpLuVowJKYqwvW+8AN0PwGXHMZ B8tZNikXw/EwfeL+3NhCIdzz4v9sigYXIgsokgg4YhNON2uqdJfKlQe8m0vyLYSWgnyD envx83/75l7DrgABV9hrGVY3003seRj0dv0pm5jn3MvexqzUGC0eMxpxktLIufYZoj6l bpdx8KZxICOWCNZjHiQykhmnM768jH8Xa3EMFw8lxHIPVkRsvMkWldFvMU3hL3GIrdp8 4lBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796129313; x=1796734113; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=2/sjUyl3AjOqVtUlPY2RbAu/Wi14boF7Nv6tjUsPmAs=; b=Vy2Roa5ym10SIwDU6LX97HnnLhlu+/Milnc7ZKQpz2eauKUgDMRhl1MbAtUPdPZFHm CSSLgsZUMt6XUKfh2Jy+tih+ykgebFkFo0NkeJzD904Hcnu6l0cdteyuTdtxQ81fHtJy 8XOASELpbgcKo9pLupDafMomMWTNA+n4p64zQ1SGFVUK/LD9pYW7xc7GVRYqcwp5GLz0 CIjgLfFGvZU27SkSTMBPfe6UToCPPdOuGhGZj86rLrMCXpgN/2hTN16ijbe+Po43NYl0 NxvM7EvLOlDxcxXjITYHbwpLFYZA8RhVa/TKuJVDAtkSubQxaNkzLho2V3gpdEes1K+7 8EYg== X-Forwarded-Encrypted: i=1; AL+hErFMxunKbT7/HGLTfkrGrFlkN3x72SF3dsoVDM/nmeqbzDH0P3boT6Qal+jq45MEsFqQ4BvAZttAGlmZnGk=@vger.kernel.org X-Gm-Message-State: APuU4Z/WL2BMsDqpfdnhB+mlGD4+yUvKtJF0rr6hLCl88uCI3ZWV6vyo C6OLMzcVfLph5e+9af0y3ZtjomHyf6flP1AtUoL3UJFiEVNysC/JPMKqXdRUukLmoQz3l2SL+hb g2SFl0vk/ayjU+8pMDD9JKGcSSXwOH1gI15rENDbiCa5QTVl6scXIt/2DjV1xBX0O2sA= X-Gm-Gg: AZFdTZdY0/tfq1t24piwldNiVL5/JQaV6PqigSOvTRQmSlZJJo3Rnvzm/4axzmmWWNK oQeLxGkk5MxJ815cNbFaZOOfL1ML6Uaw2oXeHWC4tJDTy89ta5uBkJULOB2BNdRixIcuPurgyOy CuGPbF23eb36v7TZQBiK7f5G3FIWUElqcWDTDyDMa89I5BTbOMOMaDXoPVlK32lHM9JuGCjQKlp zsIRuJC/rUL6MtwZx69k4LbaruqgHx8Q5stdRm518xhJMbBQMIDwqjuPpCifEPnjU4BQWXhEo+a fSSmtBnzW5/Szuyn98A5/O8n/UeG9fVI4MIIYCeVD9M5j8xbQcweorBrxF0+hMcKE0o6PxZn0ko bwoF/SL8IalMSdzLiAbb67mTSI2hB7DgOpHHZbcRGw+NZUVUXdemPjXkkGe3fj4rn X-Received: by 2002:a05:620a:6493:b0:940:e34a:aead with SMTP id af79cd13be357-949ba80fa2fmr6222581685a.5.1796129313397; Tue, 01 Dec 2026 04:48:33 -0800 (PST) X-Received: by 2002:a05:620a:6493:b0:940:e34a:aead with SMTP id af79cd13be357-949ba80fa2fmr6222576885a.5.1796129312843; Tue, 01 Dec 2026 04:48:32 -0800 (PST) Received: from debian ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb853a9687sm1131892375e9.10.2026.12.01.04.48.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 04:48:32 -0800 (PST) From: Srinivas Kandagatla To: Mark Brown Cc: Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Kuninori Morimoto , Pierre-Louis Bossart , Bjorn Andersson , Konrad Dybcio , Abel Vesa , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jonathan Corbet , Randy Dunlap , Shuah Khan , linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla , kernel test robot Subject: [PATCH v4 18/24] ASoC: qcom: audioreach: add live speaker temperature (T0) readback Date: Tue, 1 Dec 2026 12:47:47 +0000 Message-ID: <20261201124753.196748-19-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261201124753.196748-1-srinivas.kandagatla@oss.qualcomm.com> References: <20261201124753.196748-1-srinivas.kandagatla@oss.qualcomm.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-ORIG-GUID: jI6vdtQ15OLwGeUXWoKSMvKUsBxlZ_60 X-Proofpoint-GUID: jI6vdtQ15OLwGeUXWoKSMvKUsBxlZ_60 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAxMDA1MCBTYWx0ZWRfX8a8z0jYbZeoK E5NZ8rbythaU4D/MTWk2VlmOolR8M241t23miTIYIR7pQMUhmnfRX5qnBahakxopW2d10NSEHSK r7J9ULUsyUz0YeulEiXUaiUBRNbGG1ZFQZClSTlJNE5JuUazEwEjZQnUvISObuLbYi4k5Lgn1iQ KZibaTiMkg1TNszpRJuuAztdtImpOXZfWIE0lWs+UwgKVIa6UNYertVhzLzdsBlk9ovqC0nblDR 5f5E08jhtkeODnnCkCjSwbPWSt5lj53iNy1OJiFHrpRXl6x2ge5gEvMQWGCaLWF7JYbIN9YUvxR hw8+049nm5Ca7obyGI32cGH5D1MTK3EJAfY9Fnq31KaPmm/c472HOj4okW7UTf15OPfVx8Y7Xo+ NEOU4dNtDzAPvLl7nJyPXmka0XS0NiI4mIG61F32c1a0lTN+PU4dvb7brvr9X+T8Ah9UQlMl4xd cTxiGsP21RmpPCG/mDQ== X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAxMDA1MCBTYWx0ZWRfX5drv90zA6f0k MWYFkK+TxbCxxF72NkBu9UajsgeCjo71RgesqjLmZBRgEHSNVIa7Xb6rSN4Cv67LEc/W4y9lkaw M0G8GcgjKhhOBffFMznWBVGgBSjowc8= X-Authority-Analysis: v=2.4 cv=O5ysLx9W c=1 sm=1 tr=0 ts=6b0ec222 cx=c_pps a=50t2pK5VMbmlHzFWWp8p/g==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=pUM-KoujPXoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=VwQbUJbxAAAA:8 a=QyXUC8HyAAAA:8 a=EUspDBNiAAAA:8 a=jt9GbcDmORiCJNAdx5sA:9 a=IoWCM6iH3mJn3m4BftBB:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-12-01_02,2026-11-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 phishscore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 adultscore=0 impostorscore=0 spamscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612010050 A calibration needs each speaker's die temperature when R0 is measured, so that the R0/T0 pair given back to the DSP is consistent. Let the machine driver register the speakers' thermal zones in VI channel order with audioreach_sp_register_speaker_map(), and expose their temperatures in Q6 format as a read-only "Speaker Protection T0" control. Record T0 with R0 when a calibration completes. A slot that cannot be read reports 0. Signed-off-by: Srinivas Kandagatla Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202611231947.lq10qE2P-lkp@intel.com/ --- sound/soc/qcom/qdsp6/audioreach.c | 66 ++++++++++++++++++++++++++++++- sound/soc/qcom/qdsp6/audioreach.h | 5 +++ sound/soc/qcom/qdsp6/q6apm-dai.c | 7 ++++ sound/soc/qcom/qdsp6/topology.c | 41 +++++++++++++++++++ 4 files changed, 117 insertions(+), 2 deletions(-) diff --git a/sound/soc/qcom/qdsp6/audioreach.c b/sound/soc/qcom/qdsp6/audioreach.c index 42e542f30591..3974191f9c53 100644 --- a/sound/soc/qcom/qdsp6/audioreach.c +++ b/sound/soc/qcom/qdsp6/audioreach.c @@ -2,9 +2,11 @@ // Copyright (c) 2020, Linaro Limited #include +#include #include #include #include +#include #include #include #include @@ -44,6 +46,13 @@ struct sp_vi_r0t0_cfg { static struct sp_vi_r0t0_cfg sp_vi_r0t0_cfg; static DEFINE_MUTEX(sp_vi_r0t0_cfg_lock); +/* Speakers' thermal zones in VI channel order, set by the machine driver */ +static struct { + struct thermal_zone_device *tz[MAX_SP_VI_SPEAKERS]; + unsigned int num; +} sp_speaker_map; +static DEFINE_MUTEX(sp_speaker_map_lock); + /* SubGraph Config */ struct apm_sub_graph_data { struct apm_sub_graph_cfg sub_graph_cfg; @@ -1579,6 +1588,50 @@ void audioreach_get_sp_vi_r0t0(long *vals, unsigned int count) } } +int audioreach_sp_register_speaker_map(struct thermal_zone_device * const *tzs, + unsigned int num) +{ + unsigned int i; + + if (num > MAX_SP_VI_SPEAKERS) + return -EINVAL; + + guard(mutex)(&sp_speaker_map_lock); + + for (i = 0; i < num; i++) + sp_speaker_map.tz[i] = tzs[i]; + for (; i < MAX_SP_VI_SPEAKERS; i++) + sp_speaker_map.tz[i] = NULL; + sp_speaker_map.num = num; + + return 0; +} +EXPORT_SYMBOL_GPL(audioreach_sp_register_speaker_map); + +/* Read each speaker's T0 in Q6 (degC * 64), 0 if its zone cannot be read */ +int audioreach_get_sp_vi_t0(long *vals, unsigned int count) +{ + unsigned int i, n; + + guard(mutex)(&sp_speaker_map_lock); + + n = min(count, sp_speaker_map.num); + for (i = 0; i < n; i++) { + int mdeg; + + if (sp_speaker_map.tz[i] && + !thermal_zone_get_temp(sp_speaker_map.tz[i], &mdeg)) + vals[i] = div_s64((s64)mdeg * 64, 1000); + else + vals[i] = 0; + } + for (; i < count; i++) + vals[i] = 0; + + return n; +} +EXPORT_SYMBOL_GPL(audioreach_get_sp_vi_t0); + int audioreach_set_sp_vi_r0t0(struct device *dev, const long *vals, unsigned int count) { struct sp_vi_r0t0_cfg new = {}; @@ -1644,6 +1697,7 @@ void audioreach_vi_calibration_event(struct device *dev, const struct event_id_vi_per_spkr_calibration *cali, u32 num_ch) { + long t0_live[MAX_SP_VI_SPEAKERS]; bool decisive = true; bool success = true; unsigned int i; @@ -1704,12 +1758,20 @@ void audioreach_vi_calibration_event(struct device *dev, i, r0_int, r0_frac, sp_vi_r0.r0_cali_q24[i]); } - /* Only a run where every speaker succeeded gives a usable R0/T0 set */ + /* + * Only a run where every speaker succeeded gives a usable R0/T0 set. + * The DSP reports only R0, so pair it with the speakers' last T0 + * reading; a zone that cannot be read gives T0 = 0. + */ if (success) { + audioreach_get_sp_vi_t0(t0_live, num_ch); + guard(mutex)(&sp_vi_r0t0_cfg_lock); sp_vi_r0t0_cfg.num_ch = num_ch; - for (i = 0; i < num_ch; i++) + for (i = 0; i < num_ch; i++) { sp_vi_r0t0_cfg.r0_cali_q24[i] = cali->cali_param[i].r0_cali_q24; + sp_vi_r0t0_cfg.t0_cali_q6[i] = (s16)t0_live[i]; + } } dev_info(dev, "VI calibration complete: %s\n", success ? "success" : "failed"); diff --git a/sound/soc/qcom/qdsp6/audioreach.h b/sound/soc/qcom/qdsp6/audioreach.h index 1a79d51e4ea0..2136075d0e87 100644 --- a/sound/soc/qcom/qdsp6/audioreach.h +++ b/sound/soc/qcom/qdsp6/audioreach.h @@ -9,6 +9,7 @@ #include "q6dsp-common.h" struct q6apm; struct q6apm_graph; +struct thermal_zone_device; /* Module IDs */ #define MODULE_ID_WR_SHARED_MEM_EP 0x07001000 @@ -1136,6 +1137,10 @@ u32 audioreach_get_sp_operation_mode(void); int audioreach_trigger_sp_calibration(void); void audioreach_get_sp_vi_r0t0(long *vals, unsigned int count); int audioreach_set_sp_vi_r0t0(struct device *dev, const long *vals, unsigned int count); +int audioreach_sp_register_speaker_map(struct thermal_zone_device * const *tzs, + unsigned int num); +int audioreach_get_sp_vi_t0(long *vals, unsigned int count); +int audioreach_add_sp_telemetry_controls(struct snd_soc_component *component); void audioreach_vi_calibration_event(struct device *dev, const struct event_id_vi_per_spkr_calibration *cali, u32 num_ch); diff --git a/sound/soc/qcom/qdsp6/q6apm-dai.c b/sound/soc/qcom/qdsp6/q6apm-dai.c index f7ac0b455b2d..c9edcc8c72ad 100644 --- a/sound/soc/qcom/qdsp6/q6apm-dai.c +++ b/sound/soc/qcom/qdsp6/q6apm-dai.c @@ -20,6 +20,7 @@ #include #include #include +#include "audioreach.h" #include "q6apm.h" #include "q6dsp-common.h" @@ -1328,8 +1329,14 @@ static const struct snd_compress_ops q6apm_dai_compress_ops = { .copy = q6apm_compr_copy, }; +static int q6apm_dai_component_probe(struct snd_soc_component *component) +{ + return audioreach_add_sp_telemetry_controls(component); +} + static const struct snd_soc_component_driver q6apm_fe_dai_component = { .name = DRV_NAME, + .probe = q6apm_dai_component_probe, .open = q6apm_dai_open, .close = q6apm_dai_close, .prepare = q6apm_dai_prepare, diff --git a/sound/soc/qcom/qdsp6/topology.c b/sound/soc/qcom/qdsp6/topology.c index f9a3e9cf4119..a8fdd73cdecd 100644 --- a/sound/soc/qcom/qdsp6/topology.c +++ b/sound/soc/qcom/qdsp6/topology.c @@ -1527,6 +1527,47 @@ static int audioreach_put_sp_r0t0(struct snd_kcontrol *kcontrol, return 1; } +/* Live T0 per speaker in Q6 (degC * 64), 0 if it cannot be read */ +static int audioreach_info_sp_t0(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_info *uinfo) +{ + uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; + uinfo->count = MAX_SP_VI_SPEAKERS; + uinfo->value.integer.min = S32_MIN; + uinfo->value.integer.max = S32_MAX; + + return 0; +} + +static int audioreach_get_sp_t0(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + audioreach_get_sp_vi_t0(ucontrol->value.integer.value, + MAX_SP_VI_SPEAKERS); + + return 0; +} + +static const struct snd_kcontrol_new audioreach_sp_telemetry_controls[] = { + { + .iface = SNDRV_CTL_ELEM_IFACE_MIXER, + .name = "Speaker Protection T0", + .access = SNDRV_CTL_ELEM_ACCESS_READ | + SNDRV_CTL_ELEM_ACCESS_VOLATILE, + .info = audioreach_info_sp_t0, + .get = audioreach_get_sp_t0, + }, +}; + +/* Kept apart from the topology SP controls, so FEs have them without it */ +int audioreach_add_sp_telemetry_controls(struct snd_soc_component *component) +{ + return snd_soc_add_component_controls(component, + audioreach_sp_telemetry_controls, + ARRAY_SIZE(audioreach_sp_telemetry_controls)); +} +EXPORT_SYMBOL_GPL(audioreach_add_sp_telemetry_controls); + static int audioreach_control_load_mix(struct snd_soc_component *scomp, struct snd_ar_control *scontrol, struct snd_kcontrol_new *kc, -- 2.53.0