Received: by 10.223.176.5 with SMTP id f5csp1718132wra; Wed, 31 Jan 2018 10:27:10 -0800 (PST) X-Google-Smtp-Source: AH8x224LP4H5KiwTk7WSSHvSMXbWTo4Tr/Cd6sQxsNpJjoSjyUMDjx5rT2eFRPwhIS1+1gaRwns7 X-Received: by 10.101.81.13 with SMTP id f13mr14770201pgq.242.1517423230357; Wed, 31 Jan 2018 10:27:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517423230; cv=none; d=google.com; s=arc-20160816; b=og3nxGF/iP+A2hXvh5loffdpfNTInXYbsC+ftOLbW816IaRwZMn2pMaz7lBHkMk/NL m/NptBvvSfMIoN+yMB/rRiNnEpo/+HFC1QtaCgSw8fUBFZX+WixTy+T3oXivrkAHX2py 1kXMZ+kvYSZ7U9cvITWBpWOzjedfI8R6mXV0c4YZoLwasKKqW7Gu3bYuJczZleEABZfR eUGMqF1djBRifYakBuHz4EgxCM9GSB2OeyLbjFr1dERolXNBoKFMhYK+9WJncdB9U7a4 Glp3ILlTIWuofXyUGPv171am0JtAoZIJ+sDqpfVH6wcwwgufW5QWIHjNQv9xmeoQC4vU O3fg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=cS1Q0UZ2Bh9uN3N6ncAbN5H5xOMgFW9PHoHzAFbbWzc=; b=Y8IaJ3vDRnt/7dYM1YD8WQHbJceBqkpjVH2iOinAI5m55bi8QHqX44MbLpHZObbX0T JtkHTvX2nCW6qUt/44cx48731nJHXhI5zM157/cg9DJeM+m6QyClRL9tbUP8llIjo/Bi 7St6NL3I9C1ewc+K4TcXfh4DUj569rVRcqZS5ajbchvHiNKBV+T/ZjSNiryuICQq0caV ZLOe9j5E7S7wGntJVQ/mDcMIK0N0CUAOQUBFcJUmT/M5zVnQHMB/rr6/6P+2QpdAhPMQ jqz9cTm/PtJ3wEOeb4Jxu1jkR+VoES/BM1eovmdHb6NkLZKnBoAFf9CIsKdoUSLqFpnV g1lA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WX7wyVAj; 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=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e63-v6si5206057plb.305.2018.01.31.10.26.55; Wed, 31 Jan 2018 10:27:10 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WX7wyVAj; 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=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754049AbeAaSOm (ORCPT + 99 others); Wed, 31 Jan 2018 13:14:42 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:55437 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752543AbeAaSOi (ORCPT ); Wed, 31 Jan 2018 13:14:38 -0500 Received: by mail-wm0-f65.google.com with SMTP id 143so847170wma.5; Wed, 31 Jan 2018 10:14:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=cS1Q0UZ2Bh9uN3N6ncAbN5H5xOMgFW9PHoHzAFbbWzc=; b=WX7wyVAjMSZUa/lnKzdWuRafgQ/sWoQJkqytth2FDxEgKkWULUjfwRuJNJaWsg0oO3 CShfwtzI3hjHzGuI6MsdzZZwBgwBiMl2GFvR9LWgjWp3KD1wS2bz4IkNlI3fRltNAb8m GF23YlvcfVIoRnIlc26hCsU/l82BFL7BvGFZ2wmTO94+xdWSy+Tff5Aqmdfv1Ax4rfJY DvYLROzqEhfy3FePs2Lsn8n11PQOOrs3xqG4oC06VQQ+sb/bto+tlGjMm5zcsLm3RGSH 4r7vzLKlDQn90HKe77jP+KWn6DRkBVN/P5IUH252DA8JG7iH5yttj+m4Ui4JrXmPp6Zd AkVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=cS1Q0UZ2Bh9uN3N6ncAbN5H5xOMgFW9PHoHzAFbbWzc=; b=p0+4ICYUAhh8dx0B78thk3htFsoFzqrYDSqya7Y0YsGrG87BYN33wofDahqb0FPlqK QHWnhOiEVAd/+hx0PUN3kdiWhOW7j1KsSPpmY2lDLqV4pbWRNK0Fh1DrvmmwohuU0vpB sm5MyHFop12O8Aluh/UC/7ldunP2zB6YrGyBJVss3DA7+A3K9rddqcG0Tnbm4sJNE/rA HvWvNj8Y5KGL3UosabCyfti3ZailjfiXtAr93loRcIk6KxNDqB6WbMKYeX4X1O4gwxpk 013TfpE67swY4wuJ5xAtkjQvY4SrNmEGBYl/tu9xUKTOarIkITDQHXYqPG0i6MA6Wkue vmng== X-Gm-Message-State: AKwxytdF2PJttT0QJ5z1wYfPwbg49+2kt9hVE19jhtynhERJk9TJbyW2 xq8HClj3z9oJyjW3M0WzHxM= X-Received: by 10.28.227.70 with SMTP id a67mr24096343wmh.46.1517422477063; Wed, 31 Jan 2018 10:14:37 -0800 (PST) Received: from [192.168.2.62] (p578F04D2.dip0.t-ipconnect.de. [87.143.4.210]) by smtp.gmail.com with ESMTPSA id 44sm29159447wrv.0.2018.01.31.10.14.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Jan 2018 10:14:36 -0800 (PST) Subject: Re: [PATCH v2 01/16] dt-bindings: update the Allwinner GPADC device tree binding for H3 & A83T To: Quentin Schulz Cc: lee.jones@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, maxime.ripard@free-electrons.com, wens@csie.org, linux@armlinux.org.uk, jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, davem@davemloft.net, hans.verkuil@cisco.com, mchehab@kernel.org, rask@formelder.dk, clabbe.montjoie@gmail.com, sean@mess.org, krzk@kernel.org, icenowy@aosc.io, edu.molinas@gmail.com, singhalsimran0@gmail.com, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com References: <20180128232919.12639-1-embed3d@gmail.com> <20180128232919.12639-2-embed3d@gmail.com> <20180131174058.f7gog7yahcu67sqr@qschulz> From: Philipp Rossak Message-ID: <4188f487-6c9d-8f1e-25cc-308650ddb9ae@gmail.com> Date: Wed, 31 Jan 2018 19:14:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180131174058.f7gog7yahcu67sqr@qschulz> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 31.01.2018 18:40, Quentin Schulz wrote: > Hi Philipp, > > On Mon, Jan 29, 2018 at 12:29:04AM +0100, Philipp Rossak wrote: >> Allwinner H3 features a thermal sensor like the one in A33, but has its >> register re-arranged, the clock divider moved to CCU (originally the >> clock divider is in ADC) and added a pair of bus clock and reset. >> >> Allwinner A83T features a thermal sensor similar to the H3, the ths clock, >> the bus clock and the reset was removed from the CCU. The THS in A83T >> has a clock that is directly connected and runs with 24 MHz. >> >> Update the binding document to cover H3 and A83T. >> >> Signed-off-by: Philipp Rossak >> --- >> .../devicetree/bindings/mfd/sun4i-gpadc.txt | 50 ++++++++++++++++++++-- >> 1 file changed, 47 insertions(+), 3 deletions(-) >> >> diff --git a/Documentation/devicetree/bindings/mfd/sun4i-gpadc.txt b/Documentation/devicetree/bindings/mfd/sun4i-gpadc.txt >> index 86dd8191b04c..22df0c5c23d4 100644 >> --- a/Documentation/devicetree/bindings/mfd/sun4i-gpadc.txt >> +++ b/Documentation/devicetree/bindings/mfd/sun4i-gpadc.txt >> @@ -4,12 +4,35 @@ The Allwinner SoCs all have an ADC that can also act as a thermal sensor >> and sometimes as a touchscreen controller. >> >> Required properties: >> - - compatible: "allwinner,sun8i-a33-ths", >> + - compatible: must contain one of the following compatibles: >> + - "allwinner,sun8i-a33-ths" >> + - "allwinner,sun8i-h3-ths" >> + - "allwinner,sun8i-a83t-ths" >> - reg: mmio address range of the chip, >> - - #thermal-sensor-cells: shall be 0, >> + - #thermal-sensor-cells: shall be 0 or 1, > > Well, thermal-sensor-cells is either 0 or 1 :) > > Better to point to the documentation describing this > thermal-sensor-cells IMHO. > I agree, I will change this in the next version. >> - #io-channel-cells: shall be 0, >> >> -Example: >> +Required properties for the following compatibles: >> + - "allwinner,sun8i-h3-ths" >> + - "allwinner,sun8i-a83t-ths" >> + - interrupts: the sampling interrupt of the ADC, >> + >> +Required properties for the following compatibles: >> + - "allwinner,sun8i-h3-ths" >> + - clocks: the bus clock and the input clock of the ADC, >> + - clock-names: should be "bus" and "mod", >> + - resets: the bus reset of the ADC, >> + >> +Optional properties for the following compatibles: >> + - "allwinner,sun8i-h3-ths" >> + - nvmem-cells: A phandle to the calibration data provided by a nvmem device. >> + If unspecified default values shall be used. The size should >> + be 0x2 * sensorcount. > > "twice the number of sensors" ? > As already mentioned in an other answers, this here is not correct. I got somehow a wrong information or mixed something up. For H5, H3, A83T and A64 the thermal sensor calibration data is always 64 bit wide and placed on the eFuse address 0x34 [1]. >> + - nvmem-cell-names: Should be "calibration". >> + >> +Details see: bindings/nvmem/nvmem.txt >> + >> +Example for A33: >> ths: ths@1c25000 { >> compatible = "allwinner,sun8i-a33-ths"; >> reg = <0x01c25000 0x100>; >> @@ -17,6 +40,27 @@ Example: >> #io-channel-cells = <0>; >> }; >> >> +Example for H3: >> + ths: thermal-sensor@1c25000 { >> + compatible = "allwinner,sun8i-h3-ths"; >> + reg = <0x01c25000 0x400>; >> + clocks = <&ccu CLK_BUS_THS>, <&ccu CLK_THS>; >> + clock-names = "bus", "mod"; >> + resets = <&ccu RST_BUS_THS>; >> + interrupts = ; >> + #thermal-sensor-cells = <0>; >> + #io-channel-cells = <0>; >> + }; >> + >> +Example for A83T: >> + ths: thermal-sensor@1f04000 { >> + compatible = "allwinner,sun8i-a83t-ths"; >> + reg = <0x01f04000 0x100>; >> + interrupts = ; >> + #thermal-sensor-cells = <1>; >> + #io-channel-cells = <0>; >> + }; >> + > > Aside from Maxime's comment on how we would like to refactor GPADC/THS, > I'm not sure we really want an example for each an every thermal sensor > supported. > > Quentin > I agree we don't want to have an example for every sensor, but I think at least those two are interesting, since one has 3 sensors and no clocks, and one has 1 sensor and clocks. Thanks, Philipp [1]: http://linux-sunxi.org/SID_Register_Guide#eFUSE