From patchwork Fri Oct 28 10:34:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aidan MacDonald X-Patchwork-Id: 13023379 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 3981DECAAA1 for ; Fri, 28 Oct 2022 10:35:52 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 6509327FA; Fri, 28 Oct 2022 12:35:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6509327FA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1666953350; bh=cp1ySFQ9b/kESTiD4ZqENiQzCNBGsyLOszG23ysuIrg=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=df62n8v9K7WGi+5JrAtSZAh3g24aHmAJQK+2AgyEv6Nz/SYI7ZfRgDG4thgvX78Fy ZpVJHHjYg+Xxd4xNcRIWwYKZK8bagj9KembS9a5dH8oAAl7cWfV2hTjBcsZvDhpSfi Gc+ylzoUY88Pm+ayQAww9d0Zxum12azRxOWPRil8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id A8C07F804D0; Fri, 28 Oct 2022 12:34:33 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E55B7F80095; Fri, 28 Oct 2022 12:34:30 +0200 (CEST) Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 4B8C6F80095 for ; Fri, 28 Oct 2022 12:34:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4B8C6F80095 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nW7fKiq0" Received: by mail-wr1-x42c.google.com with SMTP id bk15so6001925wrb.13 for ; Fri, 28 Oct 2022 03:34:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Iza2TaCkyzr/G3RQNexbZUSAsDCgwwO2VTwP3e6lVI8=; b=nW7fKiq0XchkjTwPif5/83pUEVQb8//GqUC5uhhUirUS6EJZuSMdXSHs6nLBgLTQaH RP+PV2sgBThhpc6tpxzcCKQDMB1ZWkJZWE7Yty8YssrnqRAcnAN8HMP7xGycQLjNhCVf Ii7EpJkfEE6yRF+jRooqGofJQ5AtBTSTL2Jg4RuipYp313d7aOp+Urtv0Wzzc5sNgVXn RZ+aF+vagSFcIDQEoGudviHGjkMTRfdxhJebL6KGym/eube2RhT+KuCqWlNO5rvm9q8S 8ZA7lvHm3ny9+M75y0T++kY9JeGTEh7Pbtoy/f390PL2DHxJTLL4owiGBWD9UjIeOSJ2 ryVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Iza2TaCkyzr/G3RQNexbZUSAsDCgwwO2VTwP3e6lVI8=; b=vbbYNClDTbysLAbtBWUX8kqNc++lQta/KVGDmh5+pIOoUpGSyTZHTVp9JQ8SnEd6yK /U2Xls3tSxwNmA+TXkqRU0qVZhh+J1jAWQrI1KaO8+YES2UoSJEz/DuZ05iSkvp+gPsA 4q8Zlx1FkKjTN4BNv/jwZwyBqM68fFHWM5+74+koLknrbjyBIJos5VipiFhumMNn0nzz MhnTGcqBsqNqieBsLVDN6IcI7+SiVJOfQyEuo0fjSVHyA2DPFpGz05vRj06hmrIcwCnJ 1a1Xw31Orytd/bNGSvlW2PWCFsoko0FxXkGtXTQF2uoFboPr9qol8r4wkm+gbe29Bpvn RMJg== X-Gm-Message-State: ACrzQf2ywi8YbScCFaQwmhT9JDUfUOEFCkj0Jq0q5jaSmwjyAEjO5CFL 12eosD37N+QpSUeKgqvwnq8= X-Google-Smtp-Source: AMsMyM425b/N+g0Scv97lzZADj+stoYPE2Y6WXtnG+yIdY7m3olUmFU1QKZn1pPXOVtl9M455zj45w== X-Received: by 2002:a05:6000:144f:b0:231:2053:ef7c with SMTP id v15-20020a056000144f00b002312053ef7cmr34870075wrx.179.1666953266605; Fri, 28 Oct 2022 03:34:26 -0700 (PDT) Received: from localhost (94.197.40.204.threembb.co.uk. [94.197.40.204]) by smtp.gmail.com with ESMTPSA id e8-20020adffd08000000b0022e653f5abbsm3300645wrr.69.2022.10.28.03.34.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 03:34:26 -0700 (PDT) From: Aidan MacDonald To: paul@crapouillou.net, lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, tsbogend@alpha.franken.de, perex@perex.cz, tiwai@suse.com Subject: [PATCH v1 1/3] dt-bindings: ingenic, aic: Remove unnecessary clocks from schema Date: Fri, 28 Oct 2022 11:34:16 +0100 Message-Id: <20221028103418.17578-2-aidanmacdonald.0x0@gmail.com> In-Reply-To: <20221028103418.17578-1-aidanmacdonald.0x0@gmail.com> References: <20221028103418.17578-1-aidanmacdonald.0x0@gmail.com> MIME-Version: 1.0 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The AIC needs only the first two clocks: "aic" is a gate that's used for gating the I2S controller when it's suspended, and "i2s" is the system clock, from which the bit and frame clocks are derived. Both clocks are therefore reasonably part of the AIC and should be passed to the OS. But the "ext" and "pll half" clocks are a little more questionable. It appears these bindings were introduced when the schema was first converted to YAML, but weren't present in the original .txt binding. They are intended to be the possible parent clocks of "i2s". The JZ4770 actually has three parents for its "i2s" clock, named "ext", "pll0", and "pll1" in the Linux driver. The JZ4780 has two parents but it doesn't have a "pll half" clock, instead it has an "i2s_pll" clock which behaves much differently to the actual "pll half" clock found on the JZ4740 & JZ4760. And there are other Ingenic SoCs that share the JZ4780's clock layout, eg, the X1000. Therefore, the bindings aren't really adequate for the JZ4770 and a bit misleading for the JZ4780. Either we should fix the bindings, or remove them entirely. This patch opts to remove the bindings. There is a good case to be made that "ext" and "pll half" don't belong here because they aren't directly used by the AIC. They are only used to set the parent of the "i2s" clock; they have no other effect on the AIC. A good way to think of it is in terms of how the AIC constrains clocks. The AIC can only generate the bit & frame clocks from the system clock in certain ratios. Setting the sample rate effectively constrains the frame clock, which, because of the clock dividers controlled by the AIC, translates to constraints on the "i2s" clock. Nothing in the AIC imposes a direct constraint on the parents of the "i2s" clock, and the AIC does not need to enable or disable the parents directly, so in principle the AIC doesn't need to be aware of the parent clocks at all. The choice of parent clock is still important, but the AIC doesn't have enough information to apply such constraints itself. The sound card does have that information because it knows how the AIC is connected to other components. We need to use other DT mechanisms to communicate those constraints at the sound card level, instead of passing the clocks through to the AIC, and inventing ad-hoc ways to plumb the constraints around behind the scenes. Signed-off-by: Aidan MacDonald Acked-by: Paul Cercueil Acked-by: Rob Herring --- .../devicetree/bindings/sound/ingenic,aic.yaml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Documentation/devicetree/bindings/sound/ingenic,aic.yaml b/Documentation/devicetree/bindings/sound/ingenic,aic.yaml index d607325f2f15..c4f9b3c2bde5 100644 --- a/Documentation/devicetree/bindings/sound/ingenic,aic.yaml +++ b/Documentation/devicetree/bindings/sound/ingenic,aic.yaml @@ -37,15 +37,11 @@ properties: items: - description: AIC clock - description: I2S clock - - description: EXT clock - - description: PLL/2 clock clock-names: items: - const: aic - const: i2s - - const: ext - - const: pll half dmas: items: @@ -82,10 +78,8 @@ examples: interrupts = <18>; clocks = <&cgu JZ4740_CLK_AIC>, - <&cgu JZ4740_CLK_I2S>, - <&cgu JZ4740_CLK_EXT>, - <&cgu JZ4740_CLK_PLL_HALF>; - clock-names = "aic", "i2s", "ext", "pll half"; + <&cgu JZ4740_CLK_I2S>; + clock-names = "aic", "i2s"; dmas = <&dmac 25 0xffffffff>, <&dmac 24 0xffffffff>; dma-names = "rx", "tx"; From patchwork Fri Oct 28 10:34:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aidan MacDonald X-Patchwork-Id: 13023380 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 8D43AECAAA1 for ; Fri, 28 Oct 2022 10:35:56 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id ABB7F2817; Fri, 28 Oct 2022 12:35:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz ABB7F2817 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1666953354; bh=xL6cdunFQPhqQdDdPq1G/OCy9glMMs5It+ki9qEi2u8=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=mozHCwUunx+9KcKc4fRNxlqvpyv95eUqHwMaR60HTkADcJVG+0wStyeblO82Tm8Da uuOt18NpJjq+P1tE56Jl701VO71etb2vI9n3U7LDktOdJTLhE0UFM1bjgelEGTB7Fi GZDEOHSqQ4IxADlQpybxfGF0+BOyy9qN0Uf3MsAM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 1B91AF80558; Fri, 28 Oct 2022 12:34:34 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id BF848F80551; Fri, 28 Oct 2022 12:34:32 +0200 (CEST) Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 06837F8016A for ; Fri, 28 Oct 2022 12:34:29 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 06837F8016A Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NNTAM0gN" Received: by mail-wr1-x433.google.com with SMTP id j15so6050458wrq.3 for ; Fri, 28 Oct 2022 03:34:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8Ea1wwle1wP6aS8WKh/9HKEpPf2vMavxdmBWSIJ+2x8=; b=NNTAM0gN1azqcsIQcpxHh/vJKSdMlq2PNJCAVA94ROn0+UeZjBze0YQCH9cB+18hwo VgvcWgMIuAhlhk6w1cDK+uHp/sJfOcXvz1PgIFgyNMkXrYcTuqXmtW3kKaHsScmKCSiz sYYnwEiUoppjrmHhIbcmmWEfAiF+pRLfpYqWVQr4Kj786YQIc3KPec35hb1OZvGm9g1x JwGIMbyNm8lFyDjDskUL5VmSGSRNOH0ZQrf7gkhaWXdFYtrMX8hy1/+sl2gTtIlt35Bb ica46gWkMK7HiViHe73k0g5Jq/bPJQhaK8DGo4zI3Oo49JDMxPlzUMoDuIejti5yWx3Y oFAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8Ea1wwle1wP6aS8WKh/9HKEpPf2vMavxdmBWSIJ+2x8=; b=pvqO7VUNmyby4lOfnxQrcUiwnmXCBb2iDExA6oUfSKtemV8AGelGqWkX5w6ixIkhMt l7SlrJCSqv2F3qKpDgzBnSQSQKcjyOiK/c2YPUl+xxkI8TkFG6Ml/I7DT7IlIdSz1B3G anTQXGtsBzda9NhpOMBUASx9o0riGQq2TH15InzPPlFWl6p6tJR0lb/I58k3cxNaOhhs 1AE1sKRwnjSyP2FDSz/cIM9UM8py1xS84GlVim2HfAkuSkL9eeeWgqEE8V2PfVrTW0C0 znEUFwLnoe0pABc2ZV8vLzxRBMziGwdnM/GkKykB6Gp4gYFW1N09e0cfuMkRcUmx/qTW 93oA== X-Gm-Message-State: ACrzQf1DBJRHDj3VFcIsbK6aXxb0s48C0RoYS9fU4KKrvxYch886E+B9 xQVZErRj+kNvhtXVIWBXKdGMWYeZtQQisAj4 X-Google-Smtp-Source: AMsMyM4QIDPnl/FJuOUa3z7Y8zZHoMcOpnJ+EsbVC9SdL2Uoer1FNZxCWJbIqQnW+zje1w/fVlULVA== X-Received: by 2002:a05:6000:15ce:b0:230:a14d:997b with SMTP id y14-20020a05600015ce00b00230a14d997bmr35708359wry.370.1666953267858; Fri, 28 Oct 2022 03:34:27 -0700 (PDT) Received: from localhost (94.197.40.204.threembb.co.uk. [94.197.40.204]) by smtp.gmail.com with ESMTPSA id ay31-20020a05600c1e1f00b003cf537ec2efsm4116465wmb.36.2022.10.28.03.34.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 03:34:27 -0700 (PDT) From: Aidan MacDonald To: paul@crapouillou.net, lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, tsbogend@alpha.franken.de, perex@perex.cz, tiwai@suse.com Subject: [PATCH v1 2/3] mips: dts: ingenic: Remove unnecessary AIC clocks Date: Fri, 28 Oct 2022 11:34:17 +0100 Message-Id: <20221028103418.17578-3-aidanmacdonald.0x0@gmail.com> In-Reply-To: <20221028103418.17578-1-aidanmacdonald.0x0@gmail.com> References: <20221028103418.17578-1-aidanmacdonald.0x0@gmail.com> MIME-Version: 1.0 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" These clocks arguably don't belong in the DT because there isn't much the AIC can do with them in principle. It's safe to remove them because the jz4740-i2s Linux driver has never depended on them in the DT, despite superficial appearances to the contrary. Signed-off-by: Aidan MacDonald --- arch/mips/boot/dts/ingenic/jz4725b.dtsi | 7 ++----- arch/mips/boot/dts/ingenic/jz4740.dtsi | 7 ++----- arch/mips/boot/dts/ingenic/jz4770.dtsi | 5 ++--- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/arch/mips/boot/dts/ingenic/jz4725b.dtsi b/arch/mips/boot/dts/ingenic/jz4725b.dtsi index e9e48022f631..acbbe8c4664c 100644 --- a/arch/mips/boot/dts/ingenic/jz4725b.dtsi +++ b/arch/mips/boot/dts/ingenic/jz4725b.dtsi @@ -198,11 +198,8 @@ aic: audio-controller@10020000 { #sound-dai-cells = <0>; - clocks = <&cgu JZ4725B_CLK_AIC>, - <&cgu JZ4725B_CLK_I2S>, - <&cgu JZ4725B_CLK_EXT>, - <&cgu JZ4725B_CLK_PLL_HALF>; - clock-names = "aic", "i2s", "ext", "pll half"; + clocks = <&cgu JZ4725B_CLK_AIC>, <&cgu JZ4725B_CLK_I2S>; + clock-names = "aic", "i2s"; interrupt-parent = <&intc>; interrupts = <10>; diff --git a/arch/mips/boot/dts/ingenic/jz4740.dtsi b/arch/mips/boot/dts/ingenic/jz4740.dtsi index 7f76cba03a08..bdd6f4d82ec9 100644 --- a/arch/mips/boot/dts/ingenic/jz4740.dtsi +++ b/arch/mips/boot/dts/ingenic/jz4740.dtsi @@ -192,11 +192,8 @@ aic: audio-controller@10020000 { interrupt-parent = <&intc>; interrupts = <18>; - clocks = <&cgu JZ4740_CLK_AIC>, - <&cgu JZ4740_CLK_I2S>, - <&cgu JZ4740_CLK_EXT>, - <&cgu JZ4740_CLK_PLL_HALF>; - clock-names = "aic", "i2s", "ext", "pll half"; + clocks = <&cgu JZ4740_CLK_AIC>, <&cgu JZ4740_CLK_I2S>; + clock-names = "aic", "i2s"; dmas = <&dmac 25 0xffffffff>, <&dmac 24 0xffffffff>; dma-names = "rx", "tx"; diff --git a/arch/mips/boot/dts/ingenic/jz4770.dtsi b/arch/mips/boot/dts/ingenic/jz4770.dtsi index bda0a3a86ed5..9c0099919db7 100644 --- a/arch/mips/boot/dts/ingenic/jz4770.dtsi +++ b/arch/mips/boot/dts/ingenic/jz4770.dtsi @@ -238,9 +238,8 @@ aic: audio-controller@10020000 { #sound-dai-cells = <0>; - clocks = <&cgu JZ4770_CLK_AIC>, <&cgu JZ4770_CLK_I2S>, - <&cgu JZ4770_CLK_EXT>, <&cgu JZ4770_CLK_PLL0>; - clock-names = "aic", "i2s", "ext", "pll half"; + clocks = <&cgu JZ4770_CLK_AIC>, <&cgu JZ4770_CLK_I2S>; + clock-names = "aic", "i2s"; interrupt-parent = <&intc>; interrupts = <34>; From patchwork Fri Oct 28 10:34:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aidan MacDonald X-Patchwork-Id: 13023381 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 30126ECAAA1 for ; Fri, 28 Oct 2022 10:36:14 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 4682118FB; Fri, 28 Oct 2022 12:35:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4682118FB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1666953372; bh=xtuYK78wg8qN8yXrqhdsBsgohu8xLd2QEhJ18xvp2aQ=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=HgiSpiS+fccEvx8HBYJHK9FhVRAJ6KLb4kwYL+X9JMm4q9ssT+/qr5HtVwu4bxiFY eIDHg34eFvV9VTTV/YSjeh2CISy3C0xI5aaiIfowc6jOGcCOA3QpCq8CV67A82pQWJ lGecsKAtR7nmJzUSCYN0uLN8cEkR6NBFj+xojSqo= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 9AA0EF8055C; Fri, 28 Oct 2022 12:34:36 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 87FE6F80095; Fri, 28 Oct 2022 12:34:33 +0200 (CEST) Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id F151AF804D0 for ; Fri, 28 Oct 2022 12:34:30 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F151AF804D0 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="imzO8c9I" Received: by mail-wr1-x42c.google.com with SMTP id h9so6091992wrt.0 for ; Fri, 28 Oct 2022 03:34:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VTLqcHpLknCfW4rU/oVOZ72CKaRxSFT1z0XfsYLerY4=; b=imzO8c9InqFWAAe6UDl0tJeylGXAQfRifIWLxkEBBPkDDUoq2OeAehXep3L+AUcFV4 LhTomTHllwI5F8+VOPZznHFHmr51Nxp3RPNNaANnkgxfPQD2t443F1HLxZykztKpM1De HwfNABEBPfu3PtyydWY7snwBdKmHigdexxAbytchL1D+7bbKKCaTOrHDuLhbPSuR9JX6 F0iC2zRQ63X4kROMVyd0e1o165TC1h8n9CuneBAEtgSEoBa8TV3/v0Njypss0+tnB1VI b/q/x63MDmFqBYBPv3d6FFH/iPDs5+XRVdavLRqWqPaZIL+yEo4tkYBJIuPg6rwQLfQT CiXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VTLqcHpLknCfW4rU/oVOZ72CKaRxSFT1z0XfsYLerY4=; b=VAx6uBan9dHC6zOC/wpk15p4wZURBeTMS9brR50zj0/EDdpEnV3BO4emugyOpi/wDV DAnW3jqHvwDtYnfopFEOvs5QRFZPuGGugX/9Cek/17ea5yDeC9NDGBDBABnIgzFrNwWw NvRJ8T4bkq4xvCuEfNJccp/dpOZfESFqtcohj0mosA9ZU1+Z81Jq3iiy6EQaZbnFwiLN 4yB32NaSgfvwqT3K6LgavdWl4E+uFkqg5UJj789m1CgiKhIWcKA1K6Y/9lpnd+1BLNIJ jtc3IMo/HrRIngKpXNDUUhWwcCKtJSgIvU4brkLuUSKNgS9Mq/BZ+K+Ew5OnJS8b9OTR y5vg== X-Gm-Message-State: ACrzQf0bWZ1F2xSjGEac6F7tB+XA5gcnBHZaflVluuOQQ3azfQkxf23a QeIHx3/xZ2SR2fNs/oRltJk= X-Google-Smtp-Source: AMsMyM7xKnVs7p0u7RjUBpS/H+wM1foxGyZ7zOdVy4011K+n1YCXJ6oaIUI+vH0bMmnXElFL5TCO6g== X-Received: by 2002:adf:e510:0:b0:235:de50:72ff with SMTP id j16-20020adfe510000000b00235de5072ffmr27142953wrm.100.1666953269251; Fri, 28 Oct 2022 03:34:29 -0700 (PDT) Received: from localhost (94.197.40.204.threembb.co.uk. [94.197.40.204]) by smtp.gmail.com with ESMTPSA id d13-20020adff84d000000b0023682011c1dsm3277496wrq.104.2022.10.28.03.34.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 03:34:28 -0700 (PDT) From: Aidan MacDonald To: paul@crapouillou.net, lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, tsbogend@alpha.franken.de, perex@perex.cz, tiwai@suse.com Subject: [PATCH v1 3/3] ASoC: jz4740-i2s: Remove .set_sysclk() Date: Fri, 28 Oct 2022 11:34:18 +0100 Message-Id: <20221028103418.17578-4-aidanmacdonald.0x0@gmail.com> In-Reply-To: <20221028103418.17578-1-aidanmacdonald.0x0@gmail.com> References: <20221028103418.17578-1-aidanmacdonald.0x0@gmail.com> MIME-Version: 1.0 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" .set_sysclk() is effectively unused here. No machine drivers use jz4740-i2s; and JZ4740_I2S_CLKSRC_EXT is the only selectable clock source with simple-card, but that is also the default source and has a fixed frequency, so configuring it would be redundant. simple-card ignores -ENOTSUPP error codes when setting the sysclock, so any device trees that do set the sysclock for some reason should still work. It's still possible to configure the clock parent manually in the device tree and control frequency using other simple-card options, so at the end of the day there's no real loss in functionality. Signed-off-by: Aidan MacDonald Reviewed-by: Paul Cercueil --- Meant to be applied on top of jz4740-i2s cleanups series already in linux-next. Link: https://lore.kernel.org/alsa-devel/20221023143328.160866-1-aidanmacdonald.0x0@gmail.com/ sound/soc/jz4740/jz4740-i2s.c | 32 -------------------------------- sound/soc/jz4740/jz4740-i2s.h | 10 ---------- 2 files changed, 42 deletions(-) delete mode 100644 sound/soc/jz4740/jz4740-i2s.h diff --git a/sound/soc/jz4740/jz4740-i2s.c b/sound/soc/jz4740/jz4740-i2s.c index b620d4462d90..6d9cfe0a5041 100644 --- a/sound/soc/jz4740/jz4740-i2s.c +++ b/sound/soc/jz4740/jz4740-i2s.c @@ -23,8 +23,6 @@ #include #include -#include "jz4740-i2s.h" - #define JZ_REG_AIC_CONF 0x00 #define JZ_REG_AIC_CTRL 0x04 #define JZ_REG_AIC_I2S_FMT 0x10 @@ -273,35 +271,6 @@ static int jz4740_i2s_hw_params(struct snd_pcm_substream *substream, return 0; } -static int jz4740_i2s_set_sysclk(struct snd_soc_dai *dai, int clk_id, - unsigned int freq, int dir) -{ - struct jz4740_i2s *i2s = snd_soc_dai_get_drvdata(dai); - struct clk *parent; - int ret = 0; - - switch (clk_id) { - case JZ4740_I2S_CLKSRC_EXT: - parent = clk_get(NULL, "ext"); - if (IS_ERR(parent)) - return PTR_ERR(parent); - clk_set_parent(i2s->clk_i2s, parent); - break; - case JZ4740_I2S_CLKSRC_PLL: - parent = clk_get(NULL, "pll half"); - if (IS_ERR(parent)) - return PTR_ERR(parent); - clk_set_parent(i2s->clk_i2s, parent); - ret = clk_set_rate(i2s->clk_i2s, freq); - break; - default: - return -EINVAL; - } - clk_put(parent); - - return ret; -} - static int jz4740_i2s_dai_probe(struct snd_soc_dai *dai) { struct jz4740_i2s *i2s = snd_soc_dai_get_drvdata(dai); @@ -318,7 +287,6 @@ static const struct snd_soc_dai_ops jz4740_i2s_dai_ops = { .trigger = jz4740_i2s_trigger, .hw_params = jz4740_i2s_hw_params, .set_fmt = jz4740_i2s_set_fmt, - .set_sysclk = jz4740_i2s_set_sysclk, }; #define JZ4740_I2S_FMTS (SNDRV_PCM_FMTBIT_S8 | \ diff --git a/sound/soc/jz4740/jz4740-i2s.h b/sound/soc/jz4740/jz4740-i2s.h deleted file mode 100644 index 4da14eac1145..000000000000 --- a/sound/soc/jz4740/jz4740-i2s.h +++ /dev/null @@ -1,10 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -#ifndef _JZ4740_I2S_H -#define _JZ4740_I2S_H - -/* I2S clock source */ -#define JZ4740_I2S_CLKSRC_EXT 0 -#define JZ4740_I2S_CLKSRC_PLL 1 - -#endif