From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3293FC04FF8 for ; Thu, 18 Apr 2024 10:58:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=aeTsGtAoo5Fq+QrMKVUi8BPaoVUZSEscZepTOUBJTFE=; b=Zy8e4wWycGpg7t s2JgtViR46yXOEMZdUDE0u6WvKZrYS4toq6R9z18NQvQh2Nysu25NKkHe2eUQbBuX8y4kaHxZ9dbF srvKdfJ8sdctDowHEI2kKddtetIdTMdWT4Yoi3/qMKz6J6Xyo/Rb7FRmsW9ot8ttbEleezRfyDqN/ 7Yh/LyEF62YfUaJPzUP3kTr2aMnIYRLFx2wDHdQ/73aUbU4b57NWeuuImMIsc2hPejmtYd4W0AOk2 O6mmRI58yDiMGU+VFlVn9YNCkr3gsZ9ZFz3RvGKXmV12I4o/BC2Ljpxr3GqTtNG9kh9VbTsEyR7TZ aNrvwwUh/teuIwY0JzIg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rxPT8-00000001u4q-0ndc; Thu, 18 Apr 2024 10:58:18 +0000 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rxPT2-00000001u3O-2gf3 for linux-arm-kernel@lists.infradead.org; Thu, 18 Apr 2024 10:58:16 +0000 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2db2f6cb312so13741631fa.2 for ; Thu, 18 Apr 2024 03:58:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713437889; x=1714042689; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=rrxIXj7RnRz6Inm0MPVjaqJdEXgL4gVk17zWxjNGgWs=; b=QSsYyJMc/WC0fM0AiJ1u4bU9kc509Xsaz6e89p3Oq+sBKS5GAngGqcAQUtNaXFf4a7 FcTWOAQN32UYgWVt01iyrVQmShorozpijtul2x0hzmyghDnOLAqfZCaJEpaWyMJuwsHb BmJyHcdZEp4lqr2aRcjRai76GgiJF72ugQ9ypJ7Pd2TE2QXdwKv0Qe7844ZM8RDIgiuw Yb7lw6sx2o17OS5yFFNzFW31GysAmgN0rAw+zz4FJkUVDPTiZmqkDoq9LgRvB8ufzs3e 5y4kDi+ydkZaIGuurZfN5CHtJsIF847/fJUOG4n6zjTaLb0bb4vWGQpLXniUf2gwK5Cp TVJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713437889; x=1714042689; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rrxIXj7RnRz6Inm0MPVjaqJdEXgL4gVk17zWxjNGgWs=; b=DKQy/EVd8U/zsDowgevA7pRWipiV98depOfyAb7U7wFXWbaASIdntb+NWce/4hS1Pt +/82BOtKSIdTgXaxwkYJkbVjLNFO23GKY1a4/B+A9C7oe27XD4qwqq78dkK/p15BtS4f PRBR4A0xZoOSLQLhtyLFssOVHfYmNFYieojlK4pgwTJa8G8bqjFj/9SnGqcejhgn3BXi 9YYZNUbUXjhBdLapvnT+1mh64NY7w1IBeSoCE+VgWAnVJLxw2lXibC+z8Fmo5BO+Pl0g XioMdbmO9XbLQsSxCtmC9V6RF1M3tMHmImMIgNkS072ZcHrvTM5533N/GKoJd8wP7Sdi aqJw== X-Forwarded-Encrypted: i=1; AJvYcCV+S6nNOE8hNRH/4eYRI1cBEFjSv/jccuPXUkXXQhC6J1h71gQvfqOrUftTKOU528cE3pmH1mjV1yTHMZG1Yuz9Rc5mgARxOqPSQMVBfW/QBYLjfHc= X-Gm-Message-State: AOJu0Yzmg3CD/nijjYs4+TqM+WU3SDKslZ15wxRjZrmI1TNPl7KSZRve xkd6kcvlS8ANiThrRh5qY0JbZRo6k6ZWOsEm49nTGU0YjYEs27fPyqk8tpNZ X-Google-Smtp-Source: AGHT+IEnaxJjPFvGEVHV2AJPn5rK9q/wGwFArQkhNwfFo41T53iJo9bm5Ud2gkymL1QDpEaN0drT2g== X-Received: by 2002:a05:6512:3f0b:b0:513:ca40:fafc with SMTP id y11-20020a0565123f0b00b00513ca40fafcmr1950544lfa.11.1713437868011; Thu, 18 Apr 2024 03:57:48 -0700 (PDT) Received: from andrejs-nb.int.toradex.com (77-59-154-235.dclient.hispeed.ch. [77.59.154.235]) by smtp.gmail.com with ESMTPSA id hx11-20020a170906846b00b00a46d2e9fd73sm724794ejc.222.2024.04.18.03.57.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 03:57:47 -0700 (PDT) From: Andrejs Cainikovs To: Nishanth Menon , Vignesh Raghavendra , Tero Kristo , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Andrejs Cainikovs , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1] arm64: dts: k3-am625-verdin: enable nau8822 pll Date: Thu, 18 Apr 2024 12:57:30 +0200 Message-Id: <20240418105730.120913-1-andrejs.cainikovs@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240418_035812_743436_CC78B731 X-CRM114-Status: GOOD ( 13.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Andrejs Cainikovs In current configuration, nau8822 codec on development carrier board provides distorted audio output. This happens due to reference clock is fixed to 25MHz and no PLL is enabled. Following is the calculation of deviation error for different frequencies: 44100Hz: fs = 256 (fixed) prescaler = 2 target frequency = 44100 * 256 * 2 = 22579200 deviation = 22579200 vs 25000000 = 9.6832% 48000Hz: fs = 256 (fixed) prescaler = 2 target frequency = 48000 * 256 * 2 = 24576000 deviation = 24576000 vs 25000000 = 1.696% Enabling nau822 PLL via providing mclk-fs property to simple-audio-card configures clocks properly, but also adjusts audio reference clock (mclk), which in case of TI AM62 should be avoided, as it only supports 25MHz output [1][2]. This change enables PLL on nau8822 by providing mclk-fs, and moves away audio reference clock from DAI configuration, which prevents simple-audio-card to adjust it before every playback [3]. [1]: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1175479/processor-sdk-am62x-output-audio_ext_refclk0-as-mclk-for-codec-and-mcbsp/4444986#4444986 [2]: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1188051/am625-audio_ext_refclk1-clock-output---dts-support/4476322#4476322 [3]: sound/soc/generic/simple-card-utils.c#L441 Signed-off-by: Andrejs Cainikovs --- This patch requires https://lore.kernel.org/all/20240409121719.337709-1-andrejs.cainikovs@gmail.com/ to be applied, if not the audio will just stop working because no code will ever enable the required clock to the codec. --- arch/arm64/boot/dts/ti/k3-am62-verdin-dev.dtsi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/ti/k3-am62-verdin-dev.dtsi b/arch/arm64/boot/dts/ti/k3-am62-verdin-dev.dtsi index 74eec1a1abca..5c1284b802ad 100644 --- a/arch/arm64/boot/dts/ti/k3-am62-verdin-dev.dtsi +++ b/arch/arm64/boot/dts/ti/k3-am62-verdin-dev.dtsi @@ -14,6 +14,7 @@ sound { simple-audio-card,bitclock-master = <&codec_dai>; simple-audio-card,format = "i2s"; simple-audio-card,frame-master = <&codec_dai>; + simple-audio-card,mclk-fs = <256>; simple-audio-card,name = "verdin-nau8822"; simple-audio-card,routing = "Headphones", "LHP", @@ -34,7 +35,6 @@ sound { "Line", "Line In"; codec_dai: simple-audio-card,codec { - clocks = <&audio_refclk1>; sound-dai = <&nau8822_1a>; }; @@ -107,6 +107,8 @@ nau8822_1a: audio-codec@1a { reg = <0x1a>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2s1_mclk>; + clock-names = "mclk"; + clocks = <&audio_refclk1>; #sound-dai-cells = <0>; }; -- 2.34.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel