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: 12227 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp747591wru; Fri, 28 Oct 2022 03:39:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM56g3Qe9nNsuprsYU1iZHmY1IQWgkCxZ6r4xZmXm1H7SKHq+KfekvAj14fNMeOBM7kURrTX X-Received: by 2002:a17:907:2bda:b0:78d:9144:fb6d with SMTP id gv26-20020a1709072bda00b0078d9144fb6dmr46338030ejc.238.1666953559350; Fri, 28 Oct 2022 03:39:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666953559; cv=none; d=google.com; s=arc-20160816; b=wipc974ibPEljFIeonwTuCZeO+5fguoqqXqXvf9zrtjzq5PmIzfyz4RMJgziNcdevr dMBq0b3IUREYEMajvt/4MoHJBcNsE96rRmEQ5Yf/7UidgK0eDZQxFkbRu63nc/4lYcWn Bi9JZEN8BK2nJUiyoa4Z5MBkl38WoaGPGdxyequCC8o7hXU5oZJaMTUArjY83N5qP2Bh C4Ga6MJmk2O2eef8gxq9zeDGn4yVmb/LOIa22BfgMiu3jXfwH4l9YYAz1FfJ/pxdY+eb WiCBPKXugRS59b1HcmU6P9HGWlIEXfsTMc9jROJRoMt96/ZYY8qaUH4mmx53cEtQ6wtc lu3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Iza2TaCkyzr/G3RQNexbZUSAsDCgwwO2VTwP3e6lVI8=; b=Ga/b3dFBK2qMJzknxiFqg91VCxSRda3OO8TQTxwnuR4G7Y9D7bcIaNSDZJF/OzxFCS maLUjp1nYqmvyBsl2f+tRc4qhi3o95k2ScI4fec0reDnIBun49pc4m0i5JS+DDKuP9tM ClWKe4SbYGHvYgY7NZ78XC2Wp3pglgZIMbSK+W1MLswAgAkYJ+oUjrv9mGPhGKG1rlJf JhXlzWWPxlhvNdnMEcqgIF4Big6c6IR+Xjn4Yoor2xitIlhLlhruvqBuzubUKL2vxors jEKLJPOocA/5tokm1FShrZt6aXIBtF0/913JlYw4IwxIFeeBt5+YTDipjwIQxyE8kZbk Tvfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=nW7fKiq0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i5-20020aa7dd05000000b0045c23138cd8si2557839edv.45.2022.10.28.03.38.54; Fri, 28 Oct 2022 03:39:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=nW7fKiq0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230409AbiJ1Kem (ORCPT + 99 others); Fri, 28 Oct 2022 06:34:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230216AbiJ1Keg (ORCPT ); Fri, 28 Oct 2022 06:34:36 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24C42AE78; Fri, 28 Oct 2022 03:34:28 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id j15so6050367wrq.3; Fri, 28 Oct 2022 03:34:28 -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=noaecvtjlW/+DMv0MsiOfsyam45qvVFn48kpoHMHurZ5q+7fnnrbPh6fWT1O1yv2Ur zGiFA98kblzX06tuH16VgtBgqhWzquiKIzaSweRSniK0y0+/s0/bXsMVvS+Esluq4WS9 2LMH5Ie/lfyKZsBgFRiQUQWKFeok8fEtinZklW1C40FxAxAs8UNTEV71X8fv+BJWe3EB 5VT2tIFTb4H/a6YQTNK1p4kNMvl2GydRDqcjaU51KCtnRhVnCAMsIZtzkz4gbX/pS+PW KfBKTrs7PdWgsdLzI45NWQ2pcqi7SI1amVyi1P71IJY89+TEVbdxhsYHIdx8xI9OYrRZ PQCw== X-Gm-Message-State: ACrzQf0DDMGHN20qXPH6edCXaYAUZIUFUo8OJpLM339zxRm++I9RAJvC wF8+zWJA5dIrElm8txRVvJQ= 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 Cc: alsa-devel@alsa-project.org, linux-mips@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org 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 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747927495149842746?= X-GMAIL-MSGID: =?utf-8?q?1747927495149842746?= 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: 12224 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp746598wru; Fri, 28 Oct 2022 03:37:43 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5DodtOJIQLLfhraqTVAPpv0+WMM0G9Da9QOF0SHi9HoxDBAQ4EOyUHWiTwkXaevDBt7HzG X-Received: by 2002:aa7:c78e:0:b0:456:c524:90ec with SMTP id n14-20020aa7c78e000000b00456c52490ecmr50210316eds.192.1666953463265; Fri, 28 Oct 2022 03:37:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666953463; cv=none; d=google.com; s=arc-20160816; b=W3VzedbWX6JU9qnZ5ed/o/jLGnCjOWxjEq8RKOATystQB71XeprKDYim05DPv2etIb l0G52KsSZSZj5pvItjJfyGCwbPdi+2vjMlFE4LlhBvE/lKTzKfSBwyvKAjP5mTQAJsdc HAaO0XARsYVzt6TP4bR9cQQSqsdOXKfMEygeb/0nOcenI9cpTMrRLtJ9omEjNBfPmrxt nYYJRBdL1bfX8NSzGaBmgfvWZpBfpo4j63eQLb6KD1xJC7Cae8e8hIB5F0Yd3dqyThjM YXigE7U43dmUfM9dhVhNBfXqT8dCQJIINga/iD63Y3HgRrU5wZDRuk0tDo1MsrO4Oi1o mmYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8Ea1wwle1wP6aS8WKh/9HKEpPf2vMavxdmBWSIJ+2x8=; b=iajL3z8gfuU6Bvk92mVSQuMg20DF+YKwciwi6giwfzoi4YG9plMj0vpettGyt0jTuf DubpqC0UUUXjm2C/jF7qyzTaTZ55AeaZdi8KlOy5Jj1hVsEIxx3SHwFAa6t3Ybu50EFK 772A441NCjpubT1cjgVx0qmAhPBkplF0mRK/MxkXHCApS6t+TX4WFGDoGUftYesFPF1g nngYMWdSCTTYYvwTc/ld/dWYENSaTgUaDMFqfFeRuE35pMWHhPfsizY4BOt5k0lrcHd+ 32/Cyns3ugeatYT4Wc+ddEWGsYHe5nBSxE/xr5s/YY25hqpXxjWB/RR3GAe8DdprEtP7 TKxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NNTAM0gN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h1-20020a056402280100b00461eff7bb0csi5349257ede.31.2022.10.28.03.37.19; Fri, 28 Oct 2022 03:37:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NNTAM0gN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230425AbiJ1Ket (ORCPT + 99 others); Fri, 28 Oct 2022 06:34:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230314AbiJ1Keg (ORCPT ); Fri, 28 Oct 2022 06:34:36 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4086ADFD9; Fri, 28 Oct 2022 03:34:29 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id v1so6025827wrt.11; 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=O+Ch6RYgkeDfnSxk1FfjmX4o4PMKtkHIY/nDpRFz+tnUnDllzDSGhEfrpv7bO2jkCS dytgzE85ewvhPKNuSP/OP7AOBQDKACplLqR3ShByaEixfFi6xKYnhN+VGsRVBIDL2x+O OmSiXLyBZ3oXpZAlAhMsSDSiN38KgM0HS4VoRCNqO6Ybpo7FIlmi98vh+fO7FvTaup9d p1zJGGDF12etJmDtpIicCxg4PA60Ahxj+8iRG8eO9EdNMyWAEJKhW79ZP2YTfNUeHUAm /p+5l7JfaNKZfj4A0JSnoINR7aBGbbexine020Bf46ea2wRB+B8cvJc/m6ubiRGI/Upf sHGA== X-Gm-Message-State: ACrzQf3hyJOostUpg+J64r2ILW9mGfiw/PSst+qJD9Ja7slG7LZaQzOq YgJWbUuQSO8RiC342F9iQt8= 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 Cc: alsa-devel@alsa-project.org, linux-mips@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org 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 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747927394378298363?= X-GMAIL-MSGID: =?utf-8?q?1747927394378298363?= 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: 12225 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp746669wru; Fri, 28 Oct 2022 03:37:48 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5E3q5VqOdgCk03qWPRWYxa2GMSdY5tT/FOh1hK/S6qtlPOnlTiEMhXJLvmneTOKyKr4tKj X-Received: by 2002:a05:6402:4148:b0:440:cb9f:d10f with SMTP id x8-20020a056402414800b00440cb9fd10fmr49808658eda.77.1666953468484; Fri, 28 Oct 2022 03:37:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666953468; cv=none; d=google.com; s=arc-20160816; b=wQ58GxzJoLBALYcaf7rOZkMFRrL4OwMWBzcHc8wJ2BNdQetS++S6vMscch6TMimVmj k53G/gfJ1WXmA5eeW1zR45MzXsVOXMiiFGjJM4PUDHolr2ndgvmt3r5sx6seX2wglaGu Qd88r/yLAkDHim1kVEoSYGBxucSAEpEh+Xvh9+nmOCUlei6GwIipxTMtQfTmMQicYRRm +hCBvyBh/yAsBgaEBHEMj3VR4026St/zlYJmkhatj1qzLRdRkgjk/sXmwKzngP27hojr dxU9Ixqt/FhZdBf+WD61U8hy9qoWk3MkppVfrpVWcA7i/W9nzVeV8SNvF3hm2mQiinQi 6lKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=VTLqcHpLknCfW4rU/oVOZ72CKaRxSFT1z0XfsYLerY4=; b=xEkBOhG9hpQgNbVShmAZpaG/+zkQF6T8IiRf4ymf7W3WKZlsmzXzobIZhJVt9Q3dbq RE9VEVgog5dCjZy47kIfdBQAnDC+T4Oe8nnCZZWY+mYgokQOozUhIRiJpF6CWfSMq5If RB2Z8mnYBX1s3rd20j/iRNitj4jKF+ZXaf1D+YboHrX9pwftrJSOvPHpOqftK+MK3aGm uUw6DRTQhSiZjh3WVMPIc85TQO8tZaNOxr6rJobzyjca3ka0nBtfhBCjp9en2Rbz19Nm zIO7AsHjKjSjNvuc9bek2Iakc+9sl9smk7ZS4bcYreJnVYKjcaf5RPEJOyggcgefyXfS sVOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=imzO8c9I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ss21-20020a170907039500b00782b24c1ed8si3580397ejb.368.2022.10.28.03.37.24; Fri, 28 Oct 2022 03:37:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=imzO8c9I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230437AbiJ1Kez (ORCPT + 99 others); Fri, 28 Oct 2022 06:34:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230333AbiJ1Keg (ORCPT ); Fri, 28 Oct 2022 06:34:36 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A019E10551; Fri, 28 Oct 2022 03:34:30 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id v1so6025898wrt.11; 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=57jJ9AiOKfa0NR9r/KuSERYCm2yPjKQH5lz32icaCw2vRy8ZN/gGsRRZM8sjGtWyua wfOWR+n3m0Bs9SX/bjWfo/mDXvQt/y8p6xnk5WCVoe+fV/yCpRzQGOYYr2n6BZrdCJey baknIeHj/MjivAybbZ6gSysp6bFd1PY5lz0ZEIIvCr+Z+WMAtRRetzF0oQ+zxyOB1EY6 6n9+1TthnUDIAaFiGyw7QpPruqqAEECGYrgBJJ7dt5f4y/bErcbJQyAo3SpbgRCXupQB 86OjiofRt17LKWPh5zzDFUxgWD9JCeLHCTZlUbwLduS3tu39FXC7djCR2RMzfHDQAK6B WkRQ== X-Gm-Message-State: ACrzQf2sb/ZRWVoxNcCTDKQhA9qP0zae1xtCAYJdrk7yt+R2HNL4b0+N tJPtXJSs75cyWqB51JxqfUw= 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 Cc: alsa-devel@alsa-project.org, linux-mips@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org 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 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747927400104612662?= X-GMAIL-MSGID: =?utf-8?q?1747927400104612662?= .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