From nobody Sat Jul 25 17:34:24 2026 Received: from mail-m49236.qiye.163.com (mail-m49236.qiye.163.com [45.254.49.236]) (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 6EAE93B14C0; Wed, 15 Jul 2026 16:26:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.254.49.236 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784132770; cv=none; b=OZcad861eZYHftCcfBx1sGnHkpxOYeoasZqoFmkEfIQMXoCwluRF1RRWqYXRH/nJqFlde0TXST6uxY7RhNqt+piUpKKzgAf8J0shuERo9sIg665cpfGMu4jm3DU0TiXj+ujsnXkf6vKT9cUZ0J5xyv3F+PzHoSetDRrkE4R57FQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784132770; c=relaxed/simple; bh=Wdq79F7my2vTkDlJ4tgWR9sajb2tA7FaF8yf0n2mnvo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pVggAVktMGAkxOnWGtC5+UXCoy4ax/ESvP3O41awHrJb6X5U7NzZJoMWVU4FgZuJvQ81bgYEa/jqzveNs9zWcXRF4q7TieeRiP/nGrYHVIa4Lu7FMdndoDzEu90lLeFPwY23lt3X2s0jOkM+VAcyOi7QbSPJDoK3OCN8ABLs3R8= 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=GUO69Ko2; arc=none smtp.client-ip=45.254.49.236 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="GUO69Ko2" Received: from [127.0.1.1] (unknown [36.129.139.90]) by smtp.qiye.163.com (Hmail) with ESMTP id 464e8f2e8; Wed, 15 Jul 2026 22:03:22 +0800 (GMT+08:00) From: Hongyang Zhao Date: Wed, 15 Jul 2026 22:02:50 +0800 Subject: [PATCH v2 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: <20260715-rubikpi-next-20260605-v2-1-67601d7a8581@thundersoft.com> References: <20260715-rubikpi-next-20260605-v2-0-67601d7a8581@thundersoft.com> In-Reply-To: <20260715-rubikpi-next-20260605-v2-0-67601d7a8581@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 , Neil Armstrong , Dmitry Baryshkov , Roger Shimizu , linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Hongyang Zhao , Krzysztof Kozlowski X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784124199; l=1226; i=hongyang.zhao@thundersoft.com; s=20260127; h=from:subject:message-id; bh=Wdq79F7my2vTkDlJ4tgWR9sajb2tA7FaF8yf0n2mnvo=; b=rfxwjNNJL4KJe8aHNGtgqgAflfD5l2lg9YZAWKsnFx4zpXsFN9SKyzqlLq4cnk2Y+27KLuXiW EydftMSGKqUDXwKwm4Rsxav/OTFWhmDT17GLPAgtjr0MMxxkmfHBKfq X-Developer-Key: i=hongyang.zhao@thundersoft.com; a=ed25519; pk=D9yL5W9Zj0lPBDAq9gzY++1849VlXuTWAkROzZ88J/4= X-HM-Tid: 0a9f6616dc1709d5kunm638899c2110ab X-HM-MType: 1 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWRgWCB1ZQUpXWS1ZQUlXWQ8JGhUIEh9ZQVlDH0IaVhgZSE9MHxlPHk5NTVYVFA kWGhdVEwETFhoSFyQUDg9ZV1kYEgtZQVlITVVKSUJVSkhCVUJLWVdZFhoPEhUdFFlBWU9LSFVKS0 lPT09IVUpLS1VKQktLWQY+ DKIM-Signature: a=rsa-sha256; b=GUO69Ko2/rkShfkqSeo/ekIHmOV40N6iY4T+Tw4xd/ThfXvXJpYDxtWUxKIYSCWo7B6iiUx40v8uxH0ay83j+YS9de22UlBvxL8S6k9eVTRLYaKlR3mIeAhTX6b8XRlWR704UGUfAGsfzkjcNXvXFK/xn0KiH8Ve8WAdaoGBQ0Q=; c=relaxed/relaxed; s=default; d=thundersoft.com; v=1; bh=PeRqQcFC5p/CR8zMxUYy+dTkQgSnC19TL3scMvmFpVQ=; 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 fe5d938ca310..a0a4c1c99cf3 100644 --- a/Documentation/devicetree/bindings/sound/everest,es8316.yaml +++ b/Documentation/devicetree/bindings/sound/everest,es8316.yaml @@ -60,6 +60,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 Sat Jul 25 17:34:24 2026 Received: from mail-m49239.qiye.163.com (mail-m49239.qiye.163.com [45.254.49.239]) (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 D7F26385D96; Wed, 15 Jul 2026 16:26:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.254.49.239 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784132771; cv=none; b=pNqI7BuW2n19Bq6W4Rx+T36zSBcXcJzRdHdVXf3pzlIk7EhzTDpwR79ZVOklfX6nXOkchL7xK9Kmq4qHO8FtMUoA29qVi1we+3zSecJlhzrYQ5nEEFMgqn9K1bbLt3wwZu7MvDCe55btjrHdvfD+vZYKj7E6M0M33sc7ERj08NM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784132771; c=relaxed/simple; bh=j59gmiyM0m9SloepWN1XApdWzUBj6iZbH6AyN59eoyY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=d03AR5m4rD/slfSXuY2BTdfxZNetrcuigFjk/jP/V8t7oo5Fu2bAijNqJ6DqIhjhXloTFTtiT2r9P1a/BriMSQEjajxfvXNQSK3Hg2Vqg9h5YSLTcvNLrOM6wSv1VB1GScBxoQCEdnNmAdjlojLD6EhPkEs1o7cOao93r8M3njA= 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=PcKvA9oJ; arc=none smtp.client-ip=45.254.49.239 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="PcKvA9oJ" Received: from [127.0.1.1] (unknown [36.129.139.90]) by smtp.qiye.163.com (Hmail) with ESMTP id 464e8f2ec; Wed, 15 Jul 2026 22:03:23 +0800 (GMT+08:00) From: Hongyang Zhao Date: Wed, 15 Jul 2026 22:02:51 +0800 Subject: [PATCH v2 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: <20260715-rubikpi-next-20260605-v2-2-67601d7a8581@thundersoft.com> References: <20260715-rubikpi-next-20260605-v2-0-67601d7a8581@thundersoft.com> In-Reply-To: <20260715-rubikpi-next-20260605-v2-0-67601d7a8581@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 , Neil Armstrong , Dmitry Baryshkov , Roger Shimizu , linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Hongyang Zhao X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784124199; l=1261; i=hongyang.zhao@thundersoft.com; s=20260127; h=from:subject:message-id; bh=j59gmiyM0m9SloepWN1XApdWzUBj6iZbH6AyN59eoyY=; b=QocW0g5f9HfLcc8tfi48aEEUjDWYX/W2rNI6/7s1lwRXVcPeUtHtuQt/Xz301Y5x9d3gZD9JU HjlYty4scbuC+S5T0J5I6OMHqUlsotPfq6ewEhre4RjYEVVdcPMV9ul X-Developer-Key: i=hongyang.zhao@thundersoft.com; a=ed25519; pk=D9yL5W9Zj0lPBDAq9gzY++1849VlXuTWAkROzZ88J/4= X-HM-Tid: 0a9f6616e34f09d5kunm638899c2110b6 X-HM-MType: 1 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWRgWCB1ZQUpXWS1ZQUlXWQ8JGhUIEh9ZQVkZTUhJVkhDShlOTkhCTUpCGlYVFA kWGhdVEwETFhoSFyQUDg9ZV1kYEgtZQVlITVVKSUJVSkhCVUJLWVdZFhoPEhUdFFlBWU9LSFVKS0 lCQ0NMVUpLS1VLWQY+ DKIM-Signature: a=rsa-sha256; b=PcKvA9oJUpnrUuo4ohXEs4RhSl5tGSTQ2duvffT69uscyb5BjUvbLU9GA4Fa3NJqLpyZCxxZZKapFkSRDeYYsuerd2KBOV1a9EvK8w8fPVXgjusfWkycpwlbTPQKcECHbak4o5EjI+97tlnq4TfxCn/M0BS0+slp7sBr+R5PSD4=; c=relaxed/relaxed; s=default; d=thundersoft.com; v=1; bh=qY4Sy0cy+f1gtRrFtI0Z4FNU/zFBUpZVEYqjSdcrBds=; 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 --- 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 dae440ecab59..01bc494286fb 100644 --- a/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml @@ -49,6 +49,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 Sat Jul 25 17:34:24 2026 Received: from mail-m1973179.qiye.163.com (mail-m1973179.qiye.163.com [220.197.31.79]) (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 DD6EA43B6D8; Wed, 15 Jul 2026 15:19:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.197.31.79 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784128759; cv=none; b=EpvIF8L3sex4WHVeg/OWlXn0ehCdYu3kS2tNOTrwOZu7DrxpRUOfFd9k3wWanueY+nPmzKD73bMyr63piaRphrdwreu9Hl92ohSaKjYFVQ/5twniTYUY0i7r2pNKbBiKrRzjeuWG2lEUWKyOSzmwhazv9S6Nab3rc0RwI5zQf/M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784128759; c=relaxed/simple; bh=id7q/6siL0HW+2DiqBDKxbuVGwyOogsVIO1tAN/r3jo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jFd9iPJC/225OwmLLhcofQnlbfbReFNeP+OtCcKyOkpaVYWu4K+lic4QpbD9JrQOxRh6Qb6Kuj/NnzZR52J8KQMIARsKBD+SPnZ3lYN28MWvJ/qVP8SxPPPEr2na4dlefoos7D3vQ/HD8QoH8yaCIyvagZXtaWaCNClMkFwOpjs= 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=UncHRb1Q; arc=none smtp.client-ip=220.197.31.79 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="UncHRb1Q" Received: from [127.0.1.1] (unknown [36.129.139.90]) by smtp.qiye.163.com (Hmail) with ESMTP id 464e8f2f0; Wed, 15 Jul 2026 22:03:25 +0800 (GMT+08:00) From: Hongyang Zhao Date: Wed, 15 Jul 2026 22:02:52 +0800 Subject: [PATCH v2 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: <20260715-rubikpi-next-20260605-v2-3-67601d7a8581@thundersoft.com> References: <20260715-rubikpi-next-20260605-v2-0-67601d7a8581@thundersoft.com> In-Reply-To: <20260715-rubikpi-next-20260605-v2-0-67601d7a8581@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 , Neil Armstrong , Dmitry Baryshkov , Roger Shimizu , linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Hongyang Zhao X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784124199; l=4189; i=hongyang.zhao@thundersoft.com; s=20260127; h=from:subject:message-id; bh=id7q/6siL0HW+2DiqBDKxbuVGwyOogsVIO1tAN/r3jo=; b=J2zrDj9Lazll+x6uW8OhX/5UH7KwLJb5Pe7N88LDHlSK6iJDLBGa20pWDXgft0WmEVWim3LKr KOQwzlIpbraBfhLsgtMiSF7BPNWqjqlZSELj4j8W2W+zFEVylYChTDv X-Developer-Key: i=hongyang.zhao@thundersoft.com; a=ed25519; pk=D9yL5W9Zj0lPBDAq9gzY++1849VlXuTWAkROzZ88J/4= X-HM-Tid: 0a9f6616ea5209d5kunm638899c2110c5 X-HM-MType: 1 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWRgWCB1ZQUpXWS1ZQUlXWQ8JGhUIEh9ZQVlDGkxJVk4fTENJH05OShpLGFYVFA kWGhdVEwETFhoSFyQUDg9ZV1kYEgtZQVlITVVKSUJVSkhCVUJLWVdZFhoPEhUdFFlBWU9LSFVKS0 lPT09IVUpLS1VKQktLWQY+ DKIM-Signature: a=rsa-sha256; b=UncHRb1Q9/wlqdnY+9YS3/kK+CyRh9DlX9CLXzYQU/7t0cdVCzjl+yYfINHvzlyWgtVEogGJOZ4rkKDAJF1qOWNZ3kJRpO7U3+Lb7h2t5MPhcbSiBT8oK4zK0PeCbiGT+TC7MZjCKhVogrJqyrgJcw3+eJn1FpweA2W1IiwBdtg=; c=relaxed/relaxed; s=default; d=thundersoft.com; v=1; bh=RLuAC66DUpAVIdiO/b90btB9K++9bJ1owk3sFGrqr1U=; 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. 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 edc4611691f7..c48819a0ed78 100644 --- a/sound/soc/qcom/common.c +++ b/sound/soc/qcom/common.c @@ -184,13 +184,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", @@ -214,6 +212,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 TX_CODEC_DMA_TX_0: case TX_CODEC_DMA_TX_1: @@ -232,8 +279,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 ee6662885593..0a255b08e873 100644 --- a/sound/soc/qcom/common.h +++ b/sound/soc/qcom/common.h @@ -10,6 +10,9 @@ #define LPASS_MAX_PORT (SENARY_MI2S_TX + 1) =20 int qcom_snd_parse_of(struct snd_soc_card *card); +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 Sat Jul 25 17:34:24 2026 Received: from mail-m49235.qiye.163.com (mail-m49235.qiye.163.com [45.254.49.235]) (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 9B875377A91; Wed, 15 Jul 2026 23:07:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.254.49.235 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784156834; cv=none; b=LWsa6V8SnPp75wold3ihzuoVsRyQgP8zXiy90COyAx0ZjFcrx4qzjAyeW0ggnaCEMOuphmeEo58aAkb7bJf2N46R0Yltj1XdKWrMxqKRigIiA5prcCc4QFAC+rTeOIUmV5MlPpV6QNLIiNBFbpa6WhD6sTYqTir3v6iUPhUG0AA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784156834; c=relaxed/simple; bh=pym3ys4a4I/PlTQKqWWuqhExcu3Ko942hk/0hFZFKT0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=G2LvpWJyDNEJRxtfUXlCgIEf/e4D7rALC4Hpsxw/Q04di1slEQDNMfcAmVERAeTes3xS2CeOp13H18qjaiXFQSyUDDnUOEvc4EELJuky9AMtDUGGb1Y2d8zaVb2TofbUViopOX7VkD2EvuHqxlbYDmKznGBX6oGoQ2RWcCDcLVQ= 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=iLf7PKzk; arc=none smtp.client-ip=45.254.49.235 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="iLf7PKzk" Received: from [127.0.1.1] (unknown [36.129.139.90]) by smtp.qiye.163.com (Hmail) with ESMTP id 464e8f2f3; Wed, 15 Jul 2026 22:03:27 +0800 (GMT+08:00) From: Hongyang Zhao Date: Wed, 15 Jul 2026 22:02:53 +0800 Subject: [PATCH v2 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: <20260715-rubikpi-next-20260605-v2-4-67601d7a8581@thundersoft.com> References: <20260715-rubikpi-next-20260605-v2-0-67601d7a8581@thundersoft.com> In-Reply-To: <20260715-rubikpi-next-20260605-v2-0-67601d7a8581@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 , Neil Armstrong , Dmitry Baryshkov , Roger Shimizu , linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Hongyang Zhao X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784124199; l=10637; i=hongyang.zhao@thundersoft.com; s=20260127; h=from:subject:message-id; bh=pym3ys4a4I/PlTQKqWWuqhExcu3Ko942hk/0hFZFKT0=; b=tqmAX7BClXxZP/cAP9my4bkHf34eo4U7lyGfOjAP4xFP2wDRsNNlrsaWP/j+0eEyk0DQCWMWB yCcCy8yEk72DVtE+5h9QqGVq7IMBDNGWXB2gvSGrnhhJUVBFtsyWSWp X-Developer-Key: i=hongyang.zhao@thundersoft.com; a=ed25519; pk=D9yL5W9Zj0lPBDAq9gzY++1849VlXuTWAkROzZ88J/4= X-HM-Tid: 0a9f6616f16c09d5kunm638899c2110d2 X-HM-MType: 1 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWRgWCB1ZQUpXWS1ZQUlXWQ8JGhUIEh9ZQVkaGRpJVhgZQ0xOGkIdGExNQlYVFA kWGhdVEwETFhoSFyQUDg9ZV1kYEgtZQVlITVVKSUJVSkhCVUJLWVdZFhoPEhUdFFlBWU9LSFVKS0 lPT09IVUpLS1VKQktLWQY+ DKIM-Signature: a=rsa-sha256; b=iLf7PKzkAZLn2Lqhkt0G7ZCX5TWMNyIbsLW5FBXkJTVCf5MdiG/BNhrbqdPNi08NEVFp01pT89x5Nfhvkw3pRyGfXSN6SyZv5pZBGWv9ZhRFPsJg2fbP19uiiy60MRy0wSTDu//xOG81RbYso3LTZ9sY4+ftZZ4KiFa722guHDY=; c=relaxed/relaxed; s=default; d=thundersoft.com; v=1; bh=AjZzpRCBTCU0/iL7rxIauV+73yrP3obTwHijRJow0/I=; h=date:mime-version:subject:message-id:from; The board data currently applies codec format, sysclk, MI2S clock and jack setup policy to every backend DAI on a sound card. That works for boards with a uniform audio topology, but it cannot describe a card which connects codecs with different clock requirements to different MI2S interfaces. Introduce an optional per-DAI configuration table indexed by the CPU DAI ID. Each entry can select the codec DAI format, override the MCLK rate, enable CPU MCLK and BCLK programming, request codec sysclk setup and choose the jack setup path. Use one jack setup enum instead of unrelated boolean flags so a DAI cannot select conflicting setup methods. Migrate the existing WCD headset cards to the new representation. All in-tree WCD capture links handled by this driver use TX_CODEC_DMA_TX_3; cards sharing a compatible but lacking that link simply have no matching runtime. This preserves existing behavior while allowing mixed-codec cards to configure each link independently. Signed-off-by: Hongyang Zhao --- sound/soc/qcom/sc8280xp.c | 138 ++++++++++++++++++++++++++++++++++++++----= ---- 1 file changed, 115 insertions(+), 23 deletions(-) diff --git a/sound/soc/qcom/sc8280xp.c b/sound/soc/qcom/sc8280xp.c index 109e39b93b2d..885ec1e3e575 100644 --- a/sound/soc/qcom/sc8280xp.c +++ b/sound/soc/qcom/sc8280xp.c @@ -37,6 +37,26 @@ static struct snd_soc_dapm_widget sc8280xp_dapm_widgets[= ] =3D { SND_SOC_DAPM_SPK("DP7 Jack", 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 codec_dai_fmt; + 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 snd_soc_common { const char *driver_name; const struct snd_soc_dapm_widget *dapm_widgets; @@ -45,11 +65,8 @@ struct snd_soc_common { int num_dapm_routes; const struct snd_kcontrol_new *controls; int num_controls; - unsigned int codec_dai_fmt; - bool codec_sysclk_set; - bool mi2s_mclk_enable; - bool mi2s_bclk_enable; - bool wcd_jack; + const struct sc8280xp_dai_data *dai_data; + size_t num_dai_data; }; =20 struct sc8280xp_snd_data { @@ -61,6 +78,20 @@ struct sc8280xp_snd_data { bool jack_setup; }; =20 +static const struct sc8280xp_dai_data *sc8280xp_get_dai_data( + const struct 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); @@ -88,10 +119,14 @@ static int sc8280xp_snd_init(struct snd_soc_pcm_runtim= e *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->snd_soc_common_priv, + cpu_dai->id); + switch (cpu_dai->id) { case WSA_CODEC_DMA_RX_0: case WSA_CODEC_DMA_RX_1: @@ -121,10 +156,18 @@ 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->snd_soc_common_priv->wcd_jack) - return qcom_snd_wcd_jack_setup(rtd, &data->jack, &data->jack_setup); + if (!dai_data) + return 0; =20 - 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, @@ -163,10 +206,17 @@ 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; + int mclk_freq; int bclk_freq =3D sc8280xp_get_bclk_freq(params); int ret; =20 + dai_data =3D sc8280xp_get_dai_data(data->snd_soc_common_priv, + cpu_dai->id); + mclk_freq =3D dai_data && dai_data->mclk_rate ? + dai_data->mclk_rate : + sc8280xp_get_mclk_freq(params); + switch (cpu_dai->id) { case PRIMARY_MI2S_RX ... QUATERNARY_MI2S_TX: case QUINARY_MI2S_RX ... QUINARY_MI2S_TX: @@ -175,14 +225,14 @@ static int sc8280xp_snd_hw_params(struct snd_pcm_subs= tream *substream, if (ret && ret !=3D -EOPNOTSUPP) return ret; =20 - if (data->snd_soc_common_priv->codec_dai_fmt) { + if (dai_data && dai_data->codec_dai_fmt) { ret =3D snd_soc_dai_set_fmt(codec_dai, - data->snd_soc_common_priv->codec_dai_fmt); + dai_data->codec_dai_fmt); if (ret && ret !=3D -EOPNOTSUPP) return ret; } =20 - if (data->snd_soc_common_priv->mi2s_mclk_enable) { + if (dai_data && dai_data->mi2s_mclk_enable) { ret =3D snd_soc_dai_set_sysclk(cpu_dai, LPAIF_MI2S_MCLK, mclk_freq, SND_SOC_CLOCK_OUT); @@ -190,7 +240,7 @@ static int sc8280xp_snd_hw_params(struct snd_pcm_substr= eam *substream, return ret; } =20 - if (data->snd_soc_common_priv->mi2s_bclk_enable) { + if (dai_data && dai_data->mi2s_bclk_enable) { ret =3D snd_soc_dai_set_sysclk(cpu_dai, LPAIF_MI2S_BCLK, bclk_freq, SND_SOC_CLOCK_OUT); @@ -198,7 +248,7 @@ static int sc8280xp_snd_hw_params(struct snd_pcm_substr= eam *substream, return ret; } =20 - if (data->snd_soc_common_priv->codec_sysclk_set) { + if (dai_data && dai_data->codec_sysclk_set) { ret =3D snd_soc_dai_set_sysclk(codec_dai, 0, mclk_freq, SND_SOC_CLOCK_IN); @@ -231,6 +281,20 @@ 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->snd_soc_common_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, @@ -247,6 +311,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; } @@ -297,14 +362,20 @@ static const struct snd_soc_common eliza_priv_data = =3D { .driver_name =3D "eliza", .dapm_widgets =3D sc8280xp_dapm_widgets, .num_dapm_widgets =3D ARRAY_SIZE(sc8280xp_dapm_widgets), - .wcd_jack =3D true, + SC8280XP_DAI_DATA({ + .id =3D TX_CODEC_DMA_TX_3, + .jack_setup =3D SC8280XP_JACK_SETUP_WCD, + }), }; =20 static const struct snd_soc_common kaanapali_priv_data =3D { .driver_name =3D "kaanapali", .dapm_widgets =3D sc8280xp_dapm_widgets, .num_dapm_widgets =3D ARRAY_SIZE(sc8280xp_dapm_widgets), - .wcd_jack =3D true, + SC8280XP_DAI_DATA({ + .id =3D TX_CODEC_DMA_TX_3, + .jack_setup =3D SC8280XP_JACK_SETUP_WCD, + }), }; =20 static const struct snd_soc_common qcs9100_priv_data =3D { @@ -323,14 +394,20 @@ static const struct snd_soc_common qcm6490_priv_data = =3D { .driver_name =3D "qcm6490", .dapm_widgets =3D sc8280xp_dapm_widgets, .num_dapm_widgets =3D ARRAY_SIZE(sc8280xp_dapm_widgets), - .wcd_jack =3D true, + SC8280XP_DAI_DATA({ + .id =3D TX_CODEC_DMA_TX_3, + .jack_setup =3D SC8280XP_JACK_SETUP_WCD, + }), }; =20 static const struct snd_soc_common qcs6490_priv_data =3D { .driver_name =3D "qcs6490", .dapm_widgets =3D sc8280xp_dapm_widgets, .num_dapm_widgets =3D ARRAY_SIZE(sc8280xp_dapm_widgets), - .wcd_jack =3D true, + SC8280XP_DAI_DATA({ + .id =3D TX_CODEC_DMA_TX_3, + .jack_setup =3D SC8280XP_JACK_SETUP_WCD, + }), }; =20 static const struct snd_soc_common qcs8275_priv_data =3D { @@ -343,35 +420,50 @@ static const struct snd_soc_common sc8280xp_priv_data= =3D { .driver_name =3D "sc8280xp", .dapm_widgets =3D sc8280xp_dapm_widgets, .num_dapm_widgets =3D ARRAY_SIZE(sc8280xp_dapm_widgets), - .wcd_jack =3D true, + SC8280XP_DAI_DATA({ + .id =3D TX_CODEC_DMA_TX_3, + .jack_setup =3D SC8280XP_JACK_SETUP_WCD, + }), }; =20 static const struct snd_soc_common sm8450_priv_data =3D { .driver_name =3D "sm8450", .dapm_widgets =3D sc8280xp_dapm_widgets, .num_dapm_widgets =3D ARRAY_SIZE(sc8280xp_dapm_widgets), - .wcd_jack =3D true, + SC8280XP_DAI_DATA({ + .id =3D TX_CODEC_DMA_TX_3, + .jack_setup =3D SC8280XP_JACK_SETUP_WCD, + }), }; =20 static const struct snd_soc_common sm8550_priv_data =3D { .driver_name =3D "sm8550", .dapm_widgets =3D sc8280xp_dapm_widgets, .num_dapm_widgets =3D ARRAY_SIZE(sc8280xp_dapm_widgets), - .wcd_jack =3D true, + SC8280XP_DAI_DATA({ + .id =3D TX_CODEC_DMA_TX_3, + .jack_setup =3D SC8280XP_JACK_SETUP_WCD, + }), }; =20 static const struct snd_soc_common sm8650_priv_data =3D { .driver_name =3D "sm8650", .dapm_widgets =3D sc8280xp_dapm_widgets, .num_dapm_widgets =3D ARRAY_SIZE(sc8280xp_dapm_widgets), - .wcd_jack =3D true, + SC8280XP_DAI_DATA({ + .id =3D TX_CODEC_DMA_TX_3, + .jack_setup =3D SC8280XP_JACK_SETUP_WCD, + }), }; =20 static const struct snd_soc_common sm8750_priv_data =3D { .driver_name =3D "sm8750", .dapm_widgets =3D sc8280xp_dapm_widgets, .num_dapm_widgets =3D ARRAY_SIZE(sc8280xp_dapm_widgets), - .wcd_jack =3D true, + SC8280XP_DAI_DATA({ + .id =3D TX_CODEC_DMA_TX_3, + .jack_setup =3D SC8280XP_JACK_SETUP_WCD, + }), }; =20 static const struct of_device_id snd_sc8280xp_dt_match[] =3D { --=20 2.43.0 From nobody Sat Jul 25 17:34:24 2026 Received: from mail-m32107.qiye.163.com (mail-m32107.qiye.163.com [220.197.32.107]) (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 D87F0480950; Wed, 15 Jul 2026 15:19:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.197.32.107 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784128759; cv=none; b=EFXLJUgPL6qi8hsGVgyOGfpiAPzyHffrBltcicuZirAsY7iIg8SzIr5yWgj4zTuXeA2Fvvm+aY8e0uc0Z02ZMZaVjpPKAaGid57/UcOoRRT+7XNPaGDRAIyTAytMhrC4OBFhXXvPMOTLTj79uHXdJ9Ycav2OPqcRJm8/JbHq5qA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784128759; c=relaxed/simple; bh=bq8g9xkHiuWTkk3XAF0GfB67818hIQ3ys42KjTG2uy4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Ty9FBUXaFiO1OxLPgXMi49lSDa54tH/uGvkoe0PylbYJLPEO0xMDKAuV2LJ7bjOnX64YP1OMy2RDUt33SpBSHsr4AQaaDEuVLzsMXhTex66fSSD274+V4bl24eEZNbAly4lTCGEhy1EIhGh69s7p9gZGmxpJVxRC1uqWOEPvGWg= 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=k+egMmu7; arc=none smtp.client-ip=220.197.32.107 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="k+egMmu7" Received: from [127.0.1.1] (unknown [36.129.139.90]) by smtp.qiye.163.com (Hmail) with ESMTP id 464e8f2f7; Wed, 15 Jul 2026 22:03:29 +0800 (GMT+08:00) From: Hongyang Zhao Date: Wed, 15 Jul 2026 22:02:54 +0800 Subject: [PATCH v2 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: <20260715-rubikpi-next-20260605-v2-5-67601d7a8581@thundersoft.com> References: <20260715-rubikpi-next-20260605-v2-0-67601d7a8581@thundersoft.com> In-Reply-To: <20260715-rubikpi-next-20260605-v2-0-67601d7a8581@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 , Neil Armstrong , Dmitry Baryshkov , Roger Shimizu , linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Hongyang Zhao X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784124199; l=2744; i=hongyang.zhao@thundersoft.com; s=20260127; h=from:subject:message-id; bh=bq8g9xkHiuWTkk3XAF0GfB67818hIQ3ys42KjTG2uy4=; b=TU7Y/vfqmmE3PBsbqNs4aV/CQQffqcLkoSLbTM0lIPPmV0JfO1gyXi39GOLkApezBiAvz6Tp6 WZu4NSZ8D/4AkOgJKsOXi6Qz2qjcZAYPqFQJK6BbFtQd+TjpRj+xR/O X-Developer-Key: i=hongyang.zhao@thundersoft.com; a=ed25519; pk=D9yL5W9Zj0lPBDAq9gzY++1849VlXuTWAkROzZ88J/4= X-HM-Tid: 0a9f6616f8a409d5kunm638899c2110dd X-HM-MType: 1 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWRgWCB1ZQUpXWS1ZQUlXWQ8JGhUIEh9ZQVkZGhlKVkwfHUsYHklKQh1JSVYVFA kWGhdVEwETFhoSFyQUDg9ZV1kYEgtZQVlITVVKSUJVSkhCVUJLWVdZFhoPEhUdFFlBWU9LSFVKS0 lPT09IVUpLS1VKQktLWQY+ DKIM-Signature: a=rsa-sha256; b=k+egMmu7mBB0s1EmV64EDydgX7fiejPU7BYLztvt0twcKzu5Ah7CkB0NnFPkxIX06ZmnuDDEQnuCLtzT2Lq0IkiqTb725a0E+TbH9/gzBpr8fn5/NrULl4+A0LMEc2xHhxgIYZ/zObH5e/Gss1zuonGYPxYteAXVITeJni14AfQ=; c=relaxed/relaxed; s=default; d=thundersoft.com; v=1; bh=sF1yQe3cHSrdtvnwidVs42rm5Q0btdZJti8KGLZLjp4=; h=date:mime-version:subject:message-id:from; RubikPi 3 connects an ES8316 codec to the primary MI2S interface for headset playback and capture, and an LT9611 bridge to the quaternary MI2S interface for HDMI audio. Add board-specific DAI data for these links. Configure both directions of the primary interface for I2S with normal clock polarity and the codec as bit and frame clock consumer. Program the LPASS MCLK and BCLK, drive the ES8316 with its required 19.2 MHz MCLK, and enable the generic codec jack-detection setup on the playback link. Configure the quaternary playback link with the same I2S clock format. Do not request a codec sysclk for this link because the LT9611 HDMI 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 | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/sound/soc/qcom/sc8280xp.c b/sound/soc/qcom/sc8280xp.c index 885ec1e3e575..1354eecb56c9 100644 --- a/sound/soc/qcom/sc8280xp.c +++ b/sound/soc/qcom/sc8280xp.c @@ -410,6 +410,41 @@ static const struct snd_soc_common qcs6490_priv_data = =3D { }), }; =20 +static const struct snd_soc_common qcs6490_rubikpi3_priv_data =3D { + .driver_name =3D "qcs6490", + .dapm_widgets =3D sc8280xp_dapm_widgets, + .num_dapm_widgets =3D ARRAY_SIZE(sc8280xp_dapm_widgets), + SC8280XP_DAI_DATA( + { + .id =3D PRIMARY_MI2S_RX, + .codec_dai_fmt =3D SND_SOC_DAIFMT_I2S | + SND_SOC_DAIFMT_NB_NF | + SND_SOC_DAIFMT_BC_FC, + .mclk_rate =3D 19200000, + .codec_sysclk_set =3D true, + .mi2s_mclk_enable =3D true, + .mi2s_bclk_enable =3D true, + .jack_setup =3D SC8280XP_JACK_SETUP_CODEC, + }, + { + .id =3D PRIMARY_MI2S_TX, + .codec_dai_fmt =3D SND_SOC_DAIFMT_I2S | + SND_SOC_DAIFMT_NB_NF | + SND_SOC_DAIFMT_BC_FC, + .mclk_rate =3D 19200000, + .codec_sysclk_set =3D true, + .mi2s_mclk_enable =3D true, + .mi2s_bclk_enable =3D true, + }, + { + .id =3D QUATERNARY_MI2S_RX, + .codec_dai_fmt =3D SND_SOC_DAIFMT_I2S | + SND_SOC_DAIFMT_NB_NF | + SND_SOC_DAIFMT_BC_FC, + } + ), +}; + static const struct snd_soc_common qcs8275_priv_data =3D { .driver_name =3D "qcs8300", .dapm_widgets =3D sc8280xp_dapm_widgets, @@ -480,6 +515,10 @@ static const struct of_device_id snd_sc8280xp_dt_match= [] =3D { { .compatible =3D "qcom,sm8550-sndcard", .data =3D &sm8550_priv_data }, { .compatible =3D "qcom,sm8650-sndcard", .data =3D &sm8650_priv_data }, { .compatible =3D "qcom,sm8750-sndcard", .data =3D &sm8750_priv_data }, + { + .compatible =3D "thundercomm,qcs6490-rubikpi3-sndcard", + .data =3D &qcs6490_rubikpi3_priv_data, + }, {} }; =20 --=20 2.43.0 From nobody Sat Jul 25 17:34:24 2026 Received: from mail-m49212.qiye.163.com (mail-m49212.qiye.163.com [45.254.49.212]) (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 2D86C481AB1; Wed, 15 Jul 2026 14:39:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.254.49.212 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784126352; cv=none; b=pEl5PKP1021CTKUF8NvqSZUt+ONSv4V5ssRDmL8sCMUQynnJJRTU32UKEUOd37lTGJj1/3MyWhkV6XHyRd+kVNiB8+z2HB5ryBQwDQiqY5xZh3dMK8JXcDhh3RsFF82sS0X/9C7ga3R93M3USiI/CSpDhR8eM8WWdPOGC2oGuUQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784126352; c=relaxed/simple; bh=37/eIE6ZyoykW9qcmjvRNppm3Qrq2RAca+6HHr39rrs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ipzPG4QRmnMKVlX5S7wlLtfk0yzipGDPxjhIswEC7AAEsV0f1E+0MKUutvLDe/uGnguJldsSoI5OxBdp47xkaNOTlZWjA5CXtGho9PegkjAeCWUfSpEinejm8+0PXH3ROEddTIAg5rgX0YiVGDLLe29faM9yFSeJUImqpram1oY= 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=lVAnhBO7; arc=none smtp.client-ip=45.254.49.212 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="lVAnhBO7" Received: from [127.0.1.1] (unknown [36.129.139.90]) by smtp.qiye.163.com (Hmail) with ESMTP id 464e8f2fb; Wed, 15 Jul 2026 22:03:31 +0800 (GMT+08:00) From: Hongyang Zhao Date: Wed, 15 Jul 2026 22:02:55 +0800 Subject: [PATCH v2 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: <20260715-rubikpi-next-20260605-v2-6-67601d7a8581@thundersoft.com> References: <20260715-rubikpi-next-20260605-v2-0-67601d7a8581@thundersoft.com> In-Reply-To: <20260715-rubikpi-next-20260605-v2-0-67601d7a8581@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 , Neil Armstrong , Dmitry Baryshkov , Roger Shimizu , linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Hongyang Zhao X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784124199; l=6119; i=hongyang.zhao@thundersoft.com; s=20260127; h=from:subject:message-id; bh=37/eIE6ZyoykW9qcmjvRNppm3Qrq2RAca+6HHr39rrs=; b=5gV3AsxTFuIXQ/xNOYiMZ++cMahykiBIv6TC/ws+vWL1a8UW3OLweCaR1Now2W3Fw8WIM1u1w q/STAxORYTOCVeJd3Rb309RG0dtSG6fB4BPooJuPeZf1B4m3dbq7w+A X-Developer-Key: i=hongyang.zhao@thundersoft.com; a=ed25519; pk=D9yL5W9Zj0lPBDAq9gzY++1849VlXuTWAkROzZ88J/4= X-HM-Tid: 0a9f6616ffa909d5kunm638899c2110ed X-HM-MType: 1 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWRgWCB1ZQUpXWS1ZQUlXWQ8JGhUIEh9ZQVlCSxkaVkkdShlDS0xISE9OTVYVFA kWGhdVEwETFhoSFyQUDg9ZV1kYEgtZQVlITVVKSUJVSkhCVUJLWVdZFhoPEhUdFFlBWU9LSFVKS0 lPT09IVUpLS1VKQktLWQY+ DKIM-Signature: a=rsa-sha256; b=lVAnhBO7D4NfCHhIGW+uGY7quwF0WEw7LPKD2QR2+pp2ueBdNd+RxpSpsf4NP3m9j7ppW2RSzHaqPZk8/gsHr7LSgvPMGmPBVjBHaplnCMedLAZbeXOdDJvYV/Gx0u/Y3FI2P09wkmdN6OXzhzL0HR+Ig95SYIQA5tFoArDZHNA=; c=relaxed/relaxed; s=default; d=thundersoft.com; v=1; bh=9EvdO9zEG7pNBSuQ5zgt/ZM8eLjAVcGVGFqL+zaxUnE=; h=date:mime-version:subject:message-id:from; RubikPi 3 uses the AudioReach firmware path for its external audio interfaces. The primary MI2S interface connects to an ES8316 codec for headset playback and capture, while the quaternary MI2S interface feeds the LT9611 HDMI bridge. Enable the AudioReach description and add the three DAI links. Describe the primary MI2S MCLK and bit clock inputs under the backend DAI so the machine driver can control them. Add the primary and quaternary pin configurations to the sound card and make the LT9611 codec DAI addressable. Describe the ES8316, its 3.3 V enable supply, 19.2 MHz MCLK and inverted GPIO jack-detect signal. Route the codec headphone outputs and microphone input to the board headset connector. Signed-off-by: Hongyang Zhao --- .../boot/dts/qcom/qcs6490-thundercomm-rubikpi3.dts | 159 +++++++++++++++++= ++++ 1 file changed, 159 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 d8a9a7e47bdc..7b010823d692 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,23 @@ fan0: pwm-fan { pinctrl-names =3D "default"; }; =20 + 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; + + pinctrl-0 =3D <&es8316_power_on>; + pinctrl-names =3D "default"; + + regulator-always-on; + regulator-boot-on; + }; + vreg_eth_1v8: regulator-eth-1v8 { compatible =3D "regulator-fixed"; =20 @@ -727,6 +745,26 @@ &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>; + + 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"; @@ -740,6 +778,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>; @@ -978,6 +1017,27 @@ &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_MCLK_1 LPASS_CLK_ATTRIBUTE_COUPLE_NO>, + <&q6prmcc LPASS_CLK_ID_PRI_MI2S_IBIT LPASS_CLK_ATTRIBUTE_COUPLE_NO>; + clock-names =3D "mclk", + "bclk"; + }; + + dai@11 { + reg =3D ; + clocks =3D <&q6prmcc LPASS_CLK_ID_MCLK_1 LPASS_CLK_ATTRIBUTE_COUPLE_NO>, + <&q6prmcc LPASS_CLK_ID_PRI_MI2S_IBIT LPASS_CLK_ATTRIBUTE_COUPLE_NO>; + clock-names =3D "mclk", + "bclk"; + }; +}; + &qupv3_id_0 { firmware-name =3D "qcom/qcm6490/qupv3fw.elf"; =20 @@ -1014,6 +1074,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-playback-dai-link { + link-name =3D "MI2S-LPAIF-RX-PRIMARY"; + + codec { + sound-dai =3D <&es8316>; + }; + + cpu { + sound-dai =3D <&q6apmbedai PRIMARY_MI2S_RX>; + }; + + platform { + sound-dai =3D <&q6apm>; + }; + }; + + mi2s-capture-dai-link { + link-name =3D "MI2S-LPAIF-TX-PRIMARY"; + + codec { + sound-dai =3D <&es8316>; + }; + + cpu { + sound-dai =3D <&q6apmbedai PRIMARY_MI2S_TX>; + }; + + platform { + sound-dai =3D <&q6apm>; + }; + }; + + quaternary-mi2s-playback-dai-link { + link-name =3D "MI2S-LPAIF_RXTX-RX-PRIMARY"; + + 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"; @@ -1228,6 +1351,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"; @@ -1366,6 +1512,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"; @@ -1395,6 +1547,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