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=1796073793; b=t6jALZPys+4FtbDI6L8i6xPWXMhPxo/2umZKL/VS5nIMnRRbqxJgTAm3FCZzI1Co4DGy KmRilGvDdldykYQSxvUi2uoFp6Fw8A9lQzmZYAgvmFro577duusNijmOklcWsmm1A3/3t 0RVFDhDGNLW+OUxr4gJ7ephQyAWFbills/SqPc6kzuo1JtUoDKO/4QoWwgtDWmXLSc/Bn A89LhGLIs0A1KcZYlFTeYPFSRXgcicCGik6INwtpfqpHd6YIUnyA1GOp/u4HapIoD44yQ RvR65top5eEGBS9rnVw8ufCq+0ZRGM6pKGDfNKt5NiWIm1cWUsydz1W/LCEm+KBPIHA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796073793; 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:MIME-Version: Content-Transfer-Encoding:X-Proofpoint-Spam-Info:X-Authority-Analysis: X-Proofpoint-ORIG-GUID:X-Proofpoint-GUID: X-Proofpoint-Spam-Details-Enc:X-Proofpoint-Virus-Version: X-Proofpoint-Spam-Details; bh=GV9X5UkoMMS+pRZ+lAoRN3a1UfU9tVsiabO4nQe/9dA=; b=rdXKYzHI3zJYLM98is4suhyGhTZSumUrzlqACiA47J2DZWBV0lwezX06GUguYnhCfh1R 258UzOSP7QzEhTby4IzEfQ1TBkdLmg3bsaAMW8l+CGQBt26B3ogcFRgIvMGSria3HAkhA 4zLMcY5hyUvnWwkj8sfuSzeSD+tLohuzJX4sw0RoIjcrZZLtoKSYUGfvPLNoXqusiS4tw rF5QPfGd6S0Q61DYZ6k1D7GNlbB4iHVJWNxuygIkWHXmGvVgM7w22wJFmuD82JMYrJiZO 5p1o9PlYAYxOqTFOUB529So0y2Qh/KyrSHl/vQrNy42wpzgS58voOZrhOpyi+qzkT7Q== 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=ezkQE6c9; dkim=pass header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=OO7XCHpk; 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 CE752606A320 for ; Mon, 30 Nov 2026 21:23:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org CE752606A320 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=ezkQE6c9; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=OO7XCHpk Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6AUKQf053186964 for ; Mon, 30 Nov 2026 21:23:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:message-id:mime-version :subject:to; s=qcppdkim1; bh=GV9X5UkoMMS+pRZ+lAoRN3a1UfU9tVsiabO 4nQe/9dA=; b=ezkQE6c9CBIENlnpYfxVOFq25Z+AORBG7j17PMO6hPWO+x0KwU0 e2Y3ueh6ycTtJedfvuwn6xCk25yERs2CqFSyfUmqfaM/c2ybK811drYwv7tTQ+0O lbcDBS1iDFHPwmyx7BNQputqJInwJ6uvUGo1eEgHr392KiJtc0WMWsWEfa2SPNOo yqIUc35UU8WqkW72EUI0N08rm5HFLrFPa9zO4WZC7Qat0K41dWvA2pv3cY4Ukesg AUiM1Ni9mhbMLXtblsdeSjRDISTdViEGw7ppDvFjTvAQJY1Qq3zjLiJEN0mHWaLc LaGzaRHHrEK2adaN9cSrLCUG1WUo5tO0NQQ== Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4j94wfu9s6-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 30 Nov 2026 21:23:11 +0000 (GMT) Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-92106c98714so205189686d6.3 for ; Mon, 30 Nov 2026 13:23:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1796073791; x=1796678591; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=GV9X5UkoMMS+pRZ+lAoRN3a1UfU9tVsiabO4nQe/9dA=; b=OO7XCHpkSG+/BYeUQByi0FLOJn9UraasnkFKxyhm46VoZSoMyjDcQ5BhOPTmtrxq1n 8SVmR/Ei0/596AAcQuGE4hUtuZB4KHiQBfFVeRdy3+uCWsrqMbrknnT9ruiMma3FJs3y pb54b+wfuUTS8jciA2B6dIRlj63YMXbAjiOO3f+byergHGBcsY/Dt4dlreK3cJmltcKX kZiv6oZN4pZ/SJFcZ8NJoxuibInN4nDSGgWYzrEE3NF1M5+x4AqDW5IjK3AV7F+yDR+f cCZpQf9UUYmU8FyQS6xRfG2OHFhC1Z7RWNBWqDqc4GwrY2+IJmqS+KKUCpM80qVKZ3JT oQvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796073791; x=1796678591; h=content-transfer-encoding:mime-version: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=GV9X5UkoMMS+pRZ+lAoRN3a1UfU9tVsiabO4nQe/9dA=; b=KjvKJFyO7wydv2otm6xydyTl01qlcD8QBJfvDwGnDxNPwIACO7jPEFKQQZI3KYtS6X B3w7/n8PXy2LqwubeN3gnxJYYolQOLNGCDgjrjecyZHF76A+kgjCDshX4qoZoN9rMUF1 JE4wllE03sNz/4KhpoShbaJd1GmLGlPWBHciZGHAEewkM7MwPAUCPGCpG7Lu1ZFMwUZJ ARYOPY84i/r0IBQF3kr7BukufekiL7Q8R90SV+7hQrUUfh4qIvCTZ4TD8/4kENdEM4hM 90tAGk9CqRQRS1FHEmosZW1RAWo56auF1HEW3CuO23rLsoUirTo+w8XccT0Lfczeo80J rguA== X-Forwarded-Encrypted: i=1; AL+hErGWNMJhkxHnKvymfFHMM56vnKHI93IeUS7gHfpQflfWjjuZwhDIo1w77eBX/frP8ci6wLjlqnp46B6OFSI=@vger.kernel.org X-Gm-Message-State: APuU4Z8Kru7HQgAuSFHx9OBxWTK+SrMd8TExbaLaPZ9BNlN2OYnRKGnF NaYX06H0vrNhaPCtxWTO/kmP5khckUoTysephpulIYZ3YABPIYh5Va1JXlwc4gUoTkkUJ02r0T8 A1hgzvPxnLbY0miWtDaF+i/0HMR7cWGUxgn4b0Yrtjfj0BW7C0e/a6WiltdMYdKxUH0U= X-Gm-Gg: AZFdTZe42aC54W47Zkll7Lgu9k4f4Lm6wi/H6ktumYIwn7WN76+SuP2+TBmbxpcMQf2 zf/M0OYg6hytrUgz0YxAonB/9ndkjHk/k+sxqb0j/Wup4cm/1rXMgdYLKx/MKPmaZqhyr66cKug KcYHX22CUTW9Bp04516qZtzPnZtib7vrxf92u5fKG5ZglpJwH0ttydzPsyYmF9jkRI749UvNPZu Ib5LIisa1Twpq/5VW4DgNPmdXC6q4WSZ2zuABBOx0kd/O/jukjd23igLjwqDGFONewDhHDjWKdL rQiC2SYbq+vTI8CtBwsal3AaWpsL5nA93puDnqeDZsbMWFF1SfpTwEsQM1bPNs/qUphbal/0M8D irteo6J/ciQRrEJcDoPeVtyENbGFjhizXRj7vwYRNOOFr7UgFbbxAhtj0LgZafHlj X-Received: by 2002:a05:620a:8702:10b0:94a:168:aa94 with SMTP id af79cd13be357-94a0168ade2mr2736198985a.19.1796073790408; Mon, 30 Nov 2026 13:23:10 -0800 (PST) X-Received: by 2002:a05:620a:8702:10b0:94a:168:aa94 with SMTP id af79cd13be357-94a0168ade2mr2736195385a.19.1796073789929; Mon, 30 Nov 2026 13:23:09 -0800 (PST) Received: from debian ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb88402ce9sm792580515e9.0.2026.11.30.13.23.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 13:23:09 -0800 (PST) From: Srinivas Kandagatla To: Mark Brown Cc: Srinivas Kandagatla , Ravi Hothi , Jaroslav Kysela , Liam Girdwood , Takashi Iwai , Pierre-Louis Bossart , Kuninori Morimoto , Bjorn Andersson , Konrad Dybcio , Abel Vesa , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 00/24] ASoC: qcom: AudioReach Active speaker protection for WSA88xx Date: Mon, 30 Nov 2026 21:22:34 +0000 Message-ID: <20261130212258.7376-1-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 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-Spam-Info: AW1haW4tMjYxMTMwMDA4NiBTYWx0ZWRfX610a+sFS+wPl nJ5aSx5AX3USJmZrW8IKACx3bodFghJCOASugSgi7T1DhkPJlHKaGA7se/SzWctPrepXCRuSn6u CJrgl1lVCBGaew5jFyRHr97+6+pohCw= X-Authority-Analysis: v=2.4 cv=BZ1NQbt2 c=1 sm=1 tr=0 ts=6b0de93f cx=c_pps a=wEM5vcRIz55oU/E2lInRtA==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=zJRp6_cAMcgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_K5XuSEh1TEqbUxoQ0s3:22 a=NEAV23lmAAAA:8 a=olLT7kOCJqeWAwkjLx4A:9 a=OIgjcC2v60KrkQgK7BGD:22 X-Proofpoint-ORIG-GUID: pLvHj0oRbGpFAZAaJwHDUbh18__wLQxu X-Proofpoint-GUID: pLvHj0oRbGpFAZAaJwHDUbh18__wLQxu X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMTMwMDA4NiBTYWx0ZWRfXwHnKBXcFcMtO iGSGGZuzvVH+sJAamj7iq4KToD582MYMy0Egr/INiKcksoo3eVZFBGXO1iQpbfU/5KdOTurLM2W JwV+WJ+RTSlfdogVrlrf22l6aJKWr5Uo+BF/tW0qahmHbaPDmUBh7cvhU8k0rZCqm+tfzxoQPBI CYf05dHesRmN1DCrDQereGbyB+LMzhlKGBqpotUw3C9l6u3sIxGGH40DcfdHKY6v3sG/Ni1f8BU +bGwU/EUEBsmzkNP7K/qoTB3N2/350JbFuX9piZnFE4Njg2oZEvnBdkTNZbEq0VZYH6D/VqIae4 a8hdipaS0nRKJMnU5R9JM4OOk8iZwt5sH3tYyYSWZIH9GzfyrM1tBtIRUws+JF6w+gECgzg2Tlz CK8ZD7Cw1hRGzWQrPWR/8Lt1qA9plZRmTKo5uc0boxu+dSqlGR5fvVyttY+UoJJarn37Xf9c5dV ZlyUmQ7QjNKwVy6QNsQ== 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-11-30_05,2026-11-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 priorityscore=1501 suspectscore=0 phishscore=0 bulkscore=0 malwarescore=0 impostorscore=0 clxscore=1015 spamscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2611300086 This series adds DSP Active speaker protection (SP) for WSA88xx speakers on Qualcomm AudioReach platforms. It was tested on the Lenovo ThinkPad T14s Gen 6 (2x WSA8845), T14s Gen 7 (2x WSA8845) and the Glymur CRD (4x WSA8845). Speaker protection needs the amplifiers' V/I sense capture running whenever the speakers play. Rather than a separate capture link that userspace has to keep open, the VI codec DAIs sit on the WSA Playback BE link, using a new multi_direction codec-codec link flag that makes the core run .hw_params/.hw_free and stream events for codec DAIs of the other direction. The V/I data never reaches userspace: the capture codec DAIs power up their SoundWire capture ports and feed the DSP through a codec-to-codec control link in the topology (the SP_VI module). The per-direction SoundWire stream runtime needed to configure those capture ports is added by the qcom sdw patch. - ASoC core: bump the default ch_map cap to 18 (the WSA Playback link on glymur-crd has 18 codec DAIs), and add the multi_direction_codecs link flag (documented). - qcom sdw: per-direction stream runtimes on such links. - wsa883x/wsa884x: VI sense capture DAI, die temperature as a thermal zone. - AudioReach: control links, VI calibration run with per-speaker events, R0/T0 cache and restore in normal mode, static cfg blobs, mixer controls for status/R0T0/live T0/calibration state, and a "Speaker Protection Calibrate" trigger to arm a run. - x1e80100: VI feedback on the WSA Playback link, speaker thermal zones. - DT: VI feedback for glymur-crd, mahua-t14s (Gen 7) and x1e78100-t14s (Gen 6). A topology with the SP and SP_VI modules is needed to use it. How it works: 1. The topology puts the speaker protection (SP) module in the playback graph and the SP_VI module in a VI feedback graph fed by the WSA VI sense ports, joined by a control link. 2. Starting playback on the WSA Playback link also starts the VI sense capture (8 kHz, 32-bit, one V/I pair per speaker), so the DSP always gets feedback while the speakers play. 3. Calibration, once per device with the speakers cold: userspace writes "Speaker Protection Calibrate" and plays silence; the DSP makes its own stimulus. The VI module measures each speaker's resistance (R0), the driver records the amplifier die temperature (T0) with it, and "Speaker Protection Calibration State" reports the result. The mode auto-returns to Normal on terminal state or graph abort. 4. Userspace reads R0/T0 from "Speaker Protection R0T0" and saves them, e.g. with alsactl store. 5. At boot the saved values are written back (alsactl restore). In Normal mode the driver sends R0/T0 to the VI module, and the SP module uses the live V/I feedback to keep each speaker within its temperature and excursion limits. Changes in v3: - patch 01: replace the devm "always allocate default ch_maps" rework with a simple bump of MAX_DEFAULT_CH_MAP_SIZE from 12 to 18, per Morimoto-san's suggestion that the cap is just a placeholder and should be grown when needed. 18 is the exact width needed by the glymur-crd WSA Playback link. - patch 02: expand commit message to explain that V/I feedback never reaches userspace; the capture codec DAIs power up their SoundWire ports and feed the DSP via a codec-to-codec control link, and the per-direction SoundWire stream runtime is added by the next qcom sdw patch (addressing Pierre-Louis' review). - patch 08: drop const from wsa884x_tz_ops to match the thermal_tripless_zone_device_register() signature on configs where it is not const (kernel test robot). - patch 18: use div_s64() for the Q6 temperature conversion so the module builds on 32-bit arches without __divdi3 (kernel test robot). - DT patches 22-24: pick up Abel Vesa's Reviewed-by. - Rebased onto next-20261130; no other code changes. - there was a discussion with Pierre about introducing new multi-directional soundwire stream apis, I will send that framwork change as RFC for more discussions, I dont think we should block this series for that api to evolve. Tool use: an LLM coding assistant (Claude Code with Claude Opus) was used for some of the patches in this series, to debug the bring-up and to draft the code and commit messages. My wip trees (kernel, topology, ucm): https://github.com/Srinivas-Kandagatla/linux/tree/glymur https://github.com/Srinivas-Kandagatla/audioreach-topology/tree/glymur https://github.com/Srinivas-Kandagatla/alsa-ucm-conf/tree/glymur Ravi Hothi (11): ASoC: dt-bindings: qcom,wsa8840: allow one sound DAI cell ASoC: codecs: wsa884x: add VI sense capture DAI ASoC: codecs: wsa883x: add VI sense capture DAI ASoC: qcom: audioreach: run VI module in calibration mode with per-speaker events ASoC: qcom: q6apm-dai: add S32_LE format support ASoC: qcom: audioreach: cache VI calibration results per speaker ASoC: qcom: audioreach: add speaker protection calibration trigger infrastructure ASoC: qcom: audioreach: send cached R0/T0 to the VI module in normal mode ASoC: qcom: audioreach: send static cfg blobs to speaker protection modules ASoC: qcom: audioreach: add speaker protection mixer controls arm64: dts: qcom: glymur-crd: add WSA speaker protection VI feedback Srinivas Kandagatla (13): ASoC: soc-core: bump MAX_DEFAULT_CH_MAP_SIZE to 18 ASoC: soc-pcm: add multi_direction_codecs link flag ASoC: soc-dai: export snd_soc_dai_stream_valid ASoC: qcom: sdw: add per-direction stream runtimes for multi_direction links ASoC: codecs: wsa884x: register the die temperature as a thermal zone ASoC: qcom: audioreach: add control link support to graphs ASoC: qcom: audioreach: pin SPEAKER_PROTECTION_VI media format ASoC: qcom: audioreach: add live speaker temperature (T0) readback ASoC: qcom: audioreach: add speaker protection calibration state control ASoC: qcom: x1e80100: carry WSA VI feedback on the WSA Playback BE link ASoC: qcom: x1e80100: register WSA speaker thermal zones for speaker protection arm64: dts: qcom: mahua-t14s: add WSA speaker protection VI feedback arm64: dts: qcom: x1e78100-t14s: add WSA speaker protection VI feedback .../bindings/sound/qcom,wsa8840.yaml | 5 +- Documentation/sound/soc/index.rst | 1 + .../sound/soc/multi-direction-codecs.rst | 156 ++++ arch/arm64/boot/dts/qcom/glymur-crd.dtsi | 20 +- .../mahua-lenovo-thinkpad-t14s-gen7-lcd.dts | 11 +- .../qcom/x1e78100-lenovo-thinkpad-t14s.dtsi | 18 +- include/sound/soc-dapm.h | 2 + include/sound/soc.h | 7 + include/uapi/sound/snd_ar_tokens.h | 13 + sound/soc/codecs/wsa883x.c | 77 +- sound/soc/codecs/wsa884x.c | 165 +++- sound/soc/qcom/qdsp6/audioreach.c | 819 +++++++++++++++++- sound/soc/qcom/qdsp6/audioreach.h | 105 +++ sound/soc/qcom/qdsp6/q6apm-dai.c | 16 +- sound/soc/qcom/qdsp6/q6apm.c | 42 +- sound/soc/qcom/qdsp6/q6apm.h | 1 + sound/soc/qcom/qdsp6/topology.c | 313 +++++++ sound/soc/qcom/sdw.c | 232 +++-- sound/soc/qcom/x1e80100.c | 100 +++ sound/soc/soc-core.c | 20 +- sound/soc/soc-dai.c | 1 + sound/soc/soc-dapm.c | 32 + sound/soc/soc-pcm.c | 136 ++- 23 files changed, 2150 insertions(+), 142 deletions(-) create mode 100644 Documentation/sound/soc/multi-direction-codecs.rst base-commit: 253f86660c1f882fbf554db5eaa34bc5d66dc7e8