From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 918A23A59BC for ; Sat, 27 Jun 2026 13:12:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782565932; cv=none; b=Qjk7hsSL+DUjCsaLzn1+OT54X9KAoAY2Z8tk/ioSa0mLLIYfnRI2Np96SGKGSKhoddw1+JprZ9SyB4sezLWmpeokvr9Tv1JszdG331RHu4LP8krKc2SWPbBpB/NLXHwDQKKRA7rRKn0QCM3LxEzaAkRTbM/7FrT5vmDR+l1e+/k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782565932; c=relaxed/simple; bh=ikMPwPpVaGjReFp0lLkog0wHEbVrARGqJA6m7oHHbQ8=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=hODc6BF4pxe/tgU7LCI0AqJyP20dEpmgOuDt/jrmpZiEZIt08CCToFrcUXthySsRwr9hQ3qJU0wjCV64WSl9vWsJx+GPAykfsczd+w59o99EXKtfjdhV6ZQOt5FA9vhQMsTSBDRm3m1xw7+KiVdvZisKn+yP9RFRwQiUHZR0/vw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ZOtI4qr/; arc=none smtp.client-ip=209.85.221.42 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.b="ZOtI4qr/" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-46e4764ca48so1738600f8f.0 for ; Sat, 27 Jun 2026 06:12:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782565930; x=1783170730; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=mYYGf5y/FFyUp8Jk8dSfusP7o73GMsKAwMN8eV/HMTQ=; b=ZOtI4qr/dxm893OzXAFKyZ+dogy3eC9Kneg1c2LteTGdQWnwIF2T/6U3s2xgrogo+B GotTW0yYO1/DiI74izJTysW+AMZeKAnlowkBXKAcaLPpP3ZqlYQmDdjLfl8s2xq8MT5f CqDT1LExTsH2lnLNhwCRsfAAUEh3BZpat1ummsrOFbed374SuSB2IdSaWeyevu+xE1T0 haotElBNGWjgULvHmj7spRCPIuxuY8t6N/q6Qx3SUwZtxWsq20uqHIRUXIj9an2vTwCW NVFp71lv19GYm2fy71jMt0E5RDh+/FHKPgEx/zjYno3yv8NGb1ECt+RQhFMkSg5bR2T9 6/NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782565930; x=1783170730; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mYYGf5y/FFyUp8Jk8dSfusP7o73GMsKAwMN8eV/HMTQ=; b=GmU6z0LV6XT6FOSBV2p0Weu0n1XuOWdJsrBYbyQ6TQV8LuQGLyHL3KSx7/B6lgI5L3 0dX/6XoK7wErc5AX2EgDQm7ViW/4a+WKCiTW0jB7rVd6orKK61XoiG14jS7vq4nFrzxS KKBD1h+CpK2jWvVZG+cUnsCwJtKUx+erfVGSmPkrRIQrwfYymc8LdKFe9tlWdMbfLhK4 FdJNJrI3t/pj9InIIE6x2fAYubXfavbbjHJHk202TNNi3l8roGKEtj0gsT6Tz+6TDzo9 GOvdFmu7nPrNA4RP+UxStYF6TC7Lb1g4/q3zU+WUppYG0Yx47F+C8kP/a4wtoxEK/L9N S0Sw== X-Forwarded-Encrypted: i=1; AFNElJ/w5qk5z8FwXik7DANK3Hoqljt04ONhEUYRLi6QiSqDukXJG6/xA3M880gqbwkzYR3+hPelLRt+i1y6ODI=@vger.kernel.org X-Gm-Message-State: AOJu0Yw6Tj6AhtM7ZTphjTPyYyKUbbY/1mKLOybTYOzdRpCop/vSW5gw eRf9M+kuxBfdFCT2JVT8/X2bGNKQ4QaQvbEGQMtTiQapu6eZLqH4wto0 X-Gm-Gg: AfdE7clhswM44vpDrn2N/2SDwdgajrNurHFv3qfFSlE5XcLbJf1mB7FBTdy70QfllN9 O1PhBshc0YOOdRBgUvePKa10V8MOr1K3SrWVYI1Hc1JSfjgDnu80MME1fp7RddHrX6Jt2QGuWF3 tkzRzCJ/UdWNuvtTWzDB/UijQtCZFQjytv0H/JPlRSkKZDiHEWRnkhLXHqR5CP+hhMF4cQcObzo L9Ew3ySBRfXghE3K3N99PngWwoSwD01/cPyPyGOVNsZb9BjjfotPDpTLWRqeVuYVvQX0pfNre20 vVER6/UEx1SPS6heVFh1hJ6nOWE2IytVB1SW2FTDYp/KQfbJ9cWibjwCfN6ywv6sU3CehDZIWpR 3udKWLWnKpbOifwhttjGla2NzI0yKlFzngzia6w/bX7de7/eBOyxHeAxN004YqW+Y+D44Bj1LF9 jwZdZRV5v7hLQnkflR X-Received: by 2002:a05:600c:4e54:b0:492:523f:a3df with SMTP id 5b1f17b1804b1-4926685fccfmr158769025e9.5.1782565929840; Sat, 27 Jun 2026 06:12:09 -0700 (PDT) Received: from toolbox.. ([87.200.95.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49268fde98csm171665075e9.6.2026.06.27.06.12.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Jun 2026 06:12:09 -0700 (PDT) From: Christian Hewitt To: Jerome Brunet , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Neil Armstrong , Kevin Hilman , Martin Blumenstingl , linux-sound@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3] ASoC: meson: aiu: fifo-spdif: soft reset the S/PDIF datapath on start/stop Date: Sat, 27 Jun 2026 13:12:05 +0000 Message-ID: <20260627131205.808800-1-christianshewitt@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The I2S FIFO soft-resets its fast domain on start (AIU_RST_SOFT bit 0 + AIU_I2S_SYNC read in aiu_fifo_i2s_trigger), mirroring the downstream vendor driver's audio_out_i2s_enable(). The S/PDIF FIFO has no equivalent: it only toggles the IEC958 DCU, so a stale datapath FIFO can be replayed, producing the "machine gun noise" buffer underrun - on start when switching outputs, and on stop when playback ends. The latter is audible on devices with an always-on S/PDIF-fed DAC (e.g. the ES7144 on the WeTek Play2). The vendor driver resets the IEC958 fast domain (AIU_RST_SOFT bit 2) on both enable and disable (audio_hw_958_enable), and when reconfiguring (audio_hw_958_reset clears AIU_958_DCU_FF_CTRL then resets). Do the same: reset before enabling the DCU on start, and before disabling on stop. Fixes: 6ae9ca9ce986bf ("ASoC: meson: aiu: add i2s and spdif support") Signed-off-by: Christian Hewitt Reviewed-by: Martin Blumenstingl --- Changes from v2: - Ammend description to match the change in v2 - Add Martin's reviewed-by Changes from v1: - Add missing fixes tag - Trigger AIU_RST_SOFT_958_FAST before disabling DCU matching the stop flow in the vendor driver, as noted by Martin (tests ok) --- sound/soc/meson/aiu-fifo-spdif.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sound/soc/meson/aiu-fifo-spdif.c b/sound/soc/meson/aiu-fifo-spdif.c index e0e00ec026dc..a9861c5d6637 100644 --- a/sound/soc/meson/aiu-fifo-spdif.c +++ b/sound/soc/meson/aiu-fifo-spdif.c @@ -24,6 +24,7 @@ #define AIU_MEM_IEC958_CONTROL_MODE_16BIT BIT(7) #define AIU_MEM_IEC958_CONTROL_MODE_LINEAR BIT(8) #define AIU_MEM_IEC958_BUF_CNTL_INIT BIT(0) +#define AIU_RST_SOFT_958_FAST BIT(2) #define AIU_FIFO_SPDIF_BLOCK 8 @@ -68,11 +69,15 @@ static int fifo_spdif_trigger(struct snd_pcm_substream *substream, int cmd, case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_RESUME: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: + snd_soc_component_write(component, AIU_RST_SOFT, + AIU_RST_SOFT_958_FAST); fifo_spdif_dcu_enable(component, true); break; case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: case SNDRV_PCM_TRIGGER_STOP: + snd_soc_component_write(component, AIU_RST_SOFT, + AIU_RST_SOFT_958_FAST); fifo_spdif_dcu_enable(component, false); break; default: -- 2.43.0