public inbox for linux-hwmon@vger.kernel.org
 help / color / mirror / Atom feed
* How to add nano precision measurement to hwmon
@ 2017-02-17 16:07 Lucas Tanure
  2017-02-19  2:10 ` Guenter Roeck
  0 siblings, 1 reply; 5+ messages in thread
From: Lucas Tanure @ 2017-02-17 16:07 UTC (permalink / raw)
  To: linux-hwmon; +Cc: patches

Hi,

We have here in our company an internal hardware platform for our linux 
development that can measure current in a few circuits with nanoamps 
precision.
The measured values are exposed by a 32bit register that must read as a 
32bit float.

If we follow the hwmon sysfs interface we loss precision converting to 
milliamps, where the final value exposed is zero.

Example :
Measure 291nA becomes 0mA under sysfs curr1_input

The best solution for me would be a file in sysfs that I could just 
expose the float from my register (like curr1_input_float), this 
solution has two benefits for me:

- I wouldn't need to convert my internal float to int
- This would give the best precision that I can have from my hardware

The value could be exposed as a 32bit hex string, like 0x349c3abc.

So, how should I proceed with this ?

Thanks

Lucas Tanure

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

end of thread, other threads:[~2017-02-20 15:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-17 16:07 How to add nano precision measurement to hwmon Lucas Tanure
2017-02-19  2:10 ` Guenter Roeck
2017-02-19  8:53   ` Lucas Tanure
2017-02-19 16:33     ` Guenter Roeck
2017-02-20 15:07       ` Charles Keepax

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox