From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 0F0FE393DF9 for ; Sat, 27 Jun 2026 12:50:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782564637; cv=none; b=mV6Y5WKBlbB97vXObNCfP7atUtkzbMAbMPjzCyiFrWhJZh/HOeDvIRNw8d9yXoCOtmq1D/GYWJpuDBbKqLfkdVSAlXwniEK7L9h0Qsrr8xXMSv8V8jYdoUQCLs9VfyKyehcWXGmAo12Fe+uIfV4fYD61wz8U+Ud9mYGnPeKWlUw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782564637; c=relaxed/simple; bh=qAioeDbQ3Ql+BriUVf3MwJAXS8ui6W2vCcfFRpJy0CA=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=MA82I7g0VZo+kqjhWPFwAKfisN7oejcNaJ9tYogPDx2decYMN20b7LFdG6bjs+Lv471x2NOkMEHH1pgxUFAhR2tXBvW4XvvxqtBvVC3e3TbVzi8AUeVJnf28PaFP3hhHi0wRaR4gzuMhl9eQ4fy2fECH3xkrMEORTtHJI95JySQ= 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=anmTQy3z; arc=none smtp.client-ip=209.85.128.44 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="anmTQy3z" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-492719b2d81so2526875e9.3 for ; Sat, 27 Jun 2026 05:50:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782564634; x=1783169434; 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=CgBb9c2zB8E5ylruIOvxgxXaQ+5aMJ9oD3Y4vVrihts=; b=anmTQy3zsDPNFetWSTTTUjIRu0SDTnKbfBBkOpt6vwR2/xCEMhp6MTsXh9eXR8xgI5 hWyU3B6gkeKyyZS2MsMax4zrPXyG3PCePgDuLCEgnrgHiUpHCJDKbhK8liuZF/itMhcH bEIcAFIDNVtKmFnhKmffMExj4uw8WWiOmdjSbKzCER/LgLOhgCEDl6cGT0jSl9OQ8zD6 54lENRwBRF+CCihOV8hItutbsPXCWWlDjqtyMDKwl78KC8ufsN2DOKTJgqdlwwEZ+8pj V45fBp/Z0sGsCtaBmGfNb7maludYlT+fi2Mqu8mhfespHm0jt89J0PmkGW+jrWCuDpyf MULA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782564634; x=1783169434; 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=CgBb9c2zB8E5ylruIOvxgxXaQ+5aMJ9oD3Y4vVrihts=; b=ZQhAOtYQxHV2DMERsh+8bpGl0uTu3AWipc4kM0D6VizCjA9ND0ZOqVjIehSHJdddwP 6LDKmwIqKeWjMpZ47IIK5zl9kXZWBticdMEG3Uvhi1UbhlQcpAnIVhvsmIcCmCNcHuCP fw8HR2O4Jfu+egxBQM2CIp09pA57UJnxgsDTz1m53+pfkzQq4BP0NjiG1FSiRpSyzTz4 eEVpPB71ersXs5D65o1sZHGoMtW1UW9pxmlUzdUMwpzBk62VDNFgnc6YAYl/SDVrlrEq z5/+nvZpnWgHneIaiPr+qxAE97xCRKI2u+LHRFDMLuEF2hcMYewHgXa9s6RSGisXbt5/ o+2A== X-Forwarded-Encrypted: i=1; AFNElJ9386Gnxfav7vvgfJvZohhsMnXab39nV5spFpy+39qDzSRaXa+c/5J5H2gcAcT/OV4vc9H3MRr0q1AA81M=@vger.kernel.org X-Gm-Message-State: AOJu0YxY1ZVCrPBMw54ujahnxJK70j/An48qzDvb4eORJkZ0vt/cXTph NOB5CtyEBO0upjq6ikAoX+qUFut9u5n3TDnxJ7tSDFEpvpLmmc5lNZ4x X-Gm-Gg: AfdE7ckraoSCZHUPvFxYAkO+szsP5UMFCOcQBP6JAw4CXQxCoXyhxj4Xd8fYGyKlz3Q lkeWYAFUxg0jYd75XRQPvcxBpmJjYh30M7/m7fxzPOnizVlbHfpDHe407tNtHTGlBFrpS/fSS9t 0kBWFvifvEx1dT90Yo4RbUDxSJzlEuzVvJCKfItUuXiDNJMBvR1kl6NYE+rCvGqse/ZBIrvuSaZ HAF4qVjYZTuEtDjr95Ln8XyQxxztphNcWkheNnCJTHoHVh2W99dGUKDQK/BiQXy1YxvLcyVes+p o/QSmDF0Jy5sk+JoSSJz5c+R2PAE5/bW2ZbTp0KNM8mymskjddRoTJO/FrUlU0vO8TrrDGgia2N 5ccu5aVd4tOdV4mGejjUECz5gFR0IpZglVO3rqZHb1JobLh5O244bkxUghBa9pSiMyB8hCRhphn cCf9DHYkrABNeeE3/p X-Received: by 2002:a05:600c:4f87:b0:492:703c:df36 with SMTP id 5b1f17b1804b1-492703cdf53mr63941035e9.26.1782564634280; Sat, 27 Jun 2026 05:50:34 -0700 (PDT) Received: from toolbox.. ([87.200.95.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4926f94f213sm105298565e9.12.2026.06.27.05.50.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Jun 2026 05:50:33 -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 v2] ASoC: meson: aiu: fifo-spdif: soft reset the S/PDIF datapath on start/stop Date: Sat, 27 Jun 2026 12:50:30 +0000 Message-ID: <20260627125030.808058-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 after disabling it on stop. Fixes: 6ae9ca9ce986bf ("ASoC: meson: aiu: add i2s and spdif support") Signed-off-by: Christian Hewitt --- Changes from v1: - Add missing fixes tag - Trigger AIU_RST_SOFT_958_FAST then disable DCU as in the vendor driver 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