Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1970002imm; Sat, 13 Oct 2018 07:30:17 -0700 (PDT) X-Google-Smtp-Source: ACcGV61FnCeqFTiAA1RnUc+9+D8bch4uARvXLyvFZODLLPZ9qkx/Z/8F0hxOdlsHcp5SLfd+LLwY X-Received: by 2002:a62:c957:: with SMTP id k84-v6mr10682142pfg.205.1539441017432; Sat, 13 Oct 2018 07:30:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539441017; cv=none; d=google.com; s=arc-20160816; b=OnzdxLaFnKFMv2UvysNIcI8UoZokZn92fQnyYs+/kDv3TLM8oW5V7sEKzFwpd5Bsd2 Y3tNHd0dmLIZJ4yqUvOj9/sxpTCVW5OMZRnY9zVSIFO4ScGM+0VQSoG67280KguEGSdy D9Y4ZALSut8hX43hZU9irQx2QH9mvwJZj3lyMnzZD/QRvBDN6stMP9vAMNHMsuCy6rVD 9+7gjvRSaYz5mASyZdt94ZV4SenL8R1EY/ncFQvvyqAwxgst647mbSr4Oi9T2MW4/184 mpS1shD4saPQA9XW7JXVK3y3mbwxO2N8qfY70zLCimmHVUIAE45sUuBPRWhqYqxn/jlP FObg== 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:from:cc:references:to :subject; bh=Mt/ewqs7mVLt3aOJMFNys7PmVA+0BdJD854E9zOXopo=; b=BtW3G7eoYri9nQJ+zFz0ci91bZUPsCuYD+0bG0E0st29kedTTrulrncXJlXD9lI4P0 SumAn9ZIegtOJd2j96mNYIIuqN9KCguF+km+wZ58cDB+bwBZ1jUt7y29l462dZV29thy e4U/IqZv5IcF2ZetYCLcfNM6vxGEXgLwJ3j7HiVRXHgh9A2HFtyM077ul8g+Bl7wrbx3 w8dOxxFefZuxGjafDN2IafYBx+2wzYytTMKaTjqFmRUjR8Z57a46w90OixOb7n1pJCtE 9uOhVZoP10YOEVmlqUpNlpDquwZLJ7QwMdYpf1gzTcwDtsdMCeEQw3NZz9DELeZxyZaJ WUwg== 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 k123-v6si4997039pfc.150.2018.10.13.07.29.49; Sat, 13 Oct 2018 07:30:17 -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; 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 S1726356AbeJMWGh (ORCPT + 99 others); Sat, 13 Oct 2018 18:06:37 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:41269 "EHLO relay1.mentorg.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726235AbeJMWGh (ORCPT ); Sat, 13 Oct 2018 18:06:37 -0400 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-MBX-04.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1gBKuB-0006w5-O1 from Vladimir_Zapolskiy@mentor.com ; Sat, 13 Oct 2018 07:28:35 -0700 Received: from [137.202.108.125] (137.202.0.90) by SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Sat, 13 Oct 2018 15:28:31 +0100 Subject: Re: [PATCH 1/7] dt-bindings: mfd: ds90ux9xx: add description of TI DS90Ux9xx ICs To: Laurent Pinchart References: <20181008211205.2900-1-vz@mleia.com> <20181008211205.2900-2-vz@mleia.com> <1884479.fINZhmP2Mi@avalon> CC: Vladimir Zapolskiy , Lee Jones , Linus Walleij , Rob Herring , Marek Vasut , Wolfram Sang , , , , , Sandeep Jain From: Vladimir Zapolskiy Message-ID: <55fe6c51-20e0-a10b-97fd-23c6f030acac@mentor.com> Date: Sat, 13 Oct 2018 17:28:30 +0300 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Icedove/45.2.0 MIME-Version: 1.0 In-Reply-To: <1884479.fINZhmP2Mi@avalon> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) To SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Laurent, thank you for review, please find my comments below. On 10/12/2018 02:44 PM, Laurent Pinchart wrote: > Hi Vladimir, > > Thank you for the patch. > > On Tuesday, 9 October 2018 00:11:59 EEST Vladimir Zapolskiy wrote: >> From: Sandeep Jain >> >> The change adds device tree binding description of TI DS90Ux9xx >> series of serializer and deserializer controllers which support video, >> audio and control data transmission over FPD-III Link connection. >> >> Signed-off-by: Sandeep Jain >> [vzapolskiy: various updates and corrections of secondary importance] >> Signed-off-by: Vladimir Zapolskiy >> --- >> .../devicetree/bindings/mfd/ti,ds90ux9xx.txt | 66 +++++++++++++++++++ >> 1 file changed, 66 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/mfd/ti,ds90ux9xx.txt >> >> diff --git a/Documentation/devicetree/bindings/mfd/ti,ds90ux9xx.txt >> b/Documentation/devicetree/bindings/mfd/ti,ds90ux9xx.txt new file mode >> 100644 >> index 000000000000..0733da88f7ef >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/mfd/ti,ds90ux9xx.txt >> @@ -0,0 +1,66 @@ >> +Texas Instruments DS90Ux9xx de-/serializer controllers >> + >> +Required properties: >> +- compatible: Must contain a generic "ti,ds90ux9xx" value and >> + may contain one more specific value from the list: > > If it "may" contain one more specific value, when should that value be > present, and when can it be absent ? Practically you can always omit a specific compatible, because (with a number of minor exceptions like DS90UH925Q case, see a quirk in the code) it is possible to read out the IC type in runtime. Nevertheless I prefer to have a complete list of all specific compatibles to avoid problems with maintenance in future, recently I had a long discussion with Jassi Brar about iMX* mailbox compatibles on the DT mailing list, the arguments remain the same, but I don't feel enough internal power to start another such an exhaustive discussion right at the moment. >> + "ti,ds90ub925q", >> + "ti,ds90uh925q", >> + "ti,ds90ub927q", >> + "ti,ds90uh927q", >> + "ti,ds90ub926q", >> + "ti,ds90uh926q", >> + "ti,ds90ub928q", >> + "ti,ds90uh928q", >> + "ti,ds90ub940q", >> + "ti,ds90uh940q". >> + >> +Optional properties: >> +- reg : Specifies the I2C slave address of a local de-/serializer. > > You should explain when the reg property is required and when it isn't. This Talking about TI DS90Ux9xx IC series, ideally I'd like to shift from serializer/deserializer concept and promote "remote" and "local" IC, by the way, and if I'm not mistaken, MOST ICs are truly identical on both ends. So, here "reg" property is need only if the IC (serializer or deserializer, it does not matter) is on the "local" side, i.e. it is a slave I2C device discovered on an I2C bus, which is under control by an application processor. If IC is on the "remote" side, in other words separated by the serial link from the "local" IC, then "reg" property is not needed. > will in my opinion require a more detailed explanation of the DT model for > this device. > >> +- power-gpios : GPIO line to control supplied power to the device. > > As Marek mentioned, a regulator would be better. I would make it a mandatory > property, as the device always needs to be powered. > I get a memory flashback. Did we discuss recently a right property name to control panel power by a GPIO or was it something else? There are quite many properties of exactly the same functionality: * powerdown-gpios * pd-gpios * pdn-gpios * power-gpios * powerdn-gpio * power-down-gpios * ... Probably device tree maintainers should unify the names, but my point is that your argument should be applicable to all such device tree nodes / property descriptions and usages. Do I understand you correctly? I would prefer to reference to a regulator while dealing with the power rails, and reference to a GPIO in case of power control only like in the case above. >> +- ti,backward-compatible-mode : Overrides backward compatibility mode. >> + Possible values are "<1>" or "<0>". >> + If "ti,backward-compatible-mode" is not mentioned, the backward >> + compatibility mode is not touched and given by hardware pin strapping. > > This doesn't seem to be a device description to me, it's a software > configuration. You should handle it in drivers. > No, it is a hardware description which allows to connect/discover ICs of different series, please reference to the datasheet for examples of its usage. >> +- ti,low-frequency-mode : Overrides low frequency mode. >> + Possible values are "<1>" or "<0>". >> + If "ti,low-frequency-mode" is not mentioned, the low frequency mode >> + is not touched and given by hardware pin strapping. > > This sounds the same. How about giving a real life example of a case where you > need to set these two properties to override the pin strapping, for the > purpose of discussing the DT bindings ? I have to ask, what do you mean by "a software configuration"? Both properties are IC controls (= hardware configuration in my language), and these hardware properties shall be set (if needed of course) on a "local" IC *before* a discovery of some "remote" IC, thus the property are in the DT. >> +- ti,video-map-select-msb: Sets video bridge pins to MSB mode, if it is set >> + MAPSEL pin value is ignored. >> +- ti,video-map-select-lsb: Sets video bridge pins to LSB mode, if it is set >> + MAPSEL pin value is ignored. > > I assume those two are mutually exclusive, this should be documented, or you > could merge the two properties into one. Same comment as above though, why do > you need an override in DT ? > The property are mutually exclusive, but it is a tristate property, please see my answer to a similar question from Marek. >> +- ti,pixel-clock-edge : Selects Pixel Clock Edge. >> + Possible values are "<1>" or "<0>". >> + If "ti,pixel-clock-edge" is High <1>, output data is strobed on the >> + Rising edge of the PCLK. If ti,pixel-clock-edge is Low <0>, data is >> + strobed on the Falling edge of the PCLK. >> + If "ti,pixel-clock-edge" is not mentioned, the pixel clock edge >> + value is not touched and given by hardware pin strapping. > > We have a standard property in Documentation/devicetree/bindings/media/video- > interfaces.txt for this, please use it. > Okay, thank you for the link. >> +- ti,spread-spectrum-clock-generation : Spread Sprectrum Clock Generation. >> + Possible values are from "<0>" to "<7>". The same value will be >> + written to SSC register. If "ti,spread-spectrum-clock-gen" is not >> + found, then SSCG will be disabled. > > This makes sense in DT in my opinion, as EMC is a system property. I wonder > however if exposing the hardware register directly is the best option. Could > you elaborate on how a system designer will select which value to use, in > order to find the best DT description ? > Hm, I suppose IC datasheets should serve as a better source of information. >> +TI DS90Ux9xx serializers and deserializer device nodes may contain a number >> +of children device nodes to describe and enable particular subcomponents >> +found on ICs. > > As mentioned in my review of the cover letter I don't think this is necessary. It is, in my humble opinion if an IC can be described as "a _pinmux_ + loads of other functions" it makes it an MFD. > You can make the serializer and deserializer I2C controllers without subnodes. > Same goes for GPIO control. > I have to define pinmuxes, one of the complicated and essential parts of IC configuration is unfairly excluded from the consideration. >> +Example: >> + >> +serializer: serializer@c { >> + compatible = "ti,ds90ub927q", "ti,ds90ux9xx"; >> + reg = <0xc>; >> + power-gpios = <&gpio5 12 GPIO_ACTIVE_HIGH>; >> + ti,backward-compatible-mode = <0>; >> + ti,low-frequency-mode = <0>; >> + ti,pixel-clock-edge = <0>; >> + ... >> +} >> + >> +deserializer: deserializer@3c { >> + compatible = "ti,ds90ub940q", "ti,ds90ux9xx"; >> + reg = <0x3c>; >> + power-gpios = <&gpio6 31 GPIO_ACTIVE_HIGH>; >> + ... >> +} >> + > > Extra blank line ? > Right, thank you for comments. -- Best wishes, Vladimir