LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] hwmon: (adt7475) document mapping of sysfs entries to inputs
@ 2018-10-30 20:25 Chris Packham
  2018-10-31  3:41 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Packham @ 2018-10-30 20:25 UTC (permalink / raw)
  To: linux
  Cc: jdelvare, corbet, linux-hwmon, linux-doc, linux-kernel, Chris Packham

As per the usual standard with hwmon drivers the mapping to sysfs
entries follows the register map of the device e.g. in0_input
corresponds to the register 0x20, in1_input corresponds to 0x21 etc.

Hardware designers tend to work with input pins instead of registers
which is where things start to get confusing. A hardware designer might
say "the 1.5V rail is connected to the VCCP pin" leaving the software
designer none the wiser as to which of the sysfs entries should be
associated with the label "1.5V".

Try to bridge the gap by documenting the mapping of sysfs entries to
the corresponding pins. This should allow someone to create a
configuration file or other mapping without needing to dive into the
code and ADT datasheets.

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---
After being given numerous hardware designs over the years using ADT chips for
hardware monitoring I found myself always having to read the schematic, ADT
datasheet and the adt7475.c driver.

I was about to document this mapping on an internal wiki page but I figured
it's probably of interest to the wider community. Hence this patch.

I've only documented the voltage mapping as the pwm and temperature and
tachometer pins appear to have reasonably sensible naming.

 Documentation/hwmon/adt7475 | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/Documentation/hwmon/adt7475 b/Documentation/hwmon/adt7475
index 09d73a10644c..01b46b290532 100644
--- a/Documentation/hwmon/adt7475
+++ b/Documentation/hwmon/adt7475
@@ -79,6 +79,18 @@ ADT7490:
   * 2 GPIO pins (not implemented)
   * system acoustics optimizations (not implemented)
 
+Sysfs Mapping
+-------------
+
+     ADT7490     ADT7476     ADT7475   ADT7473
+     -------     -------     -------   -------
+in0  2.5VIN (22) 2.5VIN (22) -         -
+in1  VCCP   (23) VCCP   (23) VCCP (14) VCCP (14)
+in2  VCC    (4)  VCC    (4)  VCC  (4)  VCC  (3)
+in3  5VIN   (20) 5VIN   (20)
+in4  12VIN  (21) 12VIN  (21)
+in5  VTT    (8)
+
 Special Features
 ----------------
 
-- 
2.19.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] hwmon: (adt7475) document mapping of sysfs entries to inputs
  2018-10-30 20:25 [PATCH] hwmon: (adt7475) document mapping of sysfs entries to inputs Chris Packham
@ 2018-10-31  3:41 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2018-10-31  3:41 UTC (permalink / raw)
  To: Chris Packham; +Cc: jdelvare, corbet, linux-hwmon, linux-doc, linux-kernel

On 10/30/18 1:25 PM, Chris Packham wrote:
> As per the usual standard with hwmon drivers the mapping to sysfs
> entries follows the register map of the device e.g. in0_input
> corresponds to the register 0x20, in1_input corresponds to 0x21 etc.
> 
> Hardware designers tend to work with input pins instead of registers
> which is where things start to get confusing. A hardware designer might
> say "the 1.5V rail is connected to the VCCP pin" leaving the software
> designer none the wiser as to which of the sysfs entries should be
> associated with the label "1.5V".
> 
> Try to bridge the gap by documenting the mapping of sysfs entries to
> the corresponding pins. This should allow someone to create a
> configuration file or other mapping without needing to dive into the
> code and ADT datasheets.
> 
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>

Applied to hwmon-next.

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-10-31  3:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-30 20:25 [PATCH] hwmon: (adt7475) document mapping of sysfs entries to inputs Chris Packham
2018-10-31  3:41 ` Guenter Roeck

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).