From: Guenter Roeck <linux@roeck-us.net>
To: Constantine Shulyupin <const@makelinux.com>,
Mark Rutland <mark.rutland@arm.com>
Cc: Rob Herring <robh+dt@kernel.org>, Pawel Moll <Pawel.Moll@arm.com>,
Ian Campbell <ijc+devicetree@hellion.org.uk>,
Kumar Gala <galak@codeaurora.org>,
OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
<devicetree@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3] Documentation: add Device tree bindings for hwmon/nct7802
Date: Tue, 08 Sep 2015 07:35:23 -0700 [thread overview]
Message-ID: <55EEF22B.1060906@roeck-us.net> (raw)
In-Reply-To: <CAE7jHC8g5GGoNb8-sa0AhVm6eK8o33=wMqWO6m45Lr35kUxdgA@mail.gmail.com>
Constantine,
On 09/08/2015 06:49 AM, Constantine Shulyupin wrote:
>> Sure, but why do you need _raw_ register values?
>>
>> Why can you not encode this in the DT in a manner that describes what is
>> connected to this device, then have the kernel figure out any particular
>> values that need to be poked into registers?
>>
>> That'll be easier to read, and it's far more likely people will get
>> things correct in a dts.
>>
>> Mark.
>
> Theoretically it is possible to use function store_temp_type
> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/drivers/hwmon/nct7802.c#n87
> to set sensors types.
> With ABI codes:
> 3 - thermal diode
> 4 - thermistor
>
> But:
> - Sensor type could be also voltage and is mapped to in_input
> attributes. Generic code would be over complicated.
> - For low level programmers and PCB engineers is much more comfortable
> and error safe
> to works with datasheets, registers and bits than with fancy "human
> readable" configuration.
> - Mapping between raw bits and ABI is not intuitive. More simple and
> directed configuration is preferable.
>
Mark is asking why you don't have a 'sensor-type' property (or similar).
This is not an ABI issue, since the sensor type is determined by the PCB,
not by user space configuration. The only reason to have the attribute
writable in the ABI is to be able to support hardware where for some
reason the hardware parameters configured by the BIOS or ROMMON
are wrong, not as primary means to set the sensor type. Actually,
in an automated system where the temperature is used for automatic
fan control, waiting for user space to configure the chip might be fatal.
As for your other arguments, pretty much all other devicetree properties
use logical values instead of raw register values. It appears that the
low level programmers and PCB engineers responsible for writing devicetree
files must be able to handle that level of abstraction. And I really
would content that it is easier to write
sensor-type = "thermistor";
than forcing people to look up the datasheet when writing devicetree
files.
Thanks,
Guenter
prev parent reply other threads:[~2015-09-08 14:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-07 22:27 [PATCH v3] Documentation: add Device tree bindings for hwmon/nct7802 Constantine Shulyupin
[not found] ` <1441664902-32360-1-git-send-email-const-GkuDRZ1haSFDPfheJLI6IQ@public.gmane.org>
2015-09-08 9:38 ` Mark Rutland
2015-09-08 12:07 ` Constantine Shulyupin
[not found] ` <CAE7jHC8tdQCj-qcToBd+y017WZwMMeODGmm4uinMX=nL4yrSKw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-09-08 12:47 ` Mark Rutland
2015-09-08 13:49 ` Constantine Shulyupin
2015-09-08 14:35 ` Guenter Roeck [this message]
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=55EEF22B.1060906@roeck-us.net \
--to=linux@roeck-us.net \
--cc=Pawel.Moll@arm.com \
--cc=const@makelinux.com \
--cc=devicetree@vger.kernel.org \
--cc=galak@codeaurora.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=robh+dt@kernel.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).