Received: by 10.223.185.116 with SMTP id b49csp5642401wrg; Tue, 27 Feb 2018 17:54:09 -0800 (PST) X-Google-Smtp-Source: AH8x226BaeNhPsc97POkMhCJIGawv3GketxkEjXo+Kh/WMEIOOaczlZlQKbxBMfrMiVxZvv4tMia X-Received: by 10.99.122.71 with SMTP id j7mr12736272pgn.151.1519782849308; Tue, 27 Feb 2018 17:54:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519782849; cv=none; d=google.com; s=arc-20160816; b=ayko4rZiCMYC7RClBPNh28tW5FNiJIT717n9pUUiKAMEGP7eDrGz1ipbXRohqUQ0OJ Y8FXUZs23gLUrA8GhMzJrd5/O6g72MweOeQNLjY8JxIPffa7NHv0ULqnh1R2wkgyszw6 8Yp0Jj2zcXSF/gDDJzU9FB1Ms5AJQrIWkmZwEjY1F2TooJXFzEhafdmrf2UvEE1URH33 nIngH+Zc5Eq3LyHva5ZRHTUpQP8xXgCe4hjZGLGLs3lGRr563wf4vuk2nTuQxrmVzzbw fhbJplBjqIi4DtxWHmnjKKM4pCqO661Wk/xorQ43t8ghySi9Y69UC/kVcxCjn4BZuZ2g nP5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:organization:from:cc :references:to:subject:arc-authentication-results; bh=ZKNaOZE5LpLwrCW8hpza9QFkW7WkHySXephIILSuaNs=; b=gn6hmtqR/DBZuRTc/OGkS8ALNls/uzrmTddo9KrUXP2VmLQHINVpvMOG9qD0wSHT4X 7GAL9JB2JAsYPnDZCeBrLixFWjMt4ryoHMsSrvcPJwxltZaJxbJpTTMFIvKUT5Dz2u2E 6R6AaSzE+G+IJ/Dv9avbf/UgSA+i81vu5jaMpPwrzGuRCGnOz1J8WLEQ+7e6Om2eHRGb Ghz05mkIozANuwW8FOgSqwLQpTwycpPM1LOzEkJo6bS/gjrrOd2eoyIoyN2ogX/tJxkK QTMRWrzRbEpt1olIL2890uaZJHoNxOxLgPJ61++2jNibRZEuj6mmuslQOqu/NnwEDz0S oOvg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t18si381618pfg.246.2018.02.27.17.53.43; Tue, 27 Feb 2018 17:54:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751801AbeB1Bwq (ORCPT + 99 others); Tue, 27 Feb 2018 20:52:46 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:43280 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751605AbeB1Bwo (ORCPT ); Tue, 27 Feb 2018 20:52:44 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 410CE1435; Tue, 27 Feb 2018 17:52:44 -0800 (PST) Received: from [192.168.3.112] (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D5C313F318; Tue, 27 Feb 2018 17:52:41 -0800 (PST) Subject: Re: [linux-sunxi] [PATCH v2 1/4] dt-bindings: pwm: binding allwinner sun8i. To: hao5781286@gmail.com, thierry.reding@gmail.com, robh+dt@kernel.org, mark.rutland@arm.com, maxime.ripard@free-electrons.com References: <20180225135045.GA14508@arx-s1> Cc: linux@armlinux.org.uk, wens@csie.org, Claudiu.Beznea@microchip.com, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pwm@vger.kernel.org, linux-sunxi@googlegroups.com From: =?UTF-8?Q?Andr=c3=a9_Przywara?= Organization: ARM Ltd. Message-ID: <56645bca-9f4a-3191-72d8-32b60ebbc26e@arm.com> Date: Wed, 28 Feb 2018 01:51:59 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20180225135045.GA14508@arx-s1> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 25/02/18 13:50, hao_zhang wrote: > This patch adds allwinner sun8i pwm binding documents. > > Signed-off-by: hao_zhang > --- > Documentation/devicetree/bindings/pwm/pwm-sun8i.txt | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > create mode 100644 Documentation/devicetree/bindings/pwm/pwm-sun8i.txt > > diff --git a/Documentation/devicetree/bindings/pwm/pwm-sun8i.txt b/Documentation/devicetree/bindings/pwm/pwm-sun8i.txt > new file mode 100644 > index 0000000..e8c48be > --- /dev/null > +++ b/Documentation/devicetree/bindings/pwm/pwm-sun8i.txt > @@ -0,0 +1,18 @@ > +Allwinner sun8i R40/V40/T3 SoC PWM controller > + > +Required properties: > + - compatible: should be one of: > + - "allwinner,sun8i-r40-pwm" > + - reg: physical base address and length of the controller's registers > + - #pwm-cells: should be 3. See pwm.txt in this directory for a description of > + the cells format. > + - clocks: From common clock binding, handle to the parent clock. The manual tells me that there are two possible clock sources (24 MHz OSC and APB1), with actually two bits for encoding the mux source, allowing for two more potential clock sources. So can we extend this description to provide up to four clocks, with a clock-names property telling the driver how this maps to the mux value? Either we use clock names matching the clocks mentioned in the manual: clocks = <&osc24M>, <&ccu CLK_APB1>; clock-names = "osc", "apb1"; or we encode the mux values in the clock-names: clock-names = "mux-0", "mux-1"; Don't know what's more widely used in those cases, the latter seems to be more future-proof. Each channel pair can be configured to use one of the two (or four) clocks, so we can be more flexible with multiple clocks. Also, can you please add an "interrupts" property here? You don't need to use it in the driver right now, but since there are multiple registers dealing with the interrupts we should have it in the binding. If in need, we can then add support later. > + > +Example: > + > +pwm: pwm@1c23400 { > + compatible = "allwinner,sun8i-pwm"; That should match what you wrote above: allwinner,sun8i-r40-pwm. And I believe this is the right compatible name, since there are numerous other sun8i SoCs with the sun4i PWM IP, so just sun8i-pwm would be misleading and confusing. > + reg = <0x01c23400 0x154>; > + clocks = <&osc24M>; This should then be amended to what I sketched above. > + #pwm-cells = <3>; And then here please add: interrupts = ; Cheers, Andre