Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp572250ybl; Wed, 14 Aug 2019 02:35:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqwNGttNZ8RvWhfOZIYVfado3YXuQ/iNx0rsqs9PLEjLRH324VwxB0aof813k2Xi5mAeZE0J X-Received: by 2002:a62:381:: with SMTP id 123mr1605252pfd.43.1565775354007; Wed, 14 Aug 2019 02:35:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565775354; cv=none; d=google.com; s=arc-20160816; b=o8DFy/vM8ITJgpifCreUp4ZCwpvgyq3sfrrDKxw6Nfcwc1F+A+mKAkJB+ptePUr2jq HnqN1arccGDt1xtOFOxQ1Pzu0AfXFaXWyXJ8UJCtIvyaH3fRxvh4Dm6gadUTcnFtoNry PNDTcl1GPKVTJ5Qgq4GSX5XR2+wdwBrUhmNpq2Uy3CVeuVzBPZ4vWQJ+uTF8qfTrqGhn +Eq5AwY/B7L9gwj2ttKv/c98KWYw5sMlvkl4ym5BGzE4DEGeHyKW4C8bEQirRiAbmVcO v2C4bzPR6BH/mY8QuuouWIpc1iJB99jNXhg/bTFMrlX0xdc4p/UWomRTOcWDNqBo/V8S P6Vw== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=z3K6SWbM7px/n5gKPd1KAWBDHaZFHlu80p3kmOyIsGk=; b=aYboPFQce/UBlhMes+5XTN1x6Ua4CBpvQbtzllrrUsfeTDkcLq5/gBiFRqKmvp0Iv8 J1B08F/KkmNCF6hwKb1EgMvYxyeU6wanLxcRLd1rhCZpL1dHqo3TYDDw/OGGovTiby/D AEqRHIsvarTvBRKTNsOME+I97VYYllPN2wexoTWMfmd/AUIMK0MauqUzb0+9cRJ6Li7v Z23305ckRnox2s6BlBF/NSywulxlHJH4pMwCW2t/GYv9O+KThkW5otwn+hT5ZQ9DedHp gERAAvC7A66MZ/DvMK0wzfBUWhhnWPeLXPQTB1Aev/jkXShYHShTT/a6oBjWcSbFE46J lnLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d5M3AT10; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f17si3449059plj.17.2019.08.14.02.35.38; Wed, 14 Aug 2019 02:35:53 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=d5M3AT10; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726821AbfHNJdj (ORCPT + 99 others); Wed, 14 Aug 2019 05:33:39 -0400 Received: from mail-oi1-f193.google.com ([209.85.167.193]:36101 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726383AbfHNJdi (ORCPT ); Wed, 14 Aug 2019 05:33:38 -0400 Received: by mail-oi1-f193.google.com with SMTP id c15so16557057oic.3 for ; Wed, 14 Aug 2019 02:33:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=z3K6SWbM7px/n5gKPd1KAWBDHaZFHlu80p3kmOyIsGk=; b=d5M3AT10QcaE7MW1oMDKR9t9+SJhHwYmI4wyXzGa6u8kTuQJ2fz0Y6ZFc1IPaSYI+H 9ZJy6KfMqLRUZUr7VV+VT9Pw8SyGRSPCyfr3VPQK4md+tHyBnNxu8YDTn6tqKBp3i07D HWyyJApnaXXy2mP4zvZTutjZ+XEF9r5rcZkTAn0DahAMcGIZgjk8Vg+DSq8LDoylOcao kejK0ZDomi4vfug+XWSYPo7TgfdO6rOiRQ5KnESGZPp1PQg/06SL60a8f8x1oKa8HqWm PHOK8SpzduqrAgAr+DD4KtSl43THXSMebzoTQeV/I+0+5oBkUSLjdohxyEUq7Glea9JQ g56Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=z3K6SWbM7px/n5gKPd1KAWBDHaZFHlu80p3kmOyIsGk=; b=RzcEEDjbq3ZzspiWl9JSrzRR4g57Nsciiaokf+LsY6qthvUH6gYtXUL5fP8n+AxBkd Dl5Pd3U7BDFJbNEisbSW03MExujSbOZWH7d4j2LZqGn9gN63UHmHH3PFmvHDPHin0QL9 /aHy5wwtRnMSD/x+j1MP+TOynNlH9g+oS0ytX/06AWGaVO6UGbdITAkG+k7DC5FhMn76 L5lc7YE+qIsPn8GGTDDBtvxrFgJsxCdIQgMMoW8Xnq4TDI0sVqbX3MxnnKPAx4ECS/L2 sbTHZ1RrSOzjh5FpMLBeW6UD7no4uShPNvT17YX+wmSgJvL1bd6/96/IiBEB3Z3La7Sf YU3Q== X-Gm-Message-State: APjAAAVttkxU5eaRzPcgoOOQBZ+unZupp+aEt9eDv6hnc3xEkTqC2q7P NGFvepwLFF2kXnoCizs12M329PqjYESxCz5LBpy1jA== X-Received: by 2002:aca:6056:: with SMTP id u83mr4713522oib.27.1565775217355; Wed, 14 Aug 2019 02:33:37 -0700 (PDT) MIME-Version: 1.0 References: <20190813141256.jnbrfld42rtigek3@pengutronix.de> <20190814070121.o53tj2mtky4hcy3n@pengutronix.de> <20190814073939.ubgzysmkmmel5h4y@pengutronix.de> <20190814084929.q3uy7cpf4ullpevo@pengutronix.de> In-Reply-To: <20190814084929.q3uy7cpf4ullpevo@pengutronix.de> From: Baolin Wang Date: Wed, 14 Aug 2019 17:33:25 +0800 Message-ID: Subject: Re: [PATCH v2 1/2] dt-bindings: pwm: sprd: Add Spreadtrum PWM documentation To: =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= Cc: Thierry Reding , Rob Herring , Mark Rutland , Orson Zhai , Chunyan Zhang , Vincent Guittot , linux-pwm@vger.kernel.org, DTML , LKML , kernel@pengutronix.de Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 14 Aug 2019 at 16:49, Uwe Kleine-K=C3=B6nig wrote: > > Hello, > > On Wed, Aug 14, 2019 at 03:52:08PM +0800, Baolin Wang wrote: > > On 14/08/2019, Uwe Kleine-K=C3=B6nig w= rote: > > > On Wed, Aug 14, 2019 at 03:25:53PM +0800, Baolin Wang wrote: > > >> On Wed, 14 Aug 2019 at 15:01, Uwe Kleine-K=C3=B6nig > > >> wrote: > > >> > On Wed, Aug 14, 2019 at 09:51:34AM +0800, Baolin Wang wrote: > > >> > > On Tue, 13 Aug 2019 at 22:13, Uwe Kleine-K=C3=B6nig > > >> > > wrote: > > >> > > > On Tue, Aug 13, 2019 at 09:46:40PM +0800, Baolin Wang wrote: > > >> > > > > +- assigned-clock-parents: The phandle of the parent clock o= f PWM > > >> > > > > clock. > > >> > > > > > >> > > > I'm not sure you need to point out assigned-clocks and > > >> > > > assigned-clock-parents as this is general clk stuff. Also I wo= nder if > > >> > > > these should be "required properties". > > >> > > > > >> > > I think I should describe any properties used by PWM node, like > > >> > > 'clocks' and 'clock-names' properties, though they are common cl= ock > > >> > > properties. > > >> > > > >> > Then you might want to describe also "status", "assigned-clock-rat= es", > > >> > "pinctrl-$n", "pinctrl-names", "power-domains", "power-domain-name= s" > > >> > and > > >> > probably another dozen I'm not aware of. > > >> > > >> We usually do not describe 'status', but if your device node used > > >> "pinctrl-$n", "pinctrl-names" ... common properties, yes, you should > > >> describe them to let users know what is the purpose of these > > >> properties. That's also asked by DT maintainer Rob. > > > > > > Does this convince you that you should also describe "pinctrl-$n" and > > > the others? If not, why not? We also usually don't describe > > > > Our PWM device node did not use "pinctrl-$n" things, why I should > > describe "pinctrl-$n"? > > The binding you implemented supports "pinctrl-$n". And this is described > somewhere in the generic pinctrl binding docs. The same applies to > "assigned-clock-parents". > > That you happen to use assigned-clock-parents but not pinctrl-$n on the > board you used to develop your driver is a detail that IMHO shouldn't > decide about being listed in the binding doc for your PWM type. > > > If some devices use pinctrl, yes, they should describe what is the > > purpose of pinctrl, see: > > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tre= e/Documentation/devicetree/bindings/mmc/sdhci-sprd.txt > > I agree that if the driver assumes special pinctrl names this is worth > mentioning. If however there is nothing special and just some generic > stuff is used that is described in some other location then I'd chose to > not add this redundant information to the binding document. So if I > reviewed the patch that created > Documentation/devicetree/bindings/mmc/sdhci-sprd.txt I would have > suggested to drop "assigned-clocks" and "assigned-clock-parents" there, > too. > > > > assigned-clock-parents. For me these are all in the same catagory: > > > > Lots of dt bindings describe 'assigned-clock-parents',: > > ./Documentation/devicetree/bindings/display/msm/dsi.txt > > ./Documentation/devicetree/bindings/display/msm/dsi.txt > > ./Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.txt > > ./Documentation/devicetree/bindings/rtc/st,stm32-rtc.txt > > ./Documentation/devicetree/bindings/rtc/st,stm32-rtc.txt > > ./Documentation/devicetree/bindings/rtc/st,stm32-rtc.txt > > ./Documentation/devicetree/bindings/pci/rockchip-pcie-host.txt > > ./Documentation/devicetree/bindings/sound/mt2701-afe-pcm.txt > > ./Documentation/devicetree/bindings/sound/brcm,cygnus-audio.txt > > ./Documentation/devicetree/bindings/sound/brcm,cygnus-audio.txt > > ...... > > I didn't check each of them, but I assume the same applies here, too. > Please don't copy blindly but think before using other people's stuff as I did not copy blindly. > reference. Even in the Linux kernel where reviews seem and are told to > catch non-optimal stuff, there are places where this doesn't work. IMHO > the key question is: Does it add value to describe "assigned-clocks" in > the binding for your PWM device given that you're only using this > generic and well documented construct? I just want to remind users that they should set the parent clock for PWMs, otherwise the PWM source clock can be not available. > > > > Common properties supported for each devicetree node that represents = a > > > device. The only difference is that on your board you make use of som= e > > > but not some others. > > > > Fine, let's decide this by PWM maintainer or DT maintainer Rob. > > Fine for me. > > > >> > > Yes, they are required. Thanks for your comments. > > >> > > > >> > required in which sense? Why can a Spreadtrum PWM not work when th= e > > >> > clock parents are unspecified? > > >> > > >> On some Spreadtrum platforms, the default source clock of PWM may no= t > > >> be enabled, so we should force users to select one available source > > >> clock for PWM output clock. > > > > > > Sounds like a bug in the clk tree of your SoC that shouldn't affect h= ow > > > the PWM is described in the device tree. After all a parent of a cloc= k > > > is supposed to become enabled when the clock gets enabled. > > > > That's not a bug, that's like a MUX, the default source clock of PWM > > can be disabled, since we usually do not use the default source clock. > > Then we can select a available source clock by the MUX. > > In my eyes there is a difference between a) The way the clocks are > implemented in the XZ SoC implies that to actually use the PWM you need > to reparent some clock; and b) Each "sprd,ums512-pwm" device really > needs an "assigned-clock" property, otherwise it cannot work. > > If you write "required" in the binding doc the semantic should be b) but > the motivation here seems to be a). Legal questions aside someone could > implement a PWM that has the same register layout and behaviour as the > PWM in your SoC but with a different clock tree. Should they use a > different compatible just because they don't need "assigned-clock"? Fair enough, I move them to be optional. --=20 Baolin Wang Best Regards