All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ira W. Snyder" <iws@ovro.caltech.edu>
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] ina209 driver + using calulate lines in sensors3.conf
Date: Thu, 13 Aug 2009 17:43:08 +0000	[thread overview]
Message-ID: <20090813174308.GC28596@ovro.caltech.edu> (raw)

Hello all.

I'm working on a driver (posted here previously) for the INA209 chip.
The chip itself has support for power and current readings, though they
will only be valid if a special calibration register is set
appropriately. The units used for interpreting the power and current
registers change depending on the value in the calibration register;
they are not constant.

It is possible to calculate the power and current from userspace using
the sense resistor reading + the sense resistor value (which changes
between implementations).

I am aware of the "calculate" lines in sensors3.conf, which should be
able to do this kind of calculation.

My previous postings of this driver have mostly been ignored, probably
due to set the calibration register before use. This is something not
supported by the hwmon sysfs-interface. Using the userspace sensors
program to handle this instead removes the need to set the calibration
register.

I have two possible solutions:
1) Have curr1_input output the sense resistor voltage in mV and use the
   sensors program (using "calculate") to convert it appropriately
2) Have curr1_input always read back 0 uA, and have the sensors program
   use in0_input (the sense resistor voltage in mV) in the calculate
   line, ignoring the reading from curr1_input

I can figure out how to use calculate for #1, but I cannot figure out
how to reference a different sensor in a calculate line. The
documentation claims this is possible, but I cannot find any examples.

Which of these two solutions would be more acceptable?

Thanks,
Ira

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

                 reply	other threads:[~2009-08-13 17:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20090813174308.GC28596@ovro.caltech.edu \
    --to=iws@ovro.caltech.edu \
    --cc=lm-sensors@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.