devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tom Levens <tom.levens-vJEk5272eHo@public.gmane.org>
To: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Tom Levens <tom.levens-vJEk5272eHo@public.gmane.org>,
	linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org,
	jdelvare-IBi9RG/b67k@public.gmane.org,
	mark.rutland-5wv7dgnIgG8@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-hwmon-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v2 2/3] hwmon: ltc2990: add devicetree binding
Date: Fri, 18 Nov 2016 16:36:53 +0100	[thread overview]
Message-ID: <alpine.LRH.2.20.1611181604150.26466@pcbe13573-vm.dyndns.cern.ch> (raw)
In-Reply-To: <20161118145035.ir46ohk5uqaln6kp@rob-hp-laptop>

Hi Rob,

Thanks for taking the time to look at this patch.

On Fri, 18 Nov 2016, Rob Herring wrote:
> On Thu, Nov 17, 2016 at 01:10:15PM +0100, Tom Levens wrote:
>> Add a devicetree binding for the ltc2990 hwmon driver.
>>
>> Signed-off-by: Tom Levens <tom.levens-vJEk5272eHo@public.gmane.org>
>> ---
>>  .../devicetree/bindings/hwmon/ltc2990.txt          |   28 ++++++++++++++++++++
>>  1 files changed, 28 insertions(+), 0 deletions(-)
>>  create mode 100644 Documentation/devicetree/bindings/hwmon/ltc2990.txt
>>
>> diff --git a/Documentation/devicetree/bindings/hwmon/ltc2990.txt b/Documentation/devicetree/bindings/hwmon/ltc2990.txt
>> new file mode 100644
>> index 0000000..e4040e0
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/hwmon/ltc2990.txt
>> @@ -0,0 +1,28 @@
>> +ltc2990
>> +
>> +Required properties:
>> +- compatible: Must be "lltc,ltc2990"
>> +- reg: I2C slave address
>> +
>> +Optional properties:
>> +- lltc,mode:
>
> What determines the mode? If this is something a user will want to
> control, then it should be a sysfs attr rather than DT prop. If the
> board design dictates then DT is the right place.

It is based on the external connections of the chip. So, I would say that 
it is board specific.

> 'mode' is a bit vague, 'lltc,meas-mode' perhaps.

Sure thing.

There is also one question which came up in the thread for the patch 3 of 
this patchset. The full mode for this chip is actually made of two logical 
values which are written to the bits 4..3 and 2..0 of the register. This 
version of the patch only configures one of the values, but for the next 
version we would like to configure both. While combining them into a 
single integer value would be possible, they are defined as two values in 
the datasheet. Therefore, I propose using an array, such as:

lltc,meas-mode = <7 3>;

This would set the mode[2..0]=7 and mode[4..3]=3.

What do you think of this? Or should this be split into two properties? 
However, in this case I struggle come up with names for the properties. 
The datasheet, helpfully, calls both the fields "mode" and there is no 
clear difference in their function as both control which measurements are 
available.

Thanks,

>> +A	Sets the chip's measurement mode, defaults to <6> if unset.
>> +
>> +	The following measurements are available in each mode:
>> +
>> +	0: V1, V2, TR2
>> +	1: V1-V2, TR2
>> +	2: V1-V2, V3, V4
>> +	3: TR1, V3, V4
>> +	4: TR1, V3-V4
>> +	5: TR1, TR2
>> +	6: V1-V2, V3-V4
>> +	7: V1, V2, V3, V4
>> +
>> +Example:
>> +
>> +ltc2990@4c {
>> +	compatible = "lltc,ltc2990";
>> +	reg = <0x4c>;
>> +	lltc,mode = <7>;
>> +};
>> --
>> 1.7.1
>>
>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2016-11-18 15:36 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-17 12:10 [PATCH v2 1/3] hwmon: ltc2990: refactor value conversion Tom Levens
2016-11-17 12:10 ` [PATCH v2 2/3] hwmon: ltc2990: add devicetree binding Tom Levens
     [not found]   ` <1479384616-12479-2-git-send-email-tom.levens-vJEk5272eHo@public.gmane.org>
2016-11-18 14:50     ` Rob Herring
2016-11-18 15:36       ` Tom Levens [this message]
     [not found] ` <1479384616-12479-1-git-send-email-tom.levens-vJEk5272eHo@public.gmane.org>
2016-11-17 12:10   ` [PATCH v2 3/3] hwmon: ltc2990: support all measurement modes Tom Levens
     [not found]     ` <1479384616-12479-3-git-send-email-tom.levens-vJEk5272eHo@public.gmane.org>
2016-11-17 16:56       ` Guenter Roeck
2016-11-17 17:40         ` Mike Looijmans
2016-11-17 18:56           ` Guenter Roeck
2016-11-17 19:52             ` Mike Looijmans
2016-11-17 21:54               ` Guenter Roeck
2016-11-17 23:25                 ` Tom Levens
2016-11-17 23:40                   ` Guenter Roeck
     [not found]                     ` <20161117234024.GA26747-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2016-11-18 12:23                       ` Tom Levens
2016-11-18 14:16                         ` Guenter Roeck
     [not found]         ` <410de6c9-a13e-51f7-4d66-6f4e2537c574-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2017-06-28 14:24           ` Mike Looijmans
2017-06-28 15:01             ` Guenter Roeck
     [not found]               ` <20170628150130.GC30968-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2017-06-28 15:29                 ` Tom Levens
2017-06-28 16:00                   ` Guenter Roeck
     [not found]                     ` <20170628160048.GA8915-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2017-06-28 17:02                       ` Tom Levens
2017-06-28 17:33                         ` Mike Looijmans
     [not found]                           ` <abe96add-88fc-af6c-a5ed-330c7ae422b9-Oq418RWZeHk@public.gmane.org>
2017-06-28 17:55                             ` Guenter Roeck
2017-06-29  7:45                         ` Mike Looijmans
2017-06-29 11:46                           ` Tom Levens
2016-11-17 15:06 ` [PATCH v2 1/3] hwmon: ltc2990: refactor value conversion Guenter Roeck
2016-11-17 16:23   ` Tom Levens
2016-11-17 16:36     ` Guenter Roeck
2016-11-18  8:18       ` Tom Levens
2016-11-18 14:09         ` Guenter Roeck
2016-11-18 14:17           ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LRH.2.20.1611181604150.26466@pcbe13573-vm.dyndns.cern.ch \
    --to=tom.levens-vjek5272eho@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=jdelvare-IBi9RG/b67k@public.gmane.org \
    --cc=linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org \
    --cc=linux-hwmon-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).