* [lm-sensors] [PATCH 0/3] hwmon: More LM63 enhancements
@ 2011-11-22 20:39 Guenter Roeck
2011-11-23 20:34 ` Jean Delvare
2011-11-23 20:51 ` Guenter Roeck
0 siblings, 2 replies; 3+ messages in thread
From: Guenter Roeck @ 2011-11-22 20:39 UTC (permalink / raw)
To: lm-sensors
Add support for unsigned temperatures on LM96163
Add support for writing remote T_CRIT limit
Add support for writing conversion rate register
Question:
Calculations are currently along the line of "/ 125 * 32", causing loss of accuracy.
Ok to change to "* 32 / 125" ?
v2 [unsigned temp patch]: Improved rounding for TEMP11U_TO_REG
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [lm-sensors] [PATCH 0/3] hwmon: More LM63 enhancements
2011-11-22 20:39 [lm-sensors] [PATCH 0/3] hwmon: More LM63 enhancements Guenter Roeck
@ 2011-11-23 20:34 ` Jean Delvare
2011-11-23 20:51 ` Guenter Roeck
1 sibling, 0 replies; 3+ messages in thread
From: Jean Delvare @ 2011-11-23 20:34 UTC (permalink / raw)
To: lm-sensors
Hi Guenter,
On Tue, 22 Nov 2011 12:39:57 -0800, Guenter Roeck wrote:
> Add support for unsigned temperatures on LM96163
> Add support for writing remote T_CRIT limit
> Add support for writing conversion rate register
>
> Question:
> Calculations are currently along the line of "/ 125 * 32", causing loss of accuracy.
> Ok to change to "* 32 / 125" ?
I think this is on purpose. Multiplying last guarantees that we don't
try to set bits which do not exist to 1. As long as proper rounding is
done before dividing, I don't quite see how we could be losing
accuracy. Do you have an actual example?
--
Jean Delvare
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [lm-sensors] [PATCH 0/3] hwmon: More LM63 enhancements
2011-11-22 20:39 [lm-sensors] [PATCH 0/3] hwmon: More LM63 enhancements Guenter Roeck
2011-11-23 20:34 ` Jean Delvare
@ 2011-11-23 20:51 ` Guenter Roeck
1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2011-11-23 20:51 UTC (permalink / raw)
To: lm-sensors
On Wed, Nov 23, 2011 at 03:34:29PM -0500, Jean Delvare wrote:
> Hi Guenter,
>
> On Tue, 22 Nov 2011 12:39:57 -0800, Guenter Roeck wrote:
> > Add support for unsigned temperatures on LM96163
> > Add support for writing remote T_CRIT limit
> > Add support for writing conversion rate register
> >
> > Question:
> > Calculations are currently along the line of "/ 125 * 32", causing loss of accuracy.
> > Ok to change to "* 32 / 125" ?
>
> I think this is on purpose. Multiplying last guarantees that we don't
> try to set bits which do not exist to 1. As long as proper rounding is
> done before dividing, I don't quite see how we could be losing
> accuracy. Do you have an actual example?
>
You are right. I didn't realize that "/ 125" reduces accuracy to 1/8 degree C, which is exactly
what the chips support, and that "* 32" simply shifts the value left by 5 bit to match the 11-bit
registers.
Sorry for the noise.
Guenter
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-11-23 20:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-22 20:39 [lm-sensors] [PATCH 0/3] hwmon: More LM63 enhancements Guenter Roeck
2011-11-23 20:34 ` Jean Delvare
2011-11-23 20:51 ` Guenter Roeck
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.