From patchwork Thu Feb 29 23:35:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Ford X-Patchwork-Id: 13577749 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 51373C48BF6 for ; Thu, 29 Feb 2024 23:36:20 +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=nSHY8cQXYbdXOzpr44D8E/YX1LAt+SJvnQNKlgap4UA=; b=yFmg9geMvVxdfU 9Fro0oqEsLIuIeY4gxDY2KH4z4Uq9am59+NaESw6LxO9+FBQtGGXRMWtr4Pt1vueeee3Rb+VWDGQs H4+X/zjQlbxfEU67lCAix5ZIuUHsebb87Hxtj2pDSMeXm+uJ+UAIIgvbfVnSxmmTLo0zjN1t7lvIn hn19ulT5W1nFtinTZQIGPJCg3CSOww8hXQPNzh1npU/tOzwodyJ2JAVoRUUAGLY30Wxj7siRc1z+Y ccd+1jcZe/4SxHM1CDMaOkglx/ystEqG1TRhDDtoy9kCFbsIgZqi0eiU8MESAN6hMwgFa5Wcmq3ew 4KC5GQmxmBI+dqBFMwSA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfpwg-0000000FdwN-2dB6; Thu, 29 Feb 2024 23:36:10 +0000 Received: from mail-il1-x129.google.com ([2607:f8b0:4864:20::129]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfpwd-0000000Fdua-1Jnx for linux-arm-kernel@lists.infradead.org; Thu, 29 Feb 2024 23:36:09 +0000 Received: by mail-il1-x129.google.com with SMTP id e9e14a558f8ab-3651b948db6so6013215ab.0 for ; Thu, 29 Feb 2024 15:36:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709249765; x=1709854565; 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=+28orNpMGgXroEpuUoZhdTb8QFxzIWPQpfl/txukD6k=; b=d1GNYmpFX4eB+srst7JIzSe1UuIhyAJoWlRXQ9vMAgoFrt69A0PiDXVVWUavImGimr 7cCNBVH7Pj2y2cnSdsBjrHhfwsNjP/qZNW3dI/dCEshN0SzqHifHGPYl7yeqjgrVOqoO M5MNV67gZ6sLUPhKbCdWdCI0ulVDrby1iJ34Bwscy3BQ4s7KIOmCuzGVGm9eiQb9VhZx qWZAofa3TIK5HuZyfGurSekCfcFNNFfWgEC1s6Rq93Jw/5Q/FD33CTihahJjP6LmZZsn YhhvpVryyTuLcXcnYjtY72cg/24kj6Ezn638z9qUOBjgNZv0q/qBN0H6qVEfUop4PhUi zTgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709249765; x=1709854565; 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=+28orNpMGgXroEpuUoZhdTb8QFxzIWPQpfl/txukD6k=; b=KM1yNr5qjZUlw9tRGO5nFBpyJ4wNmwnEbmkIIJ/SHy3pp0IOo1iyQcAGWnaD6rPoHa TADSdxMG5Aj7Bh5Kb9ahVNOAnDsH3/shHw7oR3yt7Nq1SVSMS0oGosv7k+d9gVIcpI/4 AZnD9xHFYSYCQ8anHB3Dva6urCYv39k5pEGNT8X+rM0nFZ3PfKV3+Poj9W28Kmpzuuuq vshiY3vDAgm+w7Zvz7hkk1UEUiLXBDFwGjm2l85nQCYuUIBr8c9Z78euDNDQ9eAlKv2x fxxUrgRQWsRuNXa3aFSsVWU94Hlp+yLCibOM2o2NzlByyrPsIL9QmEPTLFmyPzIaVNhM Ex0w== X-Gm-Message-State: AOJu0YwXVtkwwfjPO4eF39ZgbwuMBu4wEFsgkh2gVllwwx4bcsgxMeYT lW4yI8/lNGWEVW6vyFV+1pF4iGZeftPn+6dbQpUhAZKmn60WmtHFJC6i4ZYWGejWhQ== X-Google-Smtp-Source: AGHT+IFpQBqR2EjhTZVRTHRSZLs3fZz5buNTzVetrB34OkV6yZBLhzpHgpCMW625+nJLMte6I1dBBg== X-Received: by 2002:a05:6e02:1d83:b0:365:b9c8:4436 with SMTP id h3-20020a056e021d8300b00365b9c84436mr183974ila.10.1709249764757; Thu, 29 Feb 2024 15:36:04 -0800 (PST) Received: from aford-System-Version.lan ([2601:447:d002:5be:c0ab:242c:2712:ad44]) by smtp.gmail.com with ESMTPSA id j5-20020a056e020ee500b0036576880ffcsm584260ilk.85.2024.02.29.15.36.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 15:36:04 -0800 (PST) From: Adam Ford To: linux-arm-kernel@lists.infradead.org Cc: aford@beaconembedded.com, Adam Ford , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , devicetree@vger.kernel.org, imx@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] arm64: dts: imx8mp-beacon-kit: Move sai3 to Audio_PLL1 Date: Thu, 29 Feb 2024 17:35:54 -0600 Message-ID: <20240229233556.116944-1-aford173@gmail.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240229_153607_465637_D2619F52 X-CRM114-Status: GOOD ( 12.25 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The Beacon board has an LVDS display that cannot get a proper clock rate from Video_PLL if the DSI is operational due to the way the clock divides the pixel clocks from video_pll. To make the LVDS work, the LVDS needs to use an alternative clock. Because the clock rated needed for the LDB driving the LVDS display isn't divisible by the clock rate needed by SAI3, move SAI3 to use Audio_PLL1, and reconfigure the CODEC to use a 12MHz fixed clock. Because these clocks are no longer in sync with each other, the sound generated as the wrong pitch, so reconfigure the SAI3 to be the master since the CODEC can internally compensate when fed a fixed clock reference, even if it is not an even multiple of the desired rate. This now leaves AUDIO_PLL2 completely free for the LDB without compromising the audio sound from the codec. Signed-off-by: Adam Ford diff --git a/arch/arm64/boot/dts/freescale/imx8mp-beacon-kit.dts b/arch/arm64/boot/dts/freescale/imx8mp-beacon-kit.dts index a08057410bde..1f827ef38e36 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp-beacon-kit.dts +++ b/arch/arm64/boot/dts/freescale/imx8mp-beacon-kit.dts @@ -211,20 +211,20 @@ sound-wm8962 { simple-audio-card,cpu { sound-dai = <&sai3>; + frame-master; + bitclock-master; }; simple-audio-card,codec { sound-dai = <&wm8962>; clocks = <&clk IMX8MP_CLK_IPP_DO_CLKO1>; - frame-master; - bitclock-master; }; }; }; &audio_blk_ctrl { - assigned-clocks = <&clk IMX8MP_AUDIO_PLL1>, <&clk IMX8MP_AUDIO_PLL2>; - assigned-clock-rates = <393216000>, <135475200>; + assigned-clocks = <&clk IMX8MP_AUDIO_PLL1>; + assigned-clock-rates = <393216000>; }; &ecspi2 { @@ -370,8 +370,8 @@ wm8962: audio-codec@1a { pinctrl-0 = <&pinctrl_wm8962>; clocks = <&clk IMX8MP_CLK_IPP_DO_CLKO1>; assigned-clocks = <&clk IMX8MP_CLK_IPP_DO_CLKO1>; - assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL2_OUT>; - assigned-clock-rates = <22576000>; + assigned-clock-parents = <&clk IMX8MP_CLK_24M>; + assigned-clock-rates = <12000000>; DCVDD-supply = <®_audio>; DBVDD-supply = <®_audio>; AVDD-supply = <®_audio>; @@ -499,10 +499,9 @@ &pcie_phy { &sai3 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_sai3>; - assigned-clocks = <&clk IMX8MP_CLK_SAI3>, - <&clk IMX8MP_AUDIO_PLL2> ; - assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL2_OUT>; - assigned-clock-rates = <12288000>, <361267200>; + assigned-clocks = <&clk IMX8MP_CLK_SAI3>; + assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL1_OUT>; + assigned-clock-rates = <12288000>; fsl,sai-mclk-direction-output; status = "okay"; };