Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp7185271ybf; Fri, 6 Mar 2020 12:04:28 -0800 (PST) X-Google-Smtp-Source: ADFU+vuOgAK9qZno3UNvbcZbqyqbY12ZuVwoykKvKupI5e4Qwpbl0IFxqCKuC0Kh5rala+c5l9M1 X-Received: by 2002:a9d:5c81:: with SMTP id a1mr3274991oti.182.1583525068119; Fri, 06 Mar 2020 12:04:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583525068; cv=none; d=google.com; s=arc-20160816; b=HcE3CtN7y3hnOITa6AmjYM2zPFY7H9UE4zqAAMptYncsQkzQDqDyeED7GF2Vf7Bt7a aZVzeh+YABGWGvF3excZQ4GdePPVWEPf/A2/Akh8p70ax07bbYfrOi5/pMRuuDM4/7Eo GuOFXD6W6p1Ou4nm4aixlYmt3tdrxg+nyzrMUYujTezZYkY1kHwfsIuLCxCa9U6Sq60p g2rsc3O3sfl9Ex3RQ3ytKrdLDiK5OTlswbqfeond63jWay0Nt05f22cT6mPiXpb0EDMr gcV3MA+N61iRp28Tl0a2f24vkaKfH7Uy38hyO1k2wSlEf8DZBvDchMrMI8Ujy32YCHHC hoTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=SMzXlI4eXcBBSJs7KiKlj7d7z04WUy2SFwDFYe8Tcig=; b=HSI37iLWFRCIYOKxDhw71cinWyJl3chjhch/RAgi+80DWVYtUnvtaSGj+UFbj7JzJL 2FR+M1h2IjdyWlGM4D2cHhL8Da8nGLya5ng10DZ8MHGSOTsILMqVBzxl1dnw19hwUkfn XcUfrPtfd6SSUELMl9s9BbrYWpX31dAERbF0qBikQXOw8eL5QXEXkAAnSdAGUzaIXP5V N5a/PPcFXJ9zsdGD2hOChz1IKxewVJpQ7fKwzUpxPy2h1CHAuJJbWyhL0MGaEKLYWG32 duhm3GqqdDy3gRMG1wVddQtwTX404fNTr64qsSW6UCSPOB2EnigIe45HxvX4jDmVeQmX ZXlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gateworks-com.20150623.gappssmtp.com header.s=20150623 header.b=Z844DkNt; 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 q7si2053883otk.77.2020.03.06.12.04.14; Fri, 06 Mar 2020 12:04:28 -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=@gateworks-com.20150623.gappssmtp.com header.s=20150623 header.b=Z844DkNt; 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 S1726251AbgCFUCq (ORCPT + 99 others); Fri, 6 Mar 2020 15:02:46 -0500 Received: from mail-ot1-f65.google.com ([209.85.210.65]:43222 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725922AbgCFUCp (ORCPT ); Fri, 6 Mar 2020 15:02:45 -0500 Received: by mail-ot1-f65.google.com with SMTP id j5so3639940otn.10 for ; Fri, 06 Mar 2020 12:02:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gateworks-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SMzXlI4eXcBBSJs7KiKlj7d7z04WUy2SFwDFYe8Tcig=; b=Z844DkNt5lzVBUHwoyeaTPtXkCuayuNUT3Pk2kBNVVEUPQmdeLx2yvB8JgjGZrxh7V eoRSWTRqWCE+ILI9gcyqM6wLF4CfIrcOLygTxwvf9EsZ5+6y/u/AIjNuWIuP1ArgWyyw S3Fch8kxDK2me49l+VEILLCOejxa0+BxxKx4ssyZx7pLm1KDqynmaVnw6fGCizpQ0Zs4 Ji7WQSXwehpzC77QcNSDpkQx986fP2+JBVfDgK3/BF7kUyG0Lt3I2jhHI1YFMM+CUYlB c4F26ezTytt/t0c34XLt1rP3pL7l9hPCLWeW9CtyN5XdYwwUBl9kz9IMIb2m5ish3noy fY4g== 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; bh=SMzXlI4eXcBBSJs7KiKlj7d7z04WUy2SFwDFYe8Tcig=; b=qouuhodqmZes7XWPNoxoBaHcddFvaO8bR5OPP2XW9uvexXwz3WG0yWcMUhunq3qcSX YzICMLCIasQad7i8j7xpmtWDICTpz7QjrAZkyaBhdzpM5GURtUowXipw1414EEEbULJ1 4CiXx53a6kHB3nVQt39t5eYTVsjJ49Sm6Cz+gQRpt5syAB6ElYffpMtFA3uceezzPx5u TFZliucWB1CBt++oGtjcKwbvfp1d/MaTQQ7wh9bQMC4LBUSjMNLgwSNCmos8vRBJZ8qj XGBEXGXVrOLM/hszJHac6H3TfOZBNO1tUUeLcZEHrrido06BQUd/H4ZHeKCBFMccKLC/ 7cMQ== X-Gm-Message-State: ANhLgQ3U2tMLjt8ELn0sN8t4dtnDLUYBJEuVAn7rEc4Mm5CzJpQF0UVa vWCiox9ixlITkXahddBh2/JzG2TvjcqQR/G8emCFP5IaLFM= X-Received: by 2002:a05:6830:1503:: with SMTP id k3mr4088931otp.28.1583524962480; Fri, 06 Mar 2020 12:02:42 -0800 (PST) MIME-Version: 1.0 References: <1582577665-13554-1-git-send-email-tharvey@gateworks.com> <1582577665-13554-2-git-send-email-tharvey@gateworks.com> <20200302204949.GA6649@bogus> In-Reply-To: From: Tim Harvey Date: Fri, 6 Mar 2020 12:02:31 -0800 Message-ID: Subject: Re: [PATCH v5 1/3] dt-bindings: mfd: Add Gateworks System Controller bindings To: Rob Herring Cc: Lee Jones , Jean Delvare , Guenter Roeck , Linux HWMON List , Frank Rowand , devicetree@vger.kernel.org, open list , Robert Jones Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 6, 2020 at 9:50 AM Rob Herring wrote: > > > > > +properties: > > > > + $nodename: > > > > + pattern: "gsc@[0-9a-f]{1,2}" > > > > + compatible: > > > > + const: gw,gsc > > > > > > That's not very specific. > > > > > > > Do you mean something like 'gw,system-controller' would be better > > instead of the gsc abbreviation for 'Gateworks System Controller'? > > No, I mean is there or will there be only one version of this? > currently just 1 version is enough > > > > > > > > + > > > > + hwmon: > > > > > > 'hwmon' is a Linux thing. I'm suspicious... > > > > > > > Yes, we've discussed this before and I understand that DT shouldn't > > use terminology that is Linux specific (which is why I replaced > > 'hwmon' with 'adc' in the ADC nodes below) but I still see a long of > > dt bindings in Documentation/devicetree/bindings with the word 'hwmon' > > in them. > > > > Perhaps this makes more sense? > > Yes, that's more aligned with IIO ADC bindings. Yes, IIO is again a > Linuxism, but I think the ADC bindings are fairly independent other > than the directory name. > > > > > adc { > > compatible = "gw,gsc-adc"; > > #address-cells = <1>; > > #size-cells = <0>; > > > > channel@6 { > > type = "gw,hwmon-temperature"; > > reg = <0x06>; > > label = "temp"; > > }; > > ... > > }; > > ok, will use adc/channel instead of hwmon/adc and change compatible to 'gw,gsc-adc' > > > > > > + type: object > > > > + description: Optional Hardware Monitoring module > > > > + > > > > + properties: > > > > + compatible: > > > > + const: gw,gsc-hwmon > > > > + > > > > + "#address-cells": > > > > + const: 1 > > > > + > > > > + "#size-cells": > > > > + const: 0 > > > > + > > > > + gw,fan-base: > > > > + $ref: /schemas/types.yaml#/definitions/uint32 > > > > + description: The fan controller base address > > > > > > Shouldn't this be described as a node in the DT or be implied by the > > > compatible? > > > > It does look out of place there. Would adding another subnode outside > > of the (perhaps misnamed) 'hwmon' node make more sense?: > > > > fan: > > properties: > > compatible: gw,gsc-fancontroller > > reg: > > description: address of the fan controller base register > > maxItems: 1 > > Seems somewhat better location in that the first level is > sub-functions of this chip. > > But now you have 'adc' with no address and 'fan' (w/ reg should be > fan@...) with an address, so that's not consistent. > > Also, I think fan controllers and fans need to have separate nodes as > there are different types of fans such as with and without tach > signals. I've tried to steer other fan bindings that way. Depends how > complex the fan controller is whether that's necessary. > The fan controller does now support a tach signal reported via one of the ADC channels (which I've neglected to cover) so I can represent that as well in a new first level node such as: fan: type: object description: Optional FAN controller properties: compatible: const: gw,gsc-fan reg: description: The fan controller base address maxItems: 1 gw,fan-tach-ch: description: The fan tach ADC channel maxItems: 1 required: - compatible - reg fan { compatible = "gw,gsc-pwm-fan"; reg = <0x2c>; gw,fan-tach-ch = <0x16>; }; > > > > > > + type: object > > > > + description: | > > > > + Properties for a single ADC which can report cooked values > > > > + (ie temperature sensor based on thermister), raw values > > > > + (ie voltage rail with a pre-scaling resistor divider). > > > > + > > > > + properties: > > > > + reg: > > > > + description: Register of the ADC > > > > + maxItems: 1 > > > > + > > > > + label: > > > > + description: Name of the ADC input > > > > + > > > > + type: > > > > > > Very generic property name, but it's not generic. Needs a vendor prefix > > > at least. > > > > You mean the property name of 'type' is fine, but the values will need > > to be vendor specific like 'gw,temperature', 'gw,voltage', > > 'gw,voltage-raw' or is it inappropriate to use 'type'? > > Don't use 'type'. > > Is this for 'how to setup/program the adc' or 'what am I measuring'? > For example, configure the adc for temperature readings vs. measure > CPU temperature. Seems like a common thing needed for ADC. 'label' > already covers the latter case. This is for translation of the raw ADC to a cooked value. An earlier version of the GSC reported cooked values (doing the scaling in the GSC firmware) and later versions report raw values which need to be scaled depending on optional voltage divider so you can consider that 'setup'. Instead of handling this via a 'version' of the GSC I elected to describe the difference in ADC channel type as I already had on that reported millidegree celcius vs millivolts. I could just move them to properties such as: gw,temperature gw,voltage gw,voltage-raw Only one of the above is allowed and am not sure how to represent that in the yaml. Alternatively I could call this property name 'gw,conversion' and leave the three type enum? > > > > > + description: | > > > > + temperature in C*10 (temperature), > > > > + pre-scaled voltage value (voltage), > > > > + or scaled based on an optional resistor divider and optional > > > > + offset (voltage-raw) > > > > + enum: > > > > + - temperature > > > > + - voltage > > > > + - voltage-raw > > > > + > > > > + gw,voltage-divider: > > > > + allOf: > > > > + - $ref: /schemas/types.yaml#/definitions/uint32-array > > > > + description: values of resistors for divider on raw ADC input > > > > + items: > > > > + - description: R1 > > > > + - description: R2 > > > > > > Needs a standard unit suffix. With that, you can drop the type > > > reference. > > > > I understand the unit suffix but not sure what you mean by type > > reference. Do you mean: > > > > gw,voltage-divider-milli-ohms: > > description: values of resistors for divider on raw ADC input > > items: > > - description: R1 > > - description: R2 > > Yes, drop the '$ref'. > ok, Thanks, Tim