From nobody Sun Sep 27 06:36:14 2026 Received: from mail-m1973198.qiye.163.com (mail-m1973198.qiye.163.com [220.197.31.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F021B46C4CD; Fri, 4 Sep 2026 10:38:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.197.31.98 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788518320; cv=none; b=oD6Fq25CmRNkN3/SiJxTD5R9P1PHT563MMPQ3qfN4vxYEmyY279EqtIK+W9UKk7cjXTZDobEFmAeJYZt+6X6h0xs/eeCnkalIqIkkNlfw8xeOpUolKjEjdZ4OMsdNrzhBBa3Z8HAa7AhxcrfOXVeciBdZ1prsoJAEL2Q+Y0NQgI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788518320; c=relaxed/simple; bh=CVUn4oR5TBb1cbVUGQ67fEH7gdrl9s3ZKb0KDuGoxrM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ChCc5n0rbzJzsPsjEnH5x0UH+vb+zvbF74bibEvQyjPoEiidPad4fh6SkA2ecytyJ14g0XNHhstRTVyMDSljHxl0MFV1MqUfhoYpwkTmnukGX3S+tx8P1DMelazxnVo0sEGKjPFrw1RlPPCsvuHlhpunGx9l7aLeZqrPCOWOUlA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=thundersoft.com; spf=pass smtp.mailfrom=thundersoft.com; dkim=pass (1024-bit key) header.d=thundersoft.com header.i=@thundersoft.com header.b=ijMHZwCe; arc=none smtp.client-ip=220.197.31.98 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=thundersoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=thundersoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=thundersoft.com header.i=@thundersoft.com header.b="ijMHZwCe" Received: from [127.0.1.1] (unknown [36.129.139.90]) by smtp.qiye.163.com (Hmail) with ESMTP id 4c8f646c2; Fri, 4 Sep 2026 18:02:52 +0800 (GMT+08:00) From: Hongyang Zhao Date: Fri, 04 Sep 2026 18:02:25 +0800 Subject: [PATCH v3 1/6] ASoC: dt-bindings: es8316: Document jack detect inversion Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260904-rubikpi-next-20260605-v3-1-f49146d85af3@thundersoft.com> References: <20260904-rubikpi-next-20260605-v3-0-f49146d85af3@thundersoft.com> In-Reply-To: <20260904-rubikpi-next-20260605-v3-0-f49146d85af3@thundersoft.com> To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Daniel Drake , Katsuhiro Suzuki , Matteo Martelli , Binbin Zhou , Srinivas Kandagatla , Jaroslav Kysela , Takashi Iwai , Bjorn Andersson , Konrad Dybcio Cc: Mohammad Rafi Shaik , Roger Shimizu , linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Hongyang Zhao , Krzysztof Kozlowski X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1788516170; l=1226; i=hongyang.zhao@thundersoft.com; s=20260127; h=from:subject:message-id; bh=CVUn4oR5TBb1cbVUGQ67fEH7gdrl9s3ZKb0KDuGoxrM=; b=mPWmOcmCD4WN4BrNZyhxRj2od3i2SInbiR169g+czYl7fakkXvq86Zf8wf3xDqeDMpkolmnbY 8gjOv/KdvEiBttgFa5RAcMwECh0C3/xZHB8JfshfHuOgfjZlXTYu+wn X-Developer-Key: i=hongyang.zhao@thundersoft.com; a=ed25519; pk=D9yL5W9Zj0lPBDAq9gzY++1849VlXuTWAkROzZ88J/4= X-HM-Tid: 0aa06bdf048509d5kunm6f63729aafb4c X-HM-MType: 1 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWRgWCB1ZQUpXWS1ZQUlXWQ8JGhUIEh9ZQVlCShhLVh0eSx9IGExNHhgeSVYVFA kWGhdVEwETFhoSFyQUDg9ZV1kYEgtZQVlITVVKSUJVSkhCVUJLWVdZFhoPEhUdFFlBWU9LSFVKS0 lPT09IVUpLS1VKQktLWQY+ DKIM-Signature: a=rsa-sha256; b=ijMHZwCe9FOsfo++VSZn3ZRjgCFlgN+/c88OE8X8M7xzJn6RWk4cyBPlnDYDS5Mq34+FzE7zNe+Ha91Pv8Sp2xohkuJuKQDScyHVBKGTO0dSP7TBbEU5O5snq6vqQjA+ThsLrcyU80x7pqEPiZiCB1+MtP1IvVQjO+mdW23dxWs=; s=default; c=relaxed/relaxed; d=thundersoft.com; v=1; bh=597yvAmbtpxqKhHT8WHhejI5xPg6hWppCyeJ96YlFRE=; h=date:mime-version:subject:message-id:from; The ES8316 driver supports the everest,jack-detect-inverted property to account for boards which invert the codec jack-detect signal. However, the property is not described by the binding, so a valid user of the driver fails schema validation because the binding rejects unknown properties. Document the flag so boards can describe the jack-detect polarity used by their wiring. Acked-by: Krzysztof Kozlowski Signed-off-by: Hongyang Zhao --- Documentation/devicetree/bindings/sound/everest,es8316.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/everest,es8316.yaml b/= Documentation/devicetree/bindings/sound/everest,es8316.yaml index f4ff23120c5b..9060358a9080 100644 --- a/Documentation/devicetree/bindings/sound/everest,es8316.yaml +++ b/Documentation/devicetree/bindings/sound/everest,es8316.yaml @@ -84,6 +84,11 @@ properties: "#sound-dai-cells": const: 0 =20 + everest,jack-detect-inverted: + $ref: /schemas/types.yaml#/definitions/flag + description: + Defined to invert the jack detection. + required: - compatible - reg --=20 2.43.0 From nobody Sun Sep 27 06:36:14 2026 Received: from mail-m32111.qiye.163.com (mail-m32111.qiye.163.com [220.197.32.111]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5C1FF3C062F; Fri, 4 Sep 2026 10:18:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.197.32.111 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788517110; cv=none; b=Muhyxo13j+lk+GK6SKr1+nYit0RbzAIC7awxwyzpUb4292+WHSxjL8MmgsA+MpixZ+SdwLIONXZgVm418KW5q7vUQrFeCf1mnNK4okzo/K6ouYTdpHLQzRMDXhzfE6qZXFZwTTBAPmABXQHPEUDGouBsqjCrU6S2nW+9FHWoe5I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788517110; c=relaxed/simple; bh=gDmAcN+5QP7ho2GcSrntOpFVXi+9Ked5dTnCchsTnFM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FHQzw+eKbCSB0oG2f5ocZWm/sZ539p8h+EzlxgG8lMy3OzXGvt2n2rF5pbgFq1xUT//zeT6IQmlrXmZFp5kXMbqeN1bR/AQooxZhoFnNzKRqpS40YOz5jjfYHu3xv3UkTyknAan2KRB+uvTlm6nT4PheB8uRBwspRoCPtVDqbsM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=thundersoft.com; spf=pass smtp.mailfrom=thundersoft.com; dkim=pass (1024-bit key) header.d=thundersoft.com header.i=@thundersoft.com header.b=QEfVAxRC; arc=none smtp.client-ip=220.197.32.111 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=thundersoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=thundersoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=thundersoft.com header.i=@thundersoft.com header.b="QEfVAxRC" Received: from [127.0.1.1] (unknown [36.129.139.90]) by smtp.qiye.163.com (Hmail) with ESMTP id 4c8f646cb; Fri, 4 Sep 2026 18:02:54 +0800 (GMT+08:00) From: Hongyang Zhao Date: Fri, 04 Sep 2026 18:02:26 +0800 Subject: [PATCH v3 2/6] ASoC: dt-bindings: qcom,sm8250: Add RubikPi 3 sound card Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260904-rubikpi-next-20260605-v3-2-f49146d85af3@thundersoft.com> References: <20260904-rubikpi-next-20260605-v3-0-f49146d85af3@thundersoft.com> In-Reply-To: <20260904-rubikpi-next-20260605-v3-0-f49146d85af3@thundersoft.com> To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Daniel Drake , Katsuhiro Suzuki , Matteo Martelli , Binbin Zhou , Srinivas Kandagatla , Jaroslav Kysela , Takashi Iwai , Bjorn Andersson , Konrad Dybcio Cc: Mohammad Rafi Shaik , Roger Shimizu , linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Hongyang Zhao X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1788516170; l=1261; i=hongyang.zhao@thundersoft.com; s=20260127; h=from:subject:message-id; bh=gDmAcN+5QP7ho2GcSrntOpFVXi+9Ked5dTnCchsTnFM=; b=ic2UOxxmcYks/1trRTgX471naGiax7jeNr4BaKKuTFnwpsYM7ebCJR+ZS35Ki95VJcR7kVZg8 QBenRasjwIbC7/XTvQlYdo/54Wq+yirPo7cz7HHf+J2I4bfqh3u1kv9 X-Developer-Key: i=hongyang.zhao@thundersoft.com; a=ed25519; pk=D9yL5W9Zj0lPBDAq9gzY++1849VlXuTWAkROzZ88J/4= X-HM-Tid: 0aa06bdf0bf909d5kunm6f63729aafb62 X-HM-MType: 1 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWRgWCB1ZQUpXWS1ZQUlXWQ8JGhUIEh9ZQVkaSU5PVkoaQxpLTBpNGEIYGlYVFA kWGhdVEwETFhoSFyQUDg9ZV1kYEgtZQVlITVVKSUJVSkhCVUJLWVdZFhoPEhUdFFlBWU9LSFVKS0 lCQ0NMVUpLS1VLWQY+ DKIM-Signature: a=rsa-sha256; b=QEfVAxRCQajtt81f7CgjycHR/JjhSJZ/15MChhHAwjHU6sTT4hbQbBsEb5pu/SxRcSHnldj8799pQZigHPS+pqC0eBXPv75O/NEpKXVTzoX+59+8RReaZLxxhpJPX4eRHkIiIARsOkn6KgIDqkt0YiztvD3rvCHITEX0Ai3M+3A=; s=default; c=relaxed/relaxed; d=thundersoft.com; v=1; bh=P6N15QBduQsHpT0mxLoWN9dWs6OuCxQrQWIy0/z8LCc=; h=date:mime-version:subject:message-id:from; The QCS6490-based Thundercomm RubikPi 3 routes primary MI2S to an external ES8316 headset codec and quaternary MI2S to the LT9611 HDMI bridge. This requires board-specific DAI clocking and jack setup in the sc8280xp machine driver. The existing QCM6490 and QCS6490 compatibles select machine data for boards using different codec and audio routing arrangements, so they cannot be used as compatible fallbacks for RubikPi 3. Add a dedicated compatible to select the RubikPi 3 machine data. Signed-off-by: Hongyang Zhao Acked-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/sound/qcom,sm8250.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml b/Doc= umentation/devicetree/bindings/sound/qcom,sm8250.yaml index 1536fcd96d68..fc7bccdace0f 100644 --- a/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml @@ -54,6 +54,7 @@ properties: - qcom,sm8250-sndcard - qcom,sm8450-sndcard - qcom,x1e80100-sndcard + - thundercomm,qcs6490-rubikpi3-sndcard =20 audio-routing: $ref: /schemas/types.yaml#/definitions/non-unique-string-array --=20 2.43.0 From nobody Sun Sep 27 06:36:14 2026 Received: from mail-m15591.qiye.163.com (mail-m15591.qiye.163.com [101.71.155.91]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BEA103C5540; Fri, 4 Sep 2026 10:18:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=101.71.155.91 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788517106; cv=none; b=VCqvjWni+a+7N36kDBU65BUka0oygjFNG0hhfFshm4sOflHLyjghshnlVLCX7FooLPEJaBWqKghM1+UHrSJqHvEc4PSBc0uuUjX9upNSQ/iGDLD03hJNaosfF3hr1/lbBd7ENq8xylzSMhCUUSyR+tldOt4I+U0gq/67WGbYLBk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788517106; c=relaxed/simple; bh=ITX64q7TxLg1M8ruo/wTm0clzr6h3tG8AjtyTkUWOCY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rHEWOsJQ8gJw7OVwa795Igm0icwbsmyOE8TPfeXpsR6rwitis3f1rRCzq1Hu15mocikWCiL7gkGSOHgd9ovQVCc8pLsfj9l1swdmQczIrlTWUrNlpi9lfwQ2mk6yW9kteu6g+Ik88zwfcb5Oghwr61MPxKoE/JBXPhVrnpeDCXg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=thundersoft.com; spf=pass smtp.mailfrom=thundersoft.com; dkim=pass (1024-bit key) header.d=thundersoft.com header.i=@thundersoft.com header.b=N3nctIFp; arc=none smtp.client-ip=101.71.155.91 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=thundersoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=thundersoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=thundersoft.com header.i=@thundersoft.com header.b="N3nctIFp" Received: from [127.0.1.1] (unknown [36.129.139.90]) by smtp.qiye.163.com (Hmail) with ESMTP id 4c8f646d3; Fri, 4 Sep 2026 18:02:56 +0800 (GMT+08:00) From: Hongyang Zhao Date: Fri, 04 Sep 2026 18:02:27 +0800 Subject: [PATCH v3 3/6] ASoC: qcom: common: Add generic headset jack helpers Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260904-rubikpi-next-20260605-v3-3-f49146d85af3@thundersoft.com> References: <20260904-rubikpi-next-20260605-v3-0-f49146d85af3@thundersoft.com> In-Reply-To: <20260904-rubikpi-next-20260605-v3-0-f49146d85af3@thundersoft.com> To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Daniel Drake , Katsuhiro Suzuki , Matteo Martelli , Binbin Zhou , Srinivas Kandagatla , Jaroslav Kysela , Takashi Iwai , Bjorn Andersson , Konrad Dybcio Cc: Mohammad Rafi Shaik , Roger Shimizu , linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Hongyang Zhao X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1788516170; l=4469; i=hongyang.zhao@thundersoft.com; s=20260127; h=from:subject:message-id; bh=ITX64q7TxLg1M8ruo/wTm0clzr6h3tG8AjtyTkUWOCY=; b=7iXZrUxToeSjfc/YDFGJ3/Q2qBK9xm03IMIWKR5TeOYpYET5CT1hj27jroxfM+XxEVGpOjS7u 27u08EauPtpDbahZBhFYrZfyzzLFoRnk8YXWC3EKTeBB4jJwTLPrsns X-Developer-Key: i=hongyang.zhao@thundersoft.com; a=ed25519; pk=D9yL5W9Zj0lPBDAq9gzY++1849VlXuTWAkROzZ88J/4= X-HM-Tid: 0aa06bdf132109d5kunm6f63729aafb72 X-HM-MType: 1 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWRgWCB1ZQUpXWS1ZQUlXWQ8JGhUIEh9ZQVkZTEkfVkNISx5KTEtDTk8ZTVYVFA kWGhdVEwETFhoSFyQUDg9ZV1kYEgtZQVlITVVKSUJVSkhCVUJLWVdZFhoPEhUdFFlBWU9LSFVKS0 lPT09IVUpLS1VKQktLWQY+ DKIM-Signature: a=rsa-sha256; b=N3nctIFpA0oRtyaFNRDLhsdNnzzHx7YAFfwcZAY5PNA4q6F+Vc80w9O/O/ecHPueO8tff7d8OxYz1gQgEYcTW3CXI5LuoqN980jTnO96FCPbAeoyNfhA6VQdOo3ivaglQNvOfTok1y+PjGPLY85GUaexWRx68XNHH77Um2KAXd0=; s=default; c=relaxed/relaxed; d=thundersoft.com; v=1; bh=U7e5bACX6Y3RWqCOy398jTMUDaO2guL4ceU7/z30Tmo=; h=date:mime-version:subject:message-id:from; qcom_snd_wcd_jack_setup() combines creation of the card-level headset jack with the WCD-specific operation of attaching jack detection to codecs on the TX codec DMA links. External codecs connected over MI2S also provide component jack detection, but cannot use the WCD-specific DAI filtering. Factor the common jack allocation, DAPM pin registration and headset button mappings into a private initializer. Reuse it from the existing WCD path and add a generic setup helper which attaches the jack to every codec component in a runtime. Treat -ENOTSUPP as a no-op because snd_soc_component_set_jack() uses it for components which do not provide a set_jack callback. Add a matching cleanup helper so machine drivers can detach component jack detection when the DAI link exits. The WCD setup behavior remains unchanged. Signed-off-by: Hongyang Zhao --- sound/soc/qcom/common.c | 61 ++++++++++++++++++++++++++++++++++++++++++---= ---- sound/soc/qcom/common.h | 3 +++ 2 files changed, 56 insertions(+), 8 deletions(-) diff --git a/sound/soc/qcom/common.c b/sound/soc/qcom/common.c index d9f256d51973..83b745f617a8 100644 --- a/sound/soc/qcom/common.c +++ b/sound/soc/qcom/common.c @@ -339,13 +339,11 @@ static struct snd_soc_jack_pin qcom_headset_jack_pins= [] =3D { }, }; =20 -int qcom_snd_wcd_jack_setup(struct snd_soc_pcm_runtime *rtd, - struct snd_soc_jack *jack, bool *jack_setup) +static int qcom_snd_headset_jack_init(struct snd_soc_card *card, + struct snd_soc_jack *jack, + bool *jack_setup) { - struct snd_soc_dai *cpu_dai =3D snd_soc_rtd_to_cpu(rtd, 0); - struct snd_soc_dai *codec_dai =3D snd_soc_rtd_to_codec(rtd, 0); - struct snd_soc_card *card =3D rtd->card; - int rval, i; + int rval; =20 if (!*jack_setup) { rval =3D snd_soc_card_jack_new_pins(card, "Headset Jack", @@ -369,6 +367,55 @@ int qcom_snd_wcd_jack_setup(struct snd_soc_pcm_runtime= *rtd, *jack_setup =3D true; } =20 + return 0; +} + +int qcom_snd_headset_jack_setup(struct snd_soc_pcm_runtime *rtd, + struct snd_soc_jack *jack, bool *jack_setup) +{ + struct snd_soc_dai *codec_dai; + struct snd_soc_card *card =3D rtd->card; + int rval, i; + + rval =3D qcom_snd_headset_jack_init(card, jack, jack_setup); + if (rval) + return rval; + + for_each_rtd_codec_dais(rtd, i, codec_dai) { + rval =3D snd_soc_component_set_jack(codec_dai->component, jack, NULL); + if (rval !=3D 0 && rval !=3D -ENOTSUPP) { + dev_warn(card->dev, "Failed to set jack: %d\n", rval); + qcom_snd_headset_jack_cleanup(rtd); + return rval; + } + } + + return 0; +} +EXPORT_SYMBOL_GPL(qcom_snd_headset_jack_setup); + +void qcom_snd_headset_jack_cleanup(struct snd_soc_pcm_runtime *rtd) +{ + struct snd_soc_dai *codec_dai; + int i; + + for_each_rtd_codec_dais(rtd, i, codec_dai) + snd_soc_component_set_jack(codec_dai->component, NULL, NULL); +} +EXPORT_SYMBOL_GPL(qcom_snd_headset_jack_cleanup); + +int qcom_snd_wcd_jack_setup(struct snd_soc_pcm_runtime *rtd, + struct snd_soc_jack *jack, bool *jack_setup) +{ + struct snd_soc_dai *cpu_dai =3D snd_soc_rtd_to_cpu(rtd, 0); + struct snd_soc_dai *codec_dai =3D snd_soc_rtd_to_codec(rtd, 0); + struct snd_soc_card *card =3D rtd->card; + int rval, i; + + rval =3D qcom_snd_headset_jack_init(card, jack, jack_setup); + if (rval) + return rval; + switch (cpu_dai->id) { case LPI_MI2S_RX_0: case TX_CODEC_DMA_TX_0: @@ -388,8 +435,6 @@ int qcom_snd_wcd_jack_setup(struct snd_soc_pcm_runtime = *rtd, default: break; } - - return 0; } EXPORT_SYMBOL_GPL(qcom_snd_wcd_jack_setup); diff --git a/sound/soc/qcom/common.h b/sound/soc/qcom/common.h index c1deac109f24..b6204a32bd64 100644 --- a/sound/soc/qcom/common.h +++ b/sound/soc/qcom/common.h @@ -24,6 +24,9 @@ int qcom_snd_apply_dai_tdm_slots_cfg(struct snd_soc_pcm_r= untime *rtd, const struct qcom_snd_tdm_slot_cfg *cpu_cfg, const struct qcom_snd_tdm_slot_cfg *codec_cfg); int qcom_snd_apply_dai_tdm_slots(struct snd_soc_pcm_runtime *rtd); +int qcom_snd_headset_jack_setup(struct snd_soc_pcm_runtime *rtd, + struct snd_soc_jack *jack, bool *jack_setup); +void qcom_snd_headset_jack_cleanup(struct snd_soc_pcm_runtime *rtd); 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, --=20 2.43.0 From nobody Sun Sep 27 06:36:14 2026 Received: from mail-m32106.qiye.163.com (mail-m32106.qiye.163.com [220.197.32.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D05583D88F7; Fri, 4 Sep 2026 10:18:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.197.32.106 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788517118; cv=none; b=aLiujxLu0E4G3A8LAboO9BsojULVoDgy2k4/ISLBliPSnHTt3IGGy7bvXdFv9zj43XZiS0A+4OTXb33RSgZwObIHmPVjTCd6lQGBWLINvz7rEDTY1tSNyVQqH0Qzh/u2Hr4Q7Z8CTCTixQ/DcrN2VUXPcqe0qzr6feknrUFGuZI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788517118; c=relaxed/simple; bh=k+MlA6X3Punm2gYWRdKkhl6OvEkpZR1/eHhSIaY2LAU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rYxfgOUC0J4eV4+s4bp7ftGAiV6WseyDTN5JVsLjp7WGi3xFgrOpp5WO/RBbVxYZmO/xvaKwqpKt3rhU6p/nsNs7b2i+/dWCYfxibgz5qpfdHKgk3+bHTOI0IM5HSrx9Ek4NDUt8nRuBx1smwniUdZkSaLW6zAn2gJ4OYxIJv7U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=thundersoft.com; spf=pass smtp.mailfrom=thundersoft.com; dkim=pass (1024-bit key) header.d=thundersoft.com header.i=@thundersoft.com header.b=RueZZFbN; arc=none smtp.client-ip=220.197.32.106 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=thundersoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=thundersoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=thundersoft.com header.i=@thundersoft.com header.b="RueZZFbN" Received: from [127.0.1.1] (unknown [36.129.139.90]) by smtp.qiye.163.com (Hmail) with ESMTP id 4c8f646d9; Fri, 4 Sep 2026 18:02:58 +0800 (GMT+08:00) From: Hongyang Zhao Date: Fri, 04 Sep 2026 18:02:28 +0800 Subject: [PATCH v3 4/6] ASoC: qcom: sc8280xp: Add per-DAI board configuration Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260904-rubikpi-next-20260605-v3-4-f49146d85af3@thundersoft.com> References: <20260904-rubikpi-next-20260605-v3-0-f49146d85af3@thundersoft.com> In-Reply-To: <20260904-rubikpi-next-20260605-v3-0-f49146d85af3@thundersoft.com> To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Daniel Drake , Katsuhiro Suzuki , Matteo Martelli , Binbin Zhou , Srinivas Kandagatla , Jaroslav Kysela , Takashi Iwai , Bjorn Andersson , Konrad Dybcio Cc: Mohammad Rafi Shaik , Roger Shimizu , linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Hongyang Zhao X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1788516170; l=8539; i=hongyang.zhao@thundersoft.com; s=20260127; h=from:subject:message-id; bh=k+MlA6X3Punm2gYWRdKkhl6OvEkpZR1/eHhSIaY2LAU=; b=MM6qCFgV5QGU/30NkC6WwK9hVka7kICPTki4j9AsXqCiU8RpkxTvmP1XC009CZrUt/SJYROio tikQue8wAc6D0oCeO3QpDfRrEKRcETkRuKLx5Yaijqe3x1GnKnQB3XS X-Developer-Key: i=hongyang.zhao@thundersoft.com; a=ed25519; pk=D9yL5W9Zj0lPBDAq9gzY++1849VlXuTWAkROzZ88J/4= X-HM-Tid: 0aa06bdf1afd09d5kunm6f63729aafb80 X-HM-MType: 1 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWRgWCB1ZQUpXWS1ZQUlXWQ8JGhUIEh9ZQVkZHR9CVhhCTE8eSklJH0IYHlYVFA kWGhdVEwETFhoSFyQUDg9ZV1kYEgtZQVlITVVKSUJVSkhCVUJLWVdZFhoPEhUdFFlBWU9LSFVKS0 lPT09IVUpLS1VKQktLWQY+ DKIM-Signature: a=rsa-sha256; b=RueZZFbNt7uyv295plX+KGuEMlgfa64QL/BpZNXay0ZWMi8PRgdyl4xPkkAXzmGhXEwWRHUjlV05DhTo16cfojDmJLZJNW5C2QzjfqIOnjeCJi9RH5htZ6FBcQUZFOHolX3LEsF1UBNg1ySxu8u4yC0b6OnbAEXmAcqjiDz5HN4=; s=default; c=relaxed/relaxed; d=thundersoft.com; v=1; bh=mfgZSbr/syZYI9aMdBK862dul9i0Zwry4EFMXAiJ6E0=; h=date:mime-version:subject:message-id:from; The board data currently applies codec sysclk, MI2S clock and jack setup policy to every backend DAI on a sound card. This cannot describe a card whose codecs have different clock requirements on different MI2S interfaces. Add an optional per-DAI configuration table indexed by CPU DAI ID. Each entry can override the MCLK rate, CPU MCLK and BCLK programming, codec sysclk setup and jack setup path. Keep the codec DAI format card-wide. Cards without a matching per-DAI entry continue to use the existing card-wide settings, keeping all current board data unchanged. Signed-off-by: Hongyang Zhao --- sound/soc/qcom/sc8280xp.c | 107 ++++++++++++++++++++++++++++++++++++++++++= ---- 1 file changed, 98 insertions(+), 9 deletions(-) diff --git a/sound/soc/qcom/sc8280xp.c b/sound/soc/qcom/sc8280xp.c index 4d48e1012cd4..368a54c2cdf8 100644 --- a/sound/soc/qcom/sc8280xp.c +++ b/sound/soc/qcom/sc8280xp.c @@ -58,6 +58,25 @@ static const struct snd_soc_dapm_widget max98090_dapm_wi= dgets[] =3D { SND_SOC_DAPM_SPK("Speaker", NULL), }; =20 +enum sc8280xp_jack_setup { + SC8280XP_JACK_SETUP_NONE, + SC8280XP_JACK_SETUP_CODEC, + SC8280XP_JACK_SETUP_WCD, +}; + +struct sc8280xp_dai_data { + unsigned int id; + unsigned int mclk_rate; + bool codec_sysclk_set; + bool mi2s_mclk_enable; + bool mi2s_bclk_enable; + enum sc8280xp_jack_setup jack_setup; +}; + +#define SC8280XP_DAI_DATA(...) \ + .dai_data =3D (const struct sc8280xp_dai_data[]) { __VA_ARGS__ }, \ + .num_dai_data =3D ARRAY_SIZE(((const struct sc8280xp_dai_data[]) { __VA_A= RGS__ })) + struct qcom_snd_soc_common { const char *driver_name; const struct snd_soc_dapm_widget *dapm_widgets; @@ -71,6 +90,8 @@ struct qcom_snd_soc_common { bool mi2s_mclk_enable; bool mi2s_bclk_enable; bool wcd_jack; + const struct sc8280xp_dai_data *dai_data; + size_t num_dai_data; int (*snd_prepare)(struct snd_pcm_substream *substream); }; =20 @@ -83,6 +104,20 @@ struct sc8280xp_snd_data { bool jack_setup; }; =20 +static const struct sc8280xp_dai_data * +sc8280xp_get_dai_data(const struct qcom_snd_soc_common *common, + unsigned int id) +{ + size_t i; + + for (i =3D 0; i < common->num_dai_data; i++) { + if (common->dai_data[i].id =3D=3D id) + return &common->dai_data[i]; + } + + return NULL; +} + static inline int sc8280xp_get_mclk_freq(struct snd_pcm_hw_params *params) { int rate =3D params_rate(params); @@ -112,13 +147,22 @@ static int sc8280xp_tdm_hw_params(struct snd_pcm_subs= tream *substream, struct snd_soc_pcm_runtime *rtd =3D snd_soc_substream_to_rtd(substream); struct sc8280xp_snd_data *data =3D snd_soc_card_get_drvdata(rtd->card); struct snd_soc_dai *cpu_dai =3D snd_soc_rtd_to_cpu(rtd, 0); + const struct sc8280xp_dai_data *dai_data; struct snd_soc_dai *codec_dai; struct qcom_snd_tdm_slot_cfg cpu_cfg; struct qcom_snd_tdm_slot_cfg codec_cfg; + bool codec_sysclk_set =3D data->priv->codec_sysclk_set; + bool mi2s_bclk_enable =3D data->priv->mi2s_bclk_enable; int bclk_freq; int ret; int i; =20 + dai_data =3D sc8280xp_get_dai_data(data->priv, cpu_dai->id); + if (dai_data) { + codec_sysclk_set =3D dai_data->codec_sysclk_set; + mi2s_bclk_enable =3D dai_data->mi2s_bclk_enable; + } + ret =3D qcom_snd_get_dai_tdm_slots(rtd, &cpu_cfg, &codec_cfg); if (ret) return ret =3D=3D -ENOENT ? 0 : ret; @@ -147,7 +191,7 @@ static int sc8280xp_tdm_hw_params(struct snd_pcm_substr= eam *substream, if (bclk_freq <=3D 0) return -EINVAL; =20 - if (data->priv->mi2s_bclk_enable) { + if (mi2s_bclk_enable) { ret =3D snd_soc_dai_set_sysclk(cpu_dai, LPAIF_MI2S_BCLK, bclk_freq, SND_SOC_CLOCK_IN); if (ret && ret !=3D -ENOTSUPP) { @@ -157,7 +201,7 @@ static int sc8280xp_tdm_hw_params(struct snd_pcm_substr= eam *substream, } } =20 - if (data->priv->codec_sysclk_set) { + if (codec_sysclk_set) { for_each_rtd_codec_dais(rtd, i, codec_dai) { ret =3D snd_soc_dai_set_sysclk(codec_dai, 0, bclk_freq, SND_SOC_CLOCK_IN); @@ -176,10 +220,13 @@ static int sc8280xp_snd_init(struct snd_soc_pcm_runti= me *rtd) { struct sc8280xp_snd_data *data =3D snd_soc_card_get_drvdata(rtd->card); struct snd_soc_dai *cpu_dai =3D snd_soc_rtd_to_cpu(rtd, 0); + const struct sc8280xp_dai_data *dai_data; struct snd_soc_card *card =3D rtd->card; struct snd_soc_jack *dp_jack =3D NULL; int dp_pcm_id =3D 0; =20 + dai_data =3D sc8280xp_get_dai_data(data->priv, cpu_dai->id); + switch (cpu_dai->id) { case WSA_CODEC_DMA_RX_0: case WSA_CODEC_DMA_RX_1: @@ -209,10 +256,24 @@ static int sc8280xp_snd_init(struct snd_soc_pcm_runti= me *rtd) if (dp_jack) return qcom_snd_dp_jack_setup(rtd, dp_jack, dp_pcm_id); =20 - if (data->priv->wcd_jack) - return qcom_snd_wcd_jack_setup(rtd, &data->jack, &data->jack_setup); + if (!dai_data) { + if (data->priv->wcd_jack) + return qcom_snd_wcd_jack_setup(rtd, &data->jack, + &data->jack_setup); =20 - return 0; + return 0; + } + + switch (dai_data->jack_setup) { + case SC8280XP_JACK_SETUP_CODEC: + return qcom_snd_headset_jack_setup(rtd, &data->jack, + &data->jack_setup); + case SC8280XP_JACK_SETUP_WCD: + return qcom_snd_wcd_jack_setup(rtd, &data->jack, + &data->jack_setup); + default: + return 0; + } } =20 static int sc8280xp_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, @@ -251,10 +312,24 @@ static int sc8280xp_snd_hw_params(struct snd_pcm_subs= tream *substream, struct snd_soc_dai *codec_dai =3D snd_soc_rtd_to_codec(rtd, 0); struct snd_soc_dai *cpu_dai =3D snd_soc_rtd_to_cpu(rtd, 0); struct sc8280xp_snd_data *data =3D snd_soc_card_get_drvdata(rtd->card); - int mclk_freq =3D sc8280xp_get_mclk_freq(params); + const struct sc8280xp_dai_data *dai_data; + bool codec_sysclk_set =3D data->priv->codec_sysclk_set; + bool mi2s_mclk_enable =3D data->priv->mi2s_mclk_enable; + bool mi2s_bclk_enable =3D data->priv->mi2s_bclk_enable; + int mclk_freq; int bclk_freq =3D sc8280xp_get_bclk_freq(params); int ret; =20 + dai_data =3D sc8280xp_get_dai_data(data->priv, cpu_dai->id); + mclk_freq =3D sc8280xp_get_mclk_freq(params); + if (dai_data) { + codec_sysclk_set =3D dai_data->codec_sysclk_set; + mi2s_mclk_enable =3D dai_data->mi2s_mclk_enable; + mi2s_bclk_enable =3D dai_data->mi2s_bclk_enable; + if (dai_data->mclk_rate) + mclk_freq =3D dai_data->mclk_rate; + } + switch (cpu_dai->id) { case PRIMARY_MI2S_RX ... QUATERNARY_MI2S_TX: case QUINARY_MI2S_RX ... QUINARY_MI2S_TX: @@ -271,7 +346,7 @@ static int sc8280xp_snd_hw_params(struct snd_pcm_substr= eam *substream, return ret; } =20 - if (data->priv->mi2s_mclk_enable) { + if (mi2s_mclk_enable) { ret =3D snd_soc_dai_set_sysclk(cpu_dai, LPAIF_MI2S_MCLK, mclk_freq, SND_SOC_CLOCK_OUT); @@ -279,7 +354,7 @@ static int sc8280xp_snd_hw_params(struct snd_pcm_substr= eam *substream, return ret; } =20 - if (data->priv->mi2s_bclk_enable) { + if (mi2s_bclk_enable) { ret =3D snd_soc_dai_set_sysclk(cpu_dai, LPAIF_MI2S_BCLK, bclk_freq, SND_SOC_CLOCK_OUT); @@ -287,7 +362,7 @@ static int sc8280xp_snd_hw_params(struct snd_pcm_substr= eam *substream, return ret; } =20 - if (data->priv->codec_sysclk_set) { + if (codec_sysclk_set) { ret =3D snd_soc_dai_set_sysclk(codec_dai, 0, mclk_freq, SND_SOC_CLOCK_IN); @@ -368,6 +443,19 @@ static int sc8280xp_snd_hw_free(struct snd_pcm_substre= am *substream) return qcom_snd_sdw_hw_free(substream, &data->stream_prepared[cpu_dai->id= ]); } =20 +static void sc8280xp_snd_exit(struct snd_soc_pcm_runtime *rtd) +{ + struct sc8280xp_snd_data *data =3D snd_soc_card_get_drvdata(rtd->card); + struct snd_soc_dai *cpu_dai =3D snd_soc_rtd_to_cpu(rtd, 0); + const struct sc8280xp_dai_data *dai_data; + + dai_data =3D sc8280xp_get_dai_data(data->priv, cpu_dai->id); + if (dai_data && dai_data->jack_setup =3D=3D SC8280XP_JACK_SETUP_CODEC) { + qcom_snd_headset_jack_cleanup(rtd); + data->jack_setup =3D false; + } +} + static const struct snd_soc_ops sc8280xp_be_ops =3D { .startup =3D qcom_snd_sdw_startup, .shutdown =3D qcom_snd_sdw_shutdown, @@ -384,6 +472,7 @@ static void sc8280xp_add_be_ops(struct snd_soc_card *ca= rd) for_each_card_prelinks(card, i, link) { if (link->no_pcm =3D=3D 1) { link->init =3D sc8280xp_snd_init; + link->exit =3D sc8280xp_snd_exit; link->be_hw_params_fixup =3D sc8280xp_be_hw_params_fixup; link->ops =3D &sc8280xp_be_ops; } --=20 2.43.0 From nobody Sun Sep 27 06:36:14 2026 Received: from mail-m3278.qiye.163.com (mail-m3278.qiye.163.com [220.197.32.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AFEB93F8EB3; Fri, 4 Sep 2026 10:18:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.197.32.78 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788517121; cv=none; b=iIz41t8wCTPOSgE1CQ517wWF9TnJTplmdHqe+NvF8kG66O97iWHE+VQtW9CNCjVkJT6FUb9qoQjNkH8w/vSrefcDzvuVqgHwvWYntNzeDfTpItkf9xCR0aW1SSLISLOayFE//3gXHBSZNSm5OGF3gpF1qdXD7LjyYZCkqMW/+44= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788517121; c=relaxed/simple; bh=uU45ngtFZM7M60giThROBp1vWuJIs8ZAf1FGc1ApM0E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TktqgZRHbYT639pl1luJcJrKzLjA1r7NEhm2mqZHIzNML0XFTK+QEh5frPt7oUF300q3PX4IyVXElHOlzChqgspRD+6bcMPbUcho28DqZadNqh100UY1xg2ZuZBfRL9hwyKtpghmoaWVUZLdV8m/eC0hnVDoe2c0nt8phKzJONM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=thundersoft.com; spf=pass smtp.mailfrom=thundersoft.com; dkim=pass (1024-bit key) header.d=thundersoft.com header.i=@thundersoft.com header.b=k0dbijPg; arc=none smtp.client-ip=220.197.32.78 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=thundersoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=thundersoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=thundersoft.com header.i=@thundersoft.com header.b="k0dbijPg" Received: from [127.0.1.1] (unknown [36.129.139.90]) by smtp.qiye.163.com (Hmail) with ESMTP id 4c8f646e4; Fri, 4 Sep 2026 18:03:00 +0800 (GMT+08:00) From: Hongyang Zhao Date: Fri, 04 Sep 2026 18:02:29 +0800 Subject: [PATCH v3 5/6] ASoC: qcom: sc8280xp: Add RubikPi 3 sound card support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260904-rubikpi-next-20260605-v3-5-f49146d85af3@thundersoft.com> References: <20260904-rubikpi-next-20260605-v3-0-f49146d85af3@thundersoft.com> In-Reply-To: <20260904-rubikpi-next-20260605-v3-0-f49146d85af3@thundersoft.com> To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Daniel Drake , Katsuhiro Suzuki , Matteo Martelli , Binbin Zhou , Srinivas Kandagatla , Jaroslav Kysela , Takashi Iwai , Bjorn Andersson , Konrad Dybcio Cc: Mohammad Rafi Shaik , Roger Shimizu , linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Hongyang Zhao X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1788516170; l=2525; i=hongyang.zhao@thundersoft.com; s=20260127; h=from:subject:message-id; bh=uU45ngtFZM7M60giThROBp1vWuJIs8ZAf1FGc1ApM0E=; b=VmgUWEvr2lsBrl6YyvzwcFl+ZfZRCIbZxWF0UmLdulwzX3rq5lIceyriQ0RaVchgjdkm92AgJ ZjGQbDDF9CACAhBlIPv+A6aHBrxqDsPejoDrNv+SUW+X7RH3lJB00i2 X-Developer-Key: i=hongyang.zhao@thundersoft.com; a=ed25519; pk=D9yL5W9Zj0lPBDAq9gzY++1849VlXuTWAkROzZ88J/4= X-HM-Tid: 0aa06bdf235f09d5kunm6f63729aafb94 X-HM-MType: 1 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWRgWCB1ZQUpXWS1ZQUlXWQ8JGhUIEh9ZQVlDSEMdVk9KQ0oeT0oZTEMeTVYVFA kWGhdVEwETFhoSFyQUDg9ZV1kYEgtZQVlITVVKSUJVSkhCVUJLWVdZFhoPEhUdFFlBWU9LSFVKS0 lPT09IVUpLS1VKQktLWQY+ DKIM-Signature: a=rsa-sha256; b=k0dbijPgSWPJI9marrp8uVSZKPy3eq1JS9P9CS/9mtTpvDaECP6Nn3W+qhiYNtnW6BFA8iFWfgDz/jQ1b1byKNKe+LqQuifYH1MmB3FEu0+8wOp6xpTphPLMxksQHihbZgDtoWa4TTy/rMqNDqSFISxL+Dlv+gWc++H51qQ6R00=; s=default; c=relaxed/relaxed; d=thundersoft.com; v=1; bh=HW5Z3J523FbzqVUD8ZxicdUroFUkrS81sJizOzooGNQ=; h=date:mime-version:subject:message-id:from; RubikPi 3 connects an ES8316 codec to primary MI2S for headset playback and capture, and an LT9611 bridge to quaternary MI2S for HDMI audio. Add per-DAI data for the primary playback and capture links. Configure the codecs for I2S with normal clock polarity and as bit and frame clock consumers. Program the primary MI2S BCLK, configure the ES8316 for its fixed 19.2 MHz MCLK and enable component jack detection on the playback link. The HDMI link inherits the card-wide I2S format but does not request codec sysclk programming because the LT9611 codec DAI does not implement set_sysclk(). Select this configuration through the RubikPi 3 sound-card compatible. Signed-off-by: Hongyang Zhao --- sound/soc/qcom/sc8280xp.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/sound/soc/qcom/sc8280xp.c b/sound/soc/qcom/sc8280xp.c index 368a54c2cdf8..73009f9bb8e4 100644 --- a/sound/soc/qcom/sc8280xp.c +++ b/sound/soc/qcom/sc8280xp.c @@ -577,6 +577,28 @@ static const struct qcom_snd_soc_common qcs6490_priv_d= ata =3D { .wcd_jack =3D true, }; =20 +static const struct qcom_snd_soc_common rubikpi3_priv_data =3D { + .driver_name =3D "qcs6490", + .dapm_widgets =3D sc8280xp_dapm_widgets, + .num_dapm_widgets =3D ARRAY_SIZE(sc8280xp_dapm_widgets), + .codec_dai_fmt =3D SND_SOC_DAIFMT_I2S | + SND_SOC_DAIFMT_NB_NF | + SND_SOC_DAIFMT_BC_FC, + SC8280XP_DAI_DATA({ + .id =3D PRIMARY_MI2S_RX, + .mclk_rate =3D 19200000, + .codec_sysclk_set =3D true, + .mi2s_bclk_enable =3D true, + .jack_setup =3D SC8280XP_JACK_SETUP_CODEC, + }, { + .id =3D PRIMARY_MI2S_TX, + .mclk_rate =3D 19200000, + .codec_sysclk_set =3D true, + .mi2s_bclk_enable =3D true, + } + ), +}; + static const struct qcom_snd_soc_common qcs8275_priv_data =3D { .driver_name =3D "qcs8300", .dapm_widgets =3D max98090_dapm_widgets, @@ -656,6 +678,7 @@ static const struct of_device_id snd_sc8280xp_dt_match[= ] =3D { { .compatible =3D "qcom,qcm6490-idp-sndcard", .data =3D &qcm6490_priv_dat= a }, { .compatible =3D "qcom,qcs615-sndcard", .data =3D &qcs615_priv_data }, { .compatible =3D "qcom,qcs6490-rb3gen2-sndcard", .data =3D &qcs6490_priv= _data }, + { .compatible =3D "thundercomm,qcs6490-rubikpi3-sndcard", .data =3D &rubi= kpi3_priv_data }, { .compatible =3D "qcom,qcs8275-sndcard", .data =3D &qcs8275_priv_data }, { .compatible =3D "qcom,qcs9075-sndcard", .data =3D &qcs9100_priv_data }, { .compatible =3D "qcom,qcs9100-sndcard", .data =3D &qcs9100_priv_data }, --=20 2.43.0 From nobody Sun Sep 27 06:36:14 2026 Received: from mail-m15574.qiye.163.com (mail-m15574.qiye.163.com [101.71.155.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B85ED3CCFBD; Fri, 4 Sep 2026 10:18:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=101.71.155.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788517115; cv=none; b=dABgMBGI2EyaPHKZXkA0T46pgY4zAXXcXwPSTZ1ps1uoSO7y4RCVVO6hdmUmWQKysdXPSYCVeSePh4TbVgEMQiRodPzQ2aG5lZIpFP5hlVZ8xi4AsiVh58/EIfS1g6wTBVIV0YtLn0Kpm/yJjJv3LWBmGa1GV0ap67rjC6d70MI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788517115; c=relaxed/simple; bh=51aJ1JblvEYM3O+oFR62vf+HfYNykqMpE6H+TgBBpb4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qk/dvNriYcesD5OblsZbuCB0SUMevHOG03JZvFSjcLgrA973uUgSih+X9XWTr4aDH/+Bf1IIBHlaPfMkMqitN1pjA9FdhF387CbrCjQA2mr/aWdAAYQl8yBhlewIvmRjS4g8ApyyIyH669D3xoSUY3i5f4zcR8Fdjmo6aNXPgf8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=thundersoft.com; spf=pass smtp.mailfrom=thundersoft.com; dkim=pass (1024-bit key) header.d=thundersoft.com header.i=@thundersoft.com header.b=L97Ae4nz; arc=none smtp.client-ip=101.71.155.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=thundersoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=thundersoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=thundersoft.com header.i=@thundersoft.com header.b="L97Ae4nz" Received: from [127.0.1.1] (unknown [36.129.139.90]) by smtp.qiye.163.com (Hmail) with ESMTP id 4c8f646f0; Fri, 4 Sep 2026 18:03:03 +0800 (GMT+08:00) From: Hongyang Zhao Date: Fri, 04 Sep 2026 18:02:30 +0800 Subject: [PATCH v3 6/6] arm64: dts: qcom: qcs6490-rubikpi3: Add audio support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260904-rubikpi-next-20260605-v3-6-f49146d85af3@thundersoft.com> References: <20260904-rubikpi-next-20260605-v3-0-f49146d85af3@thundersoft.com> In-Reply-To: <20260904-rubikpi-next-20260605-v3-0-f49146d85af3@thundersoft.com> To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Daniel Drake , Katsuhiro Suzuki , Matteo Martelli , Binbin Zhou , Srinivas Kandagatla , Jaroslav Kysela , Takashi Iwai , Bjorn Andersson , Konrad Dybcio Cc: Mohammad Rafi Shaik , Roger Shimizu , linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Hongyang Zhao X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1788516170; l=6027; i=hongyang.zhao@thundersoft.com; s=20260127; h=from:subject:message-id; bh=51aJ1JblvEYM3O+oFR62vf+HfYNykqMpE6H+TgBBpb4=; b=A/BF92uO0JERtcGEOwQvREJTdbHcB1MxdO867Ucm+Yu7ht2quZnM66HG/1pv5BIxVWfy1J8Kj JyZ2fqt6jLjC5+mt069L3ftfjzonKw5FmCc31wdOzVjyEnVP5ZK3uls X-Developer-Key: i=hongyang.zhao@thundersoft.com; a=ed25519; pk=D9yL5W9Zj0lPBDAq9gzY++1849VlXuTWAkROzZ88J/4= X-HM-Tid: 0aa06bdf2bee09d5kunm6f63729aafba4 X-HM-MType: 1 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWRgWCB1ZQUpXWS1ZQUlXWQ8JGhUIEh9ZQVkaT0lCVkpOS0kYS0IfH0JLGFYVFA kWGhdVEwETFhoSFyQUDg9ZV1kYEgtZQVlITVVKSUJVSkhCVUJLWVdZFhoPEhUdFFlBWU9LSFVKS0 lPT09IVUpLS1VKQktLWQY+ DKIM-Signature: a=rsa-sha256; b=L97Ae4nzBcalR/YT6lqW556dqyid17l+02j0S2wO9m+BrWBbfsHyWNnuO0jek598hUbIGL4yFy+47/cn7Qi5w5hOYTpWiSfANipd1rm6XHot/nFYe4dyHmKl2BqpMiBC09CuAg+wos1W6GCotAVXBe7SMTSYATZUgF2a46HrGYw=; s=default; c=relaxed/relaxed; d=thundersoft.com; v=1; bh=GJBUxSd6wE6o/DKf4dE/o3ZZ+oVtDtob6mF1TrwlVMY=; h=date:mime-version:subject:message-id:from; RubikPi 3 uses the AudioReach firmware path for its external audio interfaces. Primary MI2S connects to an ES8316 codec for headset playback and capture, while quaternary MI2S feeds the LT9611 HDMI bridge. Describe the ES8316 supplies, MCLK, jack detection and audio routing, and add the primary and quaternary MI2S links. The 1.8 V and 3.3 V codec supplies are both controlled by GPIO117. Signed-off-by: Hongyang Zhao Reviewed-by: Konrad Dybcio --- .../boot/dts/qcom/qcs6490-thundercomm-rubikpi3.dts | 169 +++++++++++++++++= ++++ 1 file changed, 169 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/qcs6490-thundercomm-rubikpi3.dts b/ar= ch/arm64/boot/dts/qcom/qcs6490-thundercomm-rubikpi3.dts index 0f21777c480b..10277bee86b3 100644 --- a/arch/arm64/boot/dts/qcom/qcs6490-thundercomm-rubikpi3.dts +++ b/arch/arm64/boot/dts/qcom/qcs6490-thundercomm-rubikpi3.dts @@ -19,6 +19,7 @@ #include "pm7325.dtsi" #include "pm8350c.dtsi" /* PM7350C */ #include "pmk8350.dtsi" /* PMK7325 */ +#include "qcs6490-audioreach.dtsi" =20 /delete-node/ &adsp_mem; /delete-node/ &cdsp_mem; @@ -128,6 +129,33 @@ fan0: pwm-fan { pinctrl-names =3D "default"; }; =20 + vreg_es8316_1v8: regulator-es8316-1v8 { + compatible =3D "regulator-fixed"; + + regulator-name =3D "vreg_es8316_1v8"; + regulator-min-microvolt =3D <1800000>; + regulator-max-microvolt =3D <1800000>; + + gpio =3D <&tlmm 117 GPIO_ACTIVE_HIGH>; + enable-active-high; + + pinctrl-0 =3D <&es8316_power_on>; + pinctrl-names =3D "default"; + + vin-supply =3D <&vreg_l18b_1p8>; + }; + + vreg_es8316_3v3: regulator-es8316-3v3 { + compatible =3D "regulator-fixed"; + + regulator-name =3D "vreg_es8316_3v3"; + regulator-min-microvolt =3D <3300000>; + regulator-max-microvolt =3D <3300000>; + + gpio =3D <&tlmm 117 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; + vreg_eth_1v8: regulator-eth-1v8 { compatible =3D "regulator-fixed"; =20 @@ -743,6 +771,30 @@ &gpu_zap_shader { firmware-name =3D "qcom/qcs6490/a660_zap.mbn"; }; =20 +&i2c0 { + status =3D "okay"; + + es8316: audio-codec@11 { + compatible =3D "everest,es8316"; + reg =3D <0x11>; + #sound-dai-cells =3D <0>; + + clocks =3D <&q6prmcc LPASS_CLK_ID_MCLK_1 LPASS_CLK_ATTRIBUTE_COUPLE_NO>; + clock-names =3D "mclk"; + + interrupts-extended =3D <&tlmm 63 IRQ_TYPE_LEVEL_HIGH>; + avdd-supply =3D <&vreg_es8316_3v3>; + cpvdd-supply =3D <&vreg_es8316_1v8>; + dvdd-supply =3D <&vreg_es8316_1v8>; + pvdd-supply =3D <&vreg_es8316_1v8>; + + pinctrl-0 =3D <&es8316_jack_detect>; + pinctrl-names =3D "default"; + + everest,jack-detect-inverted; + }; +}; + /* Pin 3, 5 in 40-pin connector */ &i2c1 { status =3D "okay"; @@ -756,6 +808,7 @@ &i2c9 { lt9611_codec: hdmi-bridge@39 { compatible =3D "lontium,lt9611"; reg =3D <0x39>; + #sound-dai-cells =3D <1>; =20 interrupts-extended =3D <&tlmm 20 IRQ_TYPE_EDGE_FALLING>; reset-gpios =3D <&tlmm 21 GPIO_ACTIVE_HIGH>; @@ -994,6 +1047,23 @@ &pon_resin { status =3D "okay"; }; =20 +&q6apmbedai { + #address-cells =3D <1>; + #size-cells =3D <0>; + + dai@10 { + reg =3D ; + clocks =3D <&q6prmcc LPASS_CLK_ID_PRI_MI2S_IBIT LPASS_CLK_ATTRIBUTE_COUP= LE_NO>; + clock-names =3D "bclk"; + }; + + dai@11 { + reg =3D ; + clocks =3D <&q6prmcc LPASS_CLK_ID_PRI_MI2S_IBIT LPASS_CLK_ATTRIBUTE_COUP= LE_NO>; + clock-names =3D "bclk"; + }; +}; + &qupv3_id_0 { firmware-name =3D "qcom/qcm6490/qupv3fw.elf"; =20 @@ -1030,6 +1100,69 @@ &sdhc_2 { status =3D "okay"; }; =20 +&sound { + compatible =3D "thundercomm,qcs6490-rubikpi3-sndcard"; + model =3D "QCS6490-Thundercomm-RubikPi3"; + + pinctrl-0 =3D <&mi2s0_data0>, <&mi2s0_data1>, <&mi2s0_mclk>, + <&mi2s0_sclk>, <&mi2s0_ws>, + <&lpass_qua_mi2s_sclk>, <&lpass_qua_mi2s_ws>, + <&lpass_qua_mi2s_data>; + pinctrl-names =3D "default"; + + audio-routing =3D "Headphone Jack", "HPOL", + "Headphone Jack", "HPOR", + "MIC2", "Mic Jack"; + + mi2s-capture-dai-link { + link-name =3D "Primary MI2S Capture"; + + codec { + sound-dai =3D <&es8316>; + }; + + cpu { + sound-dai =3D <&q6apmbedai PRIMARY_MI2S_TX>; + }; + + platform { + sound-dai =3D <&q6apm>; + }; + }; + + mi2s-playback-dai-link { + link-name =3D "Primary MI2S Playback"; + + codec { + sound-dai =3D <&es8316>; + }; + + cpu { + sound-dai =3D <&q6apmbedai PRIMARY_MI2S_RX>; + }; + + platform { + sound-dai =3D <&q6apm>; + }; + }; + + quaternary-mi2s-playback-dai-link { + link-name =3D "HDMI Playback"; + + codec { + sound-dai =3D <<9611_codec 0>; + }; + + cpu { + sound-dai =3D <&q6apmbedai QUATERNARY_MI2S_RX>; + }; + + platform { + sound-dai =3D <&q6apm>; + }; + }; +}; + /* Pin 19, 21, 23, 24 in 40-pin connector */ &spi12 { status =3D "okay"; @@ -1244,6 +1377,29 @@ &sdc2_data { drive-strength =3D <10>; }; =20 +&lpass_tlmm { + lpass_qua_mi2s_sclk: qua-mi2s-sclk-state { + pins =3D "gpio0"; + function =3D "qua_mi2s_sclk"; + drive-strength =3D <8>; + bias-disable; + }; + + lpass_qua_mi2s_ws: qua-mi2s-ws-state { + pins =3D "gpio1"; + function =3D "qua_mi2s_ws"; + drive-strength =3D <8>; + bias-disable; + }; + + lpass_qua_mi2s_data: qua-mi2s-data-state { + pins =3D "gpio2", "gpio3", "gpio4"; + function =3D "qua_mi2s_data"; + drive-strength =3D <8>; + bias-disable; + }; +}; + &tlmm { pcie1_reset_n: pcie1-reset-n-state { pins =3D "gpio2"; @@ -1389,6 +1545,12 @@ m2_vcc_pin: m2-vcc-state { input-disable; }; =20 + es8316_jack_detect: es8316-jack-detect-state { + pins =3D "gpio63"; + function =3D "gpio"; + bias-disable; + }; + lt9611_vcc_pin: lt9611-vcc-pin-state { pins =3D "gpio83"; function =3D "gpio"; @@ -1418,6 +1580,13 @@ pcie0_wake_n: pcie0-wake-n-state { bias-pull-up; }; =20 + es8316_power_on: es8316-power-on-state { + pins =3D "gpio117"; + function =3D "gpio"; + drive-strength =3D <2>; + bias-pull-down; + }; + wifi_power_on: wifi-power-on-state { pins =3D "gpio125"; function =3D "gpio"; --=20 2.43.0