From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-10630.protonmail.ch (mail-10630.protonmail.ch [79.135.106.30]) (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 D1DFD3B2FF6 for ; Sun, 30 Aug 2026 15:15:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=79.135.106.30 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788102951; cv=none; b=dPJ2r+rwQ39QD7mvz6Z5yyEPRgtlVoHf8l3vsBrLqU29WnGeYEVrIcyjlS2n+UrF92tk1zSXutJng4HmrU/j1ZaO1HbmcjzbozxIQdmBQrzgPlg49rLdiDERQ6j7U4tVPP+86eNTI0XNAeeG3LDhqw6np12FcskPd+4wSTghvVI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788102951; c=relaxed/simple; bh=H4e7Ps1XtiKH4TO/3BjbXXc8kP7dZkzLPOEI7twRvAk=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=SV7rBr61A4QJtEYZNz6fjMyYIvAhme0IeEHV+v1rXOjOTgjSc1Kj3BpZ7JVsDygLtzla0qgYpfONH9BVR9EwtJ+pa3yI0OHUweXOvXzQphyhNQIRtJc2ScyWbgRdUUxLOOCsq2MvOJglxTryODqg9tYsPO3aj4NTTz1QQyiqNXE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pm.me; spf=pass smtp.mailfrom=pm.me; dkim=pass (2048-bit key) header.d=pm.me header.i=@pm.me header.b=hSpsWtHp; arc=none smtp.client-ip=79.135.106.30 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pm.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pm.me Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pm.me header.i=@pm.me header.b="hSpsWtHp" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail3; t=1788102941; x=1788362141; bh=rAjpVHNOuKzbCe4ywlmfVDM0tSDIwLDF//f7jRQKZz8=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=hSpsWtHp6hokVpmcJn3Gvqaw/8rsxT0+d9yE/d1q2MDowlYwob1QYdaWP6TzXUIIa uXMqBnwh1igyQ2Naf3nYLVcpM49CCoga6gW3c02xRyDduVgNfhNvY9VaFug7QOWhEn QOLOSkrynhLe1BwEgI8vze604Lod3vRsyXgBmaawq9Yxi2IDx3HTyLR+uezr7N0ayJ I4MDnZcUle8hDd0h8WAhqBmtCi8CingqpZLqJ2xtHzgbWg1lYEiwj5kN/5CDGb7QTB okmc8/nbaxmW8Y93YSBNX6kelT4UI+CXiyJqEZ/dk5WKVmVZnFgGBKr1HdUsQnaTix gIMSPwISa1+gA== Date: Sun, 30 Aug 2026 15:15:36 +0000 To: Vinod Koul , Bard Liao , Pierre-Louis Bossart , Oder Chiou , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai From: Sergey Lebedev Cc: Bard Liao , Amaan Lalani , linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/2] ASoC: rt1320: run the initialisation preset on the first hardware init Message-ID: <20260830151516.44629-2-lsa.uz@pm.me> In-Reply-To: <20260830151516.44629-1-lsa.uz@pm.me> References: <20260830151516.44629-1-lsa.uz@pm.me> Feedback-ID: 113843758:user:proton X-Pm-Message-ID: 38181b0fa2026e65e0047983b4278b82083e0fb7 Precedence: bulk X-Mailing-List: linux-sound@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 rt1320_io_init() applies the vendor initialisation preset only when the amplifier's SDCA function status has FUNCTION_NEEDS_INITIALIZATION set: =09if ((amp_func_status & FUNCTION_NEEDS_INITIALIZATION)) { Its two sibling drivers guard the same write differently, also running the preset on the first hardware init: rt712-sdca.c: if ((amp_func_status & FUNCTION_NEEDS_INITIALIZATION) || (!rt712->first_hw_init)) { rt722-sdca.c: if ((amp_func_status & FUNCTION_NEEDS_INITIALIZATION) || (!rt722->first_hw_init)) { On the Microsoft Surface Pro 11 (Intel) the RT1320 never sets that bit. Its function status reads back 0x41 on every boot, cold or warm: rt1320-sdca sdw:0:0:025d:1320:01: rt1320_io_init amp func_status=3D0x41 which is NEWLY_ATTACHED | FUNCTION_HAS_BEEN_RESET: the function reports that it has been reset and does not consider itself in need of initialisation. Bit 5 is never set, so the preset never runs, rt1320_vc_preset() and the MCU patch load are skipped, and the amplifier is left unprogrammed. rt712 and rt722 would have run it via their first_hw_init fallback. Add the same fallback. With it rt1320_vc_preset() executes and the amplifier reports RT1320_KR0_INT_READY=3D0x1f where previously it did not. Signed-off-by: Sergey Lebedev --- sound/soc/codecs/rt1320-sdw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/rt1320-sdw.c b/sound/soc/codecs/rt1320-sdw.c index 13493b85f..d1f3b160a 100644 --- a/sound/soc/codecs/rt1320-sdw.c +++ b/sound/soc/codecs/rt1320-sdw.c @@ -1900,7 +1900,7 @@ static int rt1320_io_init(struct device *dev, struct = sdw_slave *slave) =09dev_dbg(dev, "%s amp func_status=3D0x%x\n", __func__, amp_func_status); =20 =09/* initialization write */ -=09if ((amp_func_status & FUNCTION_NEEDS_INITIALIZATION)) { +=09if ((amp_func_status & FUNCTION_NEEDS_INITIALIZATION) || !rt1320->first= _hw_init) { =09=09switch (rt1320->dev_id) { =09=09case RT1320_DEV_ID: =09=09=09if (rt1320->version_id < RT1320_VC) --=20 2.50.1 (Apple Git-155)