From: jcromie@divsol.com (Jim Cromie)
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] pc87360 voltage reference constants
Date: Fri, 12 Aug 2005 17:43:00 +0000 [thread overview]
Message-ID: <42FCC357.1000802@divsol.com> (raw)
hi Jean, etal,
Im looking to understand why my temps are so high,
esp in comparison to values from my soekris as obtained from
http://phk.freebsd.dk/soekris/env4801/
VREF = 1.214 V245 = 2.450
Temp 2 (status=0x81) 54 C
in your code,
data->in_vref = (i&0x02) ? 3025 : 2966;
dev_dbg(&new_client->dev, "Using %s reference voltage\n",
(i&0x02) ? "external" : "internal");
youve got 2 magical constants, where are they from ?
I cant find mention of them in the pdf, but theyre/its used to scale
the voltages read by show_in_input()
return sprintf(buf, "%u\n", IN_FROM_REG(data->in[attr->index],
data->in_vref));
#define IN_FROM_REG(val,ref) (((val) * (ref) + 128) / 256)
I think my temp answers lie elsewhere (perhaps a cast to s8 for the
register value),
but Im hoping your answer wrt the constants will clarify some stuff.
tia
jimc
BTW, (since Im writing), my patchset for pc87366 sensors-dev-attrs
(done against rc4-mm1), also applies (clean, iirc) to rc5-mm1, and works
there.
next reply other threads:[~2005-08-12 17:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-12 17:43 Jim Cromie [this message]
2005-08-12 19:50 ` [lm-sensors] pc87360 voltage reference constants Jean Delvare
2005-08-13 5:55 ` Jim Cromie
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=42FCC357.1000802@divsol.com \
--to=jcromie@divsol.com \
--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.