Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.49 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795962326; b=ojZU4vbjGX+4g7lnqF5bcSHqy5JY/ogELt+huWLCJxhg78n0YsQ/NlowrmwU8rTVceuS dPKMlLef1TYDr9zuTfwnXPRvkBuK2WttSbG5uS0Y7YuXrCv7SYFG1lftqCvOlex9jnRh9 UMIzZ6qsN4Dp+OZclE0NFI0RjiOiJknekH8a9RZWRvTVTo9jGFpDViT7011qTf5cjx0IT 88RHXjQJIkUio8TdUgT3X0zOIot5lIowBu7hfIk2q5ZCzc/2nSyzVOliA8s4I0Q+Kf702 OMu4/zScAqS0iMsFQyoA4M1Pj0IU20Z+dzIk1w9cIiFV+RSNrro5gvWLvyKDeAt63hg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795962326; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=DnkyVAElvB7S8xXhzRzmcR9zKNPBCxUoPexfpn7jO/0=; b=RIWWcWQt19jEOB49StliDtncevLjA5tQ/MhkxRGdMprymQiZbI3QVOtxSfye+B/V70mG OkfeNRTQTYOWtg7W1jjlVyJXTVZloootLfYA55+qoHx8iqE95JqSVTa9ydHycOrS7nN2L x9Q/6eH3owtQqEdbIPY0EMmB5szsSWCnWmed+ACbprASrRJHmrPr+ETPMlEp8PV8t7fJ1 Xp53MTgUJxFcmL5lcIu4jjsBdW804yyIRW4kFurMEglXFYPSltaC7qt82Mi5bTCcZJ1T7 ABaM3guaRf3n1StnT58Uckb0u3R+iurN7GYVm9RH6TLXGoDcvsoVy7ALenSXoILX2Ow== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=riXqkYNX; arc=none smtp.remote-ip=209.85.128.49 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D920C606A323 for ; Sun, 29 Nov 2026 14:25:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D920C606A323 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=riXqkYNX Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4bb85e07aadso118469545e9.1 for ; Sun, 29 Nov 2026 06:25:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1795962324; x=1796567124; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=DnkyVAElvB7S8xXhzRzmcR9zKNPBCxUoPexfpn7jO/0=; b=riXqkYNXRPxBnYa1DgTD55gBc66LFDHNOLCY/5bxyn+q44IWuEqvMevWLH00CqH6Pl CgehbPwePbQXblr5LhXhnpBpcYGXqZOuqqFsZsFc6jVgkmRdmY90pA8L5z0T7aTelywK ToqZcHezyzvBOJmbjJJb1Bh5T+F93UrBpq3vClJqtFwTshG4trwSZumamOZ+tpWstmEA cdnkucFP2zYKFQgUVQvm0+WMNYH9ICa1Ins0ioRdyXmNxI3KZeCs7al5ol8id0dH+Ugn 9TiQw/dX39VVe1iai+3Sgk5gLVpP8GNaPi+K46uVtA/S4P8E+8UoMHBrB33GSkEAS935 3dUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795962324; x=1796567124; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=DnkyVAElvB7S8xXhzRzmcR9zKNPBCxUoPexfpn7jO/0=; b=cMqhp2U6WnZbfOkbEUzSb+SjlEL3HrouH5q2qLBixYx7GPH0FK3GPYCt2hbYyyHdY7 yq2EkvmTckvgg/7WaE5ZbRrCoi7yL+rDSPeAH2M0+wfXi84beljqW1ShJiZ9jAwFIJ53 TTrRFfkztBkS0ZeBQSjJ/kWvo/ustKL5aU5e/JbfQ0K5X6bqy8p6VEFUL6rT1PJUuIpo e2ubCPD2AKm1QD7wC5dmmz0M+NcMAE4bwe9CrxpjYP7aTx2Nr4yd5sC9abwFYfm/y8ol zetHJtdrWquOzjHBnf+EM+FkSvtm/H7giQE3nsFvOKF3Dnynft1hzYBlH0EEkHq+Kqdw 9Baw== X-Forwarded-Encrypted: i=1; AL+hErG4zbYFiTjjmj7XbirIJPPggF9I5JPgYf8xvFSNKyhsemKg7ko1Du8U2339LgKQIX3pSIXDOUE5nFL0sDUB@vger.kernel.org X-Gm-Message-State: APuU4Z8V+ujGpQ2ilbrNs58kIN/XKxZUR+nUER57Ly8rSv00DdYXNJLP aayT/DavFcKrCM9hiCjkpXYYye0Jmj/PYkZrl0yXGaYXR9ZyNISDQP/e X-Gm-Gg: AZFdTZfUBhpt4rccTMnXq193VILsAEkbVA/5acfnQ1gEm+rZGC5t/onW/4oOoThX8/q RrVz03BWTQvLp3LtStwnxAXPaXnG8/s0XHhev2HEMRNrRTEHoPwsf7YnRjqrF38kbO+p+JD2HnK MeAt5oYcdGHZwNSiycG/DwXPiCUDY8Ax3oqNr5fJZ79jIt8MuW2qSWOVvZPunA31VcFxtuwPXr0 ov8bqZUBLoY9D8+adhUGLWSIC54fnUPJS5xJBoCS0AIBSKzFN6PNIIydG/zz1AoRt2KdSfa9fzV MZWXUlbuZQUM8Wcf9Ah/LqmvZBAthkPxU/ZbRpP64EeoSjbKF+9ZMxBwBBUWr3DDJj7MNGX+xOy LowGS9xalrysvQ3/tutpLcOgeh3QJX3TMMCuLIJmnODQqypSPOsz+lBLgJkDOzIcfCDOrOMVHKz swqrcp/DtxP7FGmGylqvCSoFXsgTXHzhoyYkBeU6SMp8tbKVXLpV6prlTiomHUlIk7p6fSrHcYG mIAxyXR8IODlwq9DeHQKSIuMk/+PMrHNIGUJi8WfJLgPW1eLisUvqEB3Fb7FlQdQO35aTwWLu1u 3AvRmTkUIoO3NO9PKuELPK5aEIT/H0ZI9GUw+I6iOH5NZ3m9FY3pOnsqM/Zz3AxjHHBQHqvp3qx HZQ== X-Received: by 2002:a05:600c:530e:b0:4b2:2ec5:8a2b with SMTP id 5b1f17b1804b1-4bb887fe8f1mr599875565e9.10.1795962324182; Sun, 29 Nov 2026 06:25:24 -0800 (PST) Received: from localhost.localdomain ([188.190.249.216]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb8538b09bsm1539298575e9.4.2026.11.29.06.25.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Nov 2026 06:25:23 -0800 (PST) From: Vladyslav Tymoshchuk To: srini@kernel.org, broonie@kernel.org Cc: lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, tyler.baker@oss.qualcomm.com, linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ASoC: qcom: sc8280xp: recreate the headset jack on card rebind for WCD codecs Date: Sun, 29 Nov 2026 16:25:12 +0200 Message-ID: <20261129142512.1727-1-tvlad744@gmail.com> X-Mailer: git-send-email 2.45.1.windows.1 X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The headset jack is only created while jack_setup is false, and sc8280xp_snd_exit() clears it only for the boards that set the jack up on a codec link. On boards with a WCD codec it stays true, so after a card rebind, for example after an ADSP restart, the jack is not created again and the codec is given a jack that was already freed. Clear it for the WCD boards too, like commit 704251f9dad3 ("ASoC: qcom: x1e80100: recreate the headset jack on card rebind") does for x1e80100. Fixes: 295aeea6646a ("ASoC: qcom: add machine driver for sc8280xp") Signed-off-by: Vladyslav Tymoshchuk --- Tested on a OnePlus Pad 3 (SM8750, WCD939x; the board DT is not upstream yet): unbind and bind one of the speaker amplifiers, so that the card is unbound and bound again, three times: jack controls after the rebind without the change 0/3 with the change 3/3 With the change the speakers stay selected. Without it PipeWire switched to the headphones profile. An ADSP restart behaves the same (5 restarts with the change). I did not test with headphones plugged in after the rebind. The test kernels are v7.3-rc5 plus board patches, where the driver has no per-DAI data, so only the wcd_jack path was run. The kernel with the change also had other patches for ADSP restart. On next-20261127 I only built the patch. I used an AI assistant (Claude) to find the problem and write the patch. sound/soc/qcom/sc8280xp.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/sound/soc/qcom/sc8280xp.c b/sound/soc/qcom/sc8280xp.c index ac4dfb2c2182..15252e800c53 100644 --- a/sound/soc/qcom/sc8280xp.c +++ b/sound/soc/qcom/sc8280xp.c @@ -523,11 +523,21 @@ static void sc8280xp_snd_exit(struct snd_soc_pcm_runtime *rtd) struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0); const struct sc8280xp_dai_data *dai_data; - dai_data = sc8280xp_get_dai_data(data->priv, cpu_dai->id); - if (dai_data && dai_data->jack_setup == SC8280XP_JACK_SETUP_CODEC) { - qcom_snd_headset_jack_cleanup(rtd); - data->jack_setup = false; + switch (cpu_dai->id) { + case DISPLAY_PORT_RX_0: + case DISPLAY_PORT_RX_1 ... DISPLAY_PORT_RX_7: + return; + default: + break; } + + dai_data = sc8280xp_get_dai_data(data->priv, cpu_dai->id); + if (dai_data ? dai_data->jack_setup == SC8280XP_JACK_SETUP_NONE : + !data->priv->wcd_jack) + return; + + qcom_snd_headset_jack_cleanup(rtd); + data->jack_setup = false; } static const struct snd_soc_ops sc8280xp_be_ops = { -- 2.43.0