Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp4517413rwi; Sat, 22 Oct 2022 11:19:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6BRD6iya+nhAi4dqUu77Dh1X7JWaNr5tp54UOh2ANCHCvQLzS5NGz9A5ahl44tzQqJ03hR X-Received: by 2002:a65:4c0e:0:b0:46a:eeb1:e78a with SMTP id u14-20020a654c0e000000b0046aeeb1e78amr21428391pgq.193.1666462777160; Sat, 22 Oct 2022 11:19:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666462777; cv=none; d=google.com; s=arc-20160816; b=aJvCiyyaLpZYd1RmTr/tGjsNrsA/SC5KOiR7lYftK2SqzRexaLAfgWX3XwgjWedbeD BzHtENPpi9BMHBmrR5AbrFYJsuUsy49sei6kTuB//IcdFFLjqmKDy55ZMwg3wxrerOrn DJl/WnB89eEwaT2WlZveaS6Q5Wy5HoJ/cgnu2txJ0qLcexzhpd7IiPUdLnncwvF29BSq xC03jeLSI0zhxcD25r7G+S0pPuRT3g47ihqs+KplBAjSQqMCwh2DF92aa4GR5SjBsJlF NpUWaTI9oly+5hrMhkLcrmQWFcK+B8jfsJScncxU1Ers2PCvQALPf3UW3oIcWc5DoLn1 RZ6w== 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 :message-id:date:in-reply-to:subject:cc:to:from:references :dkim-signature; bh=OEdRsgVqCkcKz4eZ7jkOylFepk0zkXtGkfANql0O2yY=; b=m47V/6S0TK103urIFCU44+4uapgDde28HqMypluwgSbFpfZLN9pOLCqfWl8seVIrn0 Bns11uFBLEljq04YLLWXWBtHuy/wqv1Ex9bCkAF8LRN/vuZ9LQJaazWz71oyNNdacaXQ dFshdtCH02Z13pVrJmsfk/XsIZZ7hCaylgHGRo3m0zrF6wslUTIrkO/lC+rkQ5pp4aDr hzWaZyJNWklyiBFzdKvz2FlXmoWPbJOvqh/gn+uaTx9rppsT7eKacaVETeY30czM1Uul bvq9kJDQDBl/T08TjiF9JyxdA8/46x1sU6YW4Yebe4HLKZ8xGqR9xPqfqnWcLJKjsoJk qMzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eDHT+PdT; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q11-20020a17090aa00b00b00203182b9d00si3254165pjp.130.2022.10.22.11.19.17; Sat, 22 Oct 2022 11:19:37 -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=eDHT+PdT; 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 S229782AbiJVRPN (ORCPT + 99 others); Sat, 22 Oct 2022 13:15:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229803AbiJVRPL (ORCPT ); Sat, 22 Oct 2022 13:15:11 -0400 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68D6754677; Sat, 22 Oct 2022 10:15:07 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id j7so9490693wrr.3; Sat, 22 Oct 2022 10:15:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:in-reply-to :subject:cc:to:from:references:from:to:cc:subject:date:message-id :reply-to; bh=OEdRsgVqCkcKz4eZ7jkOylFepk0zkXtGkfANql0O2yY=; b=eDHT+PdTkIpoA25cMakJH7LwzPhBP3+NLqYVcxGoKNV/kY/iRn4XvItq9CASOMKBhz 8V/Q5Wqq6WzKuKE8ScZ+DAXjp+EBhgNKy7dKLvxM1kQG9BlY8NWyjzcvy0+cLXZgtnVb z7WxJ8m58IsjgXN3ijExpHHd2iUYYxS3AVmCfnLA2qPNV/Ybn9TlyKZ25+if9XxIaDKH UuFFNYliJYaaporq2xKqMbW8/5hRTL+LNUAkt2YxETG7l8Y1jVepQDxsJPVx7aRQ9WPq U613c1blBAGUs7IDXWZlxY9p+TMh3I3tFTTwNStYXmpiQmyY8tK8QmZg47xBDocB2COn RVsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:in-reply-to :subject:cc:to:from:references:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=OEdRsgVqCkcKz4eZ7jkOylFepk0zkXtGkfANql0O2yY=; b=264gNRmwis7kijoprGHI3FTUEhi/GhzEzG9cspA0CUcxjgELtSeHuC6MovbwIkS9a/ lpeiJjlzqMJ/Lck3bAZCGX2DhSU/IguFfN8r50oF5xx7YoFGFcBIRXwFZi1BPLu62wsB wZdS/bO8oTQNWQeeWv6TunsW45GlUvTj2kvwe6albCEhcRxPcTkwOchdSwoJvIfL9PNT b7k9gDmCfPogZQWaPPIEFbYKJ4O7pT/Lft1mpB4UADTOBcpmz34mNgG8XTJqSuaKz8dS CN9WNQ/yZTHc1a2QZLH6OK4pvVgjhZkThQFje7rlrTEQ5mtBOQBKrNrubsfYu/qklXYU 8tfw== X-Gm-Message-State: ACrzQf1a/JXunOfHLbQCTYpbfEh7x6BNf4fgCzw4thiiJnAhQxtXx+VK 3WMqhYbaEBzWRNRG3+G9oiE= X-Received: by 2002:a5d:5142:0:b0:236:5d8d:6254 with SMTP id u2-20020a5d5142000000b002365d8d6254mr2649278wrt.514.1666458906363; Sat, 22 Oct 2022 10:15:06 -0700 (PDT) Received: from localhost (188.29.215.65.threembb.co.uk. [188.29.215.65]) by smtp.gmail.com with ESMTPSA id f15-20020a05600c154f00b003b4a68645e9sm3341141wmg.34.2022.10.22.10.15.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Oct 2022 10:15:05 -0700 (PDT) References: <20220708160244.21933-1-aidanmacdonald.0x0@gmail.com> <20220708160244.21933-8-aidanmacdonald.0x0@gmail.com> <0269b850-f33a-7aa9-a3eb-83655bd4e19a@wanyeetech.com> <6f2c7a0b-b68b-fc42-1a82-2b69c114823f@wanyeetech.com> From: Aidan MacDonald To: Zhou Yanjie Cc: Paul Cercueil , lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, linux-mips@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 07/11] ASoC: jz4740-i2s: Make the PLL clock name SoC-specific In-reply-to: <6f2c7a0b-b68b-fc42-1a82-2b69c114823f@wanyeetech.com> Date: Sat, 22 Oct 2022 18:15:05 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 Zhou Yanjie writes: > Hi Paul, > > On 2022/7/13 =E4=B8=8B=E5=8D=8811:07, Paul Cercueil wrote: >> Hi Zhou, >> >> Le mer., juil. 13 2022 at 22:33:44 +0800, Zhou Yanjie >> a =C3=A9crit : >>> Hi Aidan, >>> >>> On 2022/7/9 =E4=B8=8A=E5=8D=8812:02, Aidan MacDonald wrote: >>>> @@ -400,6 +402,7 @@ static const struct i2s_soc_info jz4740_i2s_soc_in= fo =3D >>>> { >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 .field_tx_fifo_thresh=C2=A0=C2=A0=C2=A0= =3D REG_FIELD(JZ_REG_AIC_CONF, 8, 11), >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 .field_i2sdiv_capture=C2=A0=C2=A0=C2=A0= =3D REG_FIELD(JZ_REG_AIC_CLK_DIV, 0, 3), >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 .field_i2sdiv_playback=C2=A0=C2=A0=C2= =A0 =3D REG_FIELD(JZ_REG_AIC_CLK_DIV, 0, 3), >>>> +=C2=A0=C2=A0=C2=A0 .pll_clk_name=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 =3D "pll half", >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 .shared_fifo_flush=C2=A0=C2=A0=C2=A0 = =3D true, >>>> =C2=A0 }; >>> >>> >>> Since JZ4760, according to the description of the I2SCDR register, >>> Ingenic SoCs no longer use PLL/2 clock, but directly use PLL clock, >>> so it seems also inappropriate to use "pll half" for these SoCs. >> >> The device tree passes the clock as "pll half". So the driver should use= this >> name as well... > > > I see... > > It seems that the device tree of JZ4770 has used "pll half" already, > but there is no "pll half" used anywhere in the device tree of JZ4780, > maybe we can keep the pll_clk_name of JZ4770 as "pll half", and change > the pll_clk_name of JZ4780 to a more reasonable name. > > > Thanks and best regards! Actually, the clock names in the DT are meaningless. The clk_get() call matches only the clock's name in the CGU driver. So in fact the driver is "broken" for jz4780. It seems jz4770 doesn't work correctly either, it has no "pll half", and three possible parents for its "i2s" clock. Since the driver only supports the internal codec, which requires the "ext" clock, there isn't a problem in practice. I'm just going to drop this patch and leave .set_sysclk() alone for now. I think a better approach is to have the DT define an array of parent clocks for .set_sysclk()'s use, instead of hardcoding parents in the driver. If the parent array is missing the driver can default to using "ext" so existing DTs will work. Regards, Aidan