All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] ACPI reads wrong temperature after loading
Date: Sat, 01 Nov 2008 16:14:22 +0000	[thread overview]
Message-ID: <20081101171422.4edea6f6@hyperion.delvare> (raw)
In-Reply-To: <20081101103904.7ea43d94@hyperion.delvare>

On Sat, 1 Nov 2008 16:28:40 +0100, Markus Rechberger wrote:
> On Sat, Nov 1, 2008 at 10:39 AM, Jean Delvare <khali@linux-fr.org> wrote:
> > It would help if I could see the source code of module em28xx_cx25843,
> > but unfortunately I have no idea where that driver lives. Markus?
> 
> http://mcentral.de/hg/~mrec/em28xx-new/file/ca209b1d4076/cx25843/em28xx-cx25843.c

This driver only attaches to (7-bit) address 0x44, while the lm90
driver probes for devices at 0x4c and 0x4d. So I have to admit I am
surprised that loading both drivers leads to the same result.

One note about the em28xx-cx25843 driver: it doesn't check for the
right i2c adapter functionality flags. The driver makes use of raw I2C
transactions to read from and write to the device, so it should check
for I2C_FUNC_I2C, but instead of that I see the following code:

   566 	/* Check if the adapter supports the needed features */
   567 	if (!i2c_check_functionality
   568 			(adapter,
   569 			 I2C_FUNC_SMBUS_READ_BYTE |
   570 			 I2C_FUNC_SMBUS_WRITE_BYTE_DATA))
   571 		return 0;

This is incorrect and should be fixed.

Another thing that should be fixed in this driver is the use of a
"template" i2c_client. This is inefficient in terms of performance,
disk space and memory so it should be avoided. Just setting fields
individually is much better.

-- 
Jean Delvare

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

  parent reply	other threads:[~2008-11-01 16:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-01  9:39 [lm-sensors] ACPI reads wrong temperature after loading Jean Delvare
2008-11-01 15:28 ` Markus Rechberger
2008-11-01 16:14 ` Jean Delvare [this message]
2008-11-01 17:11 ` Markus Rechberger
2008-11-01 17:33 ` Jean Delvare
2008-11-01 18:47 ` Peter Mahlknecht
2008-11-01 22:16 ` Peter Mahlknecht
2008-11-02  9:07 ` Jean Delvare
2008-11-02 11:25 ` Peter Mahlknecht
2008-11-05 17:33 ` Jean Delvare

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=20081101171422.4edea6f6@hyperion.delvare \
    --to=khali@linux-fr.org \
    --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.