From patchwork Mon Jun 5 03:15:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunyan Zhang X-Patchwork-Id: 9765351 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 40AC160353 for ; Mon, 5 Jun 2017 03:15:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 30C08271BC for ; Mon, 5 Jun 2017 03:15:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2542D237A5; Mon, 5 Jun 2017 03:15:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71CA9237A5 for ; Mon, 5 Jun 2017 03:15:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751245AbdFEDP1 (ORCPT ); Sun, 4 Jun 2017 23:15:27 -0400 Received: from mail-vk0-f46.google.com ([209.85.213.46]:36789 "EHLO mail-vk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751236AbdFEDP0 (ORCPT ); Sun, 4 Jun 2017 23:15:26 -0400 Received: by mail-vk0-f46.google.com with SMTP id p85so60533351vkd.3 for ; Sun, 04 Jun 2017 20:15:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=SdFXDDvP+TuignHsES802XeV1Nnh3qUGM7/hR1cQhRU=; b=DrGGcJrgOLNfJSE4j4g6imC5nVKCPMDjbwy3HGCly3K7tNSzaAzhGX+2fy3My8O/7Z oVeg5uo3NiFVsMuUen5VL31M64wYsPqkGB2bGvg9hdECejJN2HY5aLjYprpkqxyUuFyB Fo353fXY4PW24TlohKMT7suu7fEveripR4bMs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=SdFXDDvP+TuignHsES802XeV1Nnh3qUGM7/hR1cQhRU=; b=isWuJSP7AUm/rxbXfQxzfTc+i6tcR2jcXGWL7NX47T3AObOP0+h9Loam98icEHG62j snPHSlWq7GMlDKOQzhcFyvlHg9/snj54+lQu4B72H+gpRESs7LRARS2NQs0piiSbsDhy dEBz6euJwwe28n1VgMYJvVSJ3xlVyG1CLSM5vrurKPL5NVhcNmBW/JNy24yqwM61/Cqg qm1EiEgLdI0YnIoqbd1JGPR/Jfp79rRePjzGrfkGS66UN/+Yhq6JC2mI3d9dVVTCkNSN w4fnDK+zaDEW+RqMmY9t9jJMDuzYBglFj7y8TI/CRJ0oi1ABVhztjQrDoZEec7zDNfC8 5Z6w== X-Gm-Message-State: AODbwcBD6uxVGnjGJZkskNpjlbG47sjDI5DuN8miCYKruFGPq7E53N2N QbpT7sUjOFS76VaDSIQxRZIUmnzsvFZm X-Received: by 10.31.52.17 with SMTP id b17mr9145046vka.150.1496632525525; Sun, 04 Jun 2017 20:15:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.31.61.201 with HTTP; Sun, 4 Jun 2017 20:15:25 -0700 (PDT) In-Reply-To: <20170602225621.GE20170@codeaurora.org> References: <1496306801-19239-1-git-send-email-zhang.chunyan@linaro.org> <20170602225621.GE20170@codeaurora.org> From: Chunyan Zhang Date: Mon, 5 Jun 2017 11:15:25 +0800 Message-ID: Subject: Re: [PATCH] Documentation: clock: address more for clock-cells property To: Stephen Boyd Cc: Michael Turquette , Rob Herring , Mark Rutland , linux-clk@vger.kernel.org, "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" , Lyra Zhang Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Stephen, On 3 June 2017 at 06:56, Stephen Boyd wrote: > On 06/01, Chunyan Zhang wrote: >> The value of property 'clock-cells' is not determined only by the number of >> clock outputs in one clock node, it is actually determined by whether the >> clock output in this node can be referenced directly without index. If >> the output clock has to be referenced by a index, the clock-cell of this >> clock node can't be defined 0. >> >> Signed-off-by: Chunyan Zhang >> --- >> Documentation/devicetree/bindings/clock/clock-bindings.txt | 10 ++++++++-- >> 1 file changed, 8 insertions(+), 2 deletions(-) > > I'm leaving this patch for Rob/DT maintainers to apply. > >> >> diff --git a/Documentation/devicetree/bindings/clock/clock-bindings.txt b/Documentation/devicetree/bindings/clock/clock-bindings.txt >> index 2ec489e..cef3db5 100644 >> --- a/Documentation/devicetree/bindings/clock/clock-bindings.txt >> +++ b/Documentation/devicetree/bindings/clock/clock-bindings.txt >> @@ -15,8 +15,14 @@ value of a #clock-cells property in the clock provider node. >> >> Required properties: >> #clock-cells: Number of cells in a clock specifier; Typically 0 for nodes >> - with a single clock output and 1 for nodes with multiple >> - clock outputs. >> + with a single clock output and it must be able to be >> + referenced without index, and 1 for nodes with single or >> + multiple clock outputs which have to be referenced by index. >> + >> + Please note that if a node with a single clock output >> + but it has "clock-indices" property (see bellow), it has >> + to be referenced by index, its "#clock-cells" cannot be >> + defined 0. > > Maybe this should be added to the clock-indices area of the > document instead of here? It seems to me that you can't have > clock-indices if you have #clock-cells=<0>, and that's sort of > obvious because 0 cells means 1 output and >0 cells means > potentially many outputs. Sorry for not being able to document clear enough. Let me try to explain why I added this paragraph here rather than clock-indices area. The sentence "0 for nodes with a single clock output" made me confused. In the platform I'm working on, some clock has a single clock output though, the identifying number for the clock output , #clock-cells cannot be set 0. I just wanted to make this sort of cases being cleared. My point was that clock-cells with zero was not for all kinds of clocks which has one single output. I tried to rewrite the description below, would it be better? :) Thanks for the review, Chunyan > > -- > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, > a Linux Foundation Collaborative Project --- To unsubscribe from this list: send the line "unsubscribe linux-clk" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/Documentation/devicetree/bindings/clock/clock-bindings.txt +++ b/Documentation/devicetree/bindings/clock/clock-bindings.txt @@ -18,6 +18,9 @@ Required properties: with a single clock output and 1 for nodes with multiple clock outputs. + There's one exception, please see the description for + clock-indices below. + Optional properties: clock-output-names: Recommended to be a list of strings of clock output signal names indexed by the first cell in the clock specifier. @@ -48,6 +51,13 @@ clock-indices: If the identifying number for the clocks in the node is not linear from zero, then this allows the mapping of identifiers into the clock-output-names array. + This property not only servers for clocks with multiple + clock outputs, but also for clocks with a single clock + output whose identifying number is not zero. + + So long as clock-indices is set, clock-cells cannot be + set zero. + For example, if we have two clocks <&oscillator 1> and <&oscillator 3>: