* [U-Boot-Users] [PATCH] DTT: Issue one-shot command on AD7414 (LM75 code) to read temp
@ 2008-05-16 9:06 Stefan Roese
2008-05-19 14:50 ` Detlev Zundel
2008-06-04 22:06 ` Wolfgang Denk
0 siblings, 2 replies; 4+ messages in thread
From: Stefan Roese @ 2008-05-16 9:06 UTC (permalink / raw)
To: u-boot
On AD7414 the first value upon bootup is not read correctly.
This is most likely because of the 800ms update time of the
temp register in normal update mode. To get current values
each time we issue the "dtt" command including upon powerup
we switch into one-short mode.
This patch fixes the problem on AD7414 equipped boards (Sequoia,
Canyonlands etc), that temp value printed in the bootup log was
incorrect.
Signed-off-by: Stefan Roese <sr@denx.de>
---
drivers/hwmon/lm75.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
index e29b294..c348517 100644
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
@@ -47,6 +47,19 @@ int dtt_read(int sensor, int reg)
int dlen;
uchar data[2];
+#ifdef CONFIG_DTT_AD7414
+ /*
+ * On AD7414 the first value upon bootup is not read correctly.
+ * This is most likely because of the 800ms update time of the
+ * temp register in normal update mode. To get current values
+ * each time we issue the "dtt" command including upon powerup
+ * we switch into one-short mode.
+ *
+ * Issue one-shot mode command
+ */
+ dtt_write(sensor, DTT_CONFIG, 0x64);
+#endif
+
/*
* Validate 'reg' param
*/
--
1.5.5.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot-Users] [PATCH] DTT: Issue one-shot command on AD7414 (LM75 code) to read temp
2008-05-16 9:06 [U-Boot-Users] [PATCH] DTT: Issue one-shot command on AD7414 (LM75 code) to read temp Stefan Roese
@ 2008-05-19 14:50 ` Detlev Zundel
2008-05-19 15:36 ` Stefan Roese
2008-06-04 22:06 ` Wolfgang Denk
1 sibling, 1 reply; 4+ messages in thread
From: Detlev Zundel @ 2008-05-19 14:50 UTC (permalink / raw)
To: u-boot
Hi Stefan,
> To get current values each time we issue the "dtt" command including
> upon powerup we switch into one-short mode.
If we are in "one-short" mode, shouldn't we add 1 before the printout?
Sorry, couldn't resist ;)
Cheers
Detlev
--
error compiling committee.c: too many arguments to function
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot-Users] [PATCH] DTT: Issue one-shot command on AD7414 (LM75 code) to read temp
2008-05-19 14:50 ` Detlev Zundel
@ 2008-05-19 15:36 ` Stefan Roese
0 siblings, 0 replies; 4+ messages in thread
From: Stefan Roese @ 2008-05-19 15:36 UTC (permalink / raw)
To: u-boot
On Monday 19 May 2008, Detlev Zundel wrote:
> > To get current values each time we issue the "dtt" command including
> > upon powerup we switch into one-short mode.
>
> If we are in "one-short" mode, shouldn't we add 1 before the printout?
I had to read your mail twice before noticing my error.
> Sorry, couldn't resist ;)
Nice one. ;)
Best regards,
Stefan
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot-Users] [PATCH] DTT: Issue one-shot command on AD7414 (LM75 code) to read temp
2008-05-16 9:06 [U-Boot-Users] [PATCH] DTT: Issue one-shot command on AD7414 (LM75 code) to read temp Stefan Roese
2008-05-19 14:50 ` Detlev Zundel
@ 2008-06-04 22:06 ` Wolfgang Denk
1 sibling, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2008-06-04 22:06 UTC (permalink / raw)
To: u-boot
In message <1210928766-31604-1-git-send-email-sr@denx.de> you wrote:
> On AD7414 the first value upon bootup is not read correctly.
> This is most likely because of the 800ms update time of the
> temp register in normal update mode. To get current values
> each time we issue the "dtt" command including upon powerup
> we switch into one-short mode.
>
> This patch fixes the problem on AD7414 equipped boards (Sequoia,
> Canyonlands etc), that temp value printed in the bootup log was
> incorrect.
>
> Signed-off-by: Stefan Roese <sr@denx.de>
> ---
> drivers/hwmon/lm75.c | 13 +++++++++++++
> 1 files changed, 13 insertions(+), 0 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Real computer scientists don't comment their code. The identifiers
are so long they can't afford the disk space.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-06-04 22:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-16 9:06 [U-Boot-Users] [PATCH] DTT: Issue one-shot command on AD7414 (LM75 code) to read temp Stefan Roese
2008-05-19 14:50 ` Detlev Zundel
2008-05-19 15:36 ` Stefan Roese
2008-06-04 22:06 ` Wolfgang Denk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox