Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp15000410rwb; Mon, 28 Nov 2022 07:04:38 -0800 (PST) X-Google-Smtp-Source: AA0mqf6c0JBt6mvZjDg9+49q7DGtWJpafckj8EtwepxvsItV/i7cXxoITU4IVD/EveokAS7wDCcY X-Received: by 2002:a05:6402:a41:b0:462:273b:6b5c with SMTP id bt1-20020a0564020a4100b00462273b6b5cmr46385786edb.57.1669647878125; Mon, 28 Nov 2022 07:04:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669647878; cv=none; d=google.com; s=arc-20160816; b=Wv29HJPsa7nAje48HsHGRmZx2mkR9fvzv0rZU75+B7HDyXj8weQlNCvnKxn7ME1aIz EnOoU3huSetm+oboTaLOAsE5hRUj/JQbXxs6qaRZ+1rAEVhsnVBS3dZ34/JJs+j965+v 7dSG3/J3UkQOhUqsj8YF4y+pXH1URvo2eqwVEjdo2rB+1aYl7PnST+7EuHyH1pUgcYVp wwyujtBz344O8jr+tI/4tKyALWSe0vOadkgYiJTNwjSk5UP5udzwvqSdrM8mpPuBQBw/ avYsSwDHT+MpU8jFE/EJVFaPrRjngcC2M+tYM8QINJm8Jpn6RIkSp5P7QO1aoKAPo0r4 xi3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=lwIjSiZYAWevmabQob0cKqihQtbr9qbkm3tAKdFoCLE=; b=ErW7N3Y76sLYVbhOZgyCurNImT+8wQmGnQ3QaN7V5FCPfC+0oZeU+o6UKoo8hgLMBi 410XVDdqPFD+MS85422qV0/b8D96rlrj2MKk9OVrOTSbgzcsqT6SxsPJpcZr8AV02ZdI Im032GW8FCNS1IRl6Mm2I2cMXbfYnXLdNIjpbBg/hCDP5Txfrwdm9L/0mD4D13my40yo VGwO2Rl6z8l/w4QPj+kdEZGMCRlpM3o1K4yJs7QK9cQa2ZtpM6aqaNoFouV5grttNV6A Ik+D0TBP8xhqXA28f0SrdKPZezvsFEeGcjnI7mu0GeNsXSi+MIGQ0oZzDkNYGPT6Yp/+ hGdg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hr14-20020a1709073f8e00b00787abcb1ce0si10757523ejc.679.2022.11.28.07.04.00; Mon, 28 Nov 2022 07:04:38 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232281AbiK1ODz (ORCPT + 84 others); Mon, 28 Nov 2022 09:03:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231232AbiK1ODu (ORCPT ); Mon, 28 Nov 2022 09:03:50 -0500 Received: from mail-sh.amlogic.com (mail-sh.amlogic.com [58.32.228.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82D08A478; Mon, 28 Nov 2022 06:02:50 -0800 (PST) Received: from [10.18.29.47] (10.18.29.47) by mail-sh.amlogic.com (10.18.11.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.13; Mon, 28 Nov 2022 22:02:47 +0800 Message-ID: Date: Mon, 28 Nov 2022 22:02:47 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.13.1 Subject: Re: [PATCH V5 3/4] clk: meson: s4: add s4 SoC peripheral clock controller driver and bindings Content-Language: en-US To: Jerome Brunet , , , , , , Rob Herring , Neil Armstrong , Kevin Hilman , Michael Turquette , Stephen Boyd , Krzysztof Kozlowski , Martin Blumenstingl CC: References: <20221123021346.18136-1-yu.tu@amlogic.com> <20221123021346.18136-4-yu.tu@amlogic.com> <1jbkov2vb9.fsf@starbuckisacylon.baylibre.com> <81d9a794-2920-64f1-1d80-50653113624c@amlogic.com> <1jilizp8bs.fsf@starbuckisacylon.baylibre.com> From: Yu Tu In-Reply-To: <1jilizp8bs.fsf@starbuckisacylon.baylibre.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.18.29.47] X-ClientProxiedBy: mail-sh.amlogic.com (10.18.11.5) To mail-sh.amlogic.com (10.18.11.5) X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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 Hi Jerome, On 2022/11/28 20:23, Jerome Brunet wrote: > [ EXTERNAL EMAIL ] > > > On Mon 28 Nov 2022 at 16:08, Yu Tu wrote: > >>>> + >>>> +/* >>>> + * This RTC clock can be supplied by an external 32KHz crystal oscillator. >>>> + * If it is used, it should be documented in using fw_name and documented in the >>>> + * Bindings. Not currently in use on this board, so skip it. >>>> + */ >>>> +static u32 rtc_clk_sel[] = { 0, 1 }; >>> No reason to do that >> >> I'm going to change it to static u32 rtc_clk_sel[] = { 0, 1, 2 };. >> I don't know if that's okay with you? > > ... then there is no need to specify this table. > I got it.I'll change it as you suggest. > > >> >>> >>>> +static const struct clk_parent_data rtc_clk_sel_parent_data[] = { >>>> + { .hw = &s4_rtc_32k_by_oscin.hw }, >>>> + { .hw = &s4_rtc_32k_by_oscin_div.hw }, >>>> + { .fw_name = "ext_32k", } >>>> +}; >>>> + >>>> +static struct clk_regmap s4_rtc_clk = { >>>> + .data = &(struct clk_regmap_mux_data) { >>>> + .offset = CLKCTRL_RTC_CTRL, >>>> + .mask = 0x3, >>>> + .shift = 0, >>>> + .table = rtc_clk_sel, >>>> + .flags = CLK_MUX_ROUND_CLOSEST, >>>> + }, >>>> + .hw.init = &(struct clk_init_data){ >>>> + .name = "rtc_clk_sel", >>>> + .ops = &clk_regmap_mux_ops, >>>> + .parent_data = rtc_clk_sel_parent_data, >>>> + .num_parents = 2, >>>> + .flags = CLK_SET_RATE_PARENT, >>>> + }, >>>> +}; >>>> + > > [...] > >>>> + >>>> +/* Video Clocks */ >>>> +static struct clk_regmap s4_vid_pll_div = { >>>> + .data = &(struct meson_vid_pll_div_data){ >>>> + .val = { >>>> + .reg_off = CLKCTRL_VID_PLL_CLK_DIV, >>>> + .shift = 0, >>>> + .width = 15, >>>> + }, >>>> + .sel = { >>>> + .reg_off = CLKCTRL_VID_PLL_CLK_DIV, >>>> + .shift = 16, >>>> + .width = 2, >>>> + }, >>>> + }, >>>> + .hw.init = &(struct clk_init_data) { >>>> + .name = "vid_pll_div", >>>> + /* Same to g12a */ >>>> + .ops = &meson_vid_pll_div_ro_ops, >>> Please add an helpful explanation. >>> 'Same to g12a' is not helpful. >>> >> >> "Because the vid_pll_div clock is a clock that does not need to change the >> divisor, ops only provides meson_vid_pll_div_ro_ops." >> I wonder if this description is ok for you? > > I understand this divider will not change with RO ops. > I'm interrested why it does not change and how it is expected to be setup. > Maybe you can be more specific, I don't understand, you're interested in that part of it specifically. I don't know if you have the document of chip. If not, I can provide it to you privately. You can ask specific questions in conjunction with your documentation and submission(The original submission came from you.). I can give you a specific answer or ask the chip designer to give you a reply.Do you think that's okay with you >> >>>> + .parent_data = (const struct clk_parent_data []) { >>>> + { .fw_name = "hdmi_pll", } >>>> + }, >>>> + .num_parents = 1, >>>> + .flags = CLK_SET_RATE_PARENT, >>>> + }, >>>> +}; > > [...] > >>>> + >>>> +static struct clk_regmap s4_vclk_sel = { >>>> + .data = &(struct clk_regmap_mux_data){ >>>> + .offset = CLKCTRL_VID_CLK_CTRL, >>>> + .mask = 0x7, >>>> + .shift = 16, >>>> + }, >>>> + .hw.init = &(struct clk_init_data){ >>>> + .name = "vclk_sel", >>>> + .ops = &clk_regmap_mux_ops, >>>> + .parent_data = s4_vclk_parent_data, >>>> + .num_parents = ARRAY_SIZE(s4_vclk_parent_data), >>>> + }, >>> You are stopping rate propagation here. >>> It deserves an explanation. Same goes below. >> >> "When the driver uses this clock, needs to specify the patent clock he >> wants in the dts." >> Is ok for you? > > Then you still don't understand the clock flag usage. > > Preserving the parent selection (CLK_SET_RATE_NO_REPARENT) and rate > propagation (CLK_SET_RATE_PARENT) is not the same thing. > > As it stands, your comment is not aliged with what you do. > Thanks for the explanation of flag. My goal is to have the clock user describe themselves in DTS using the parent, or using the assigned-clocks and assigned-clock-parents settings in DTS. According to your explanation, some clocks like this should use CLK_SET_RATE_NO_REPARENT, right? >> >>> >>>> +}; > > .