Hans de Goede | 1 Apr 2010 08:56
Picon
Favicon

Re: [RFC PATCH v3 0/2] Add sensors config tool

Hi Andre,

On 03/31/2010 10:03 PM, Andre Prendel wrote:
> Hi Hans,
>
> At last here is a new version of the sensors config tool.
>

First of all many thanks for your continued work on this, it
is looking very good, so hopefully we will be able to soon
ship an lm_sensors with working auto-configuration of
(known) motherboards.

> Now we have a shell script doing the auto installation stuff. See
> install.sh patch 2/2. Further I removed this part of the python
> script.
>

The shell script looks good, nice and simple, great!

> As discussed, the config files from lm-sensors.org are fetched to
> vendor specific directories and links are made in the root config
> directory.

Great!

>
> This looks like this:
>
> drwxr-xr-x 2 andre andre 4096 2010-03-31 21:01 Abit
(Continue reading)

Jean Delvare | 1 Apr 2010 17:02
Gravatar

[PATCH] hwmon: (sht15) Fix sht15_calc_temp interpolation function

From: Jerome Oufella <jerome.oufella <at> savoirfairelinux.com>

I discovered two issues.
First the previous sht15_calc_temp() loop did not iterate through the
temppoints array since the (data->supply_uV > temppoints[i - 1].vdd)
test is always true in this direction.

Also the two-points linear interpolation function was returning biased
values due to a stray division by 1000 which shouldn't be there.

[JD: Also change the default value for d1 from 0 to something saner.]

Signed-off-by: Jerome Oufella <jerome.oufella <at> savoirfairelinux.com>
Acked-by: Jonathan Cameron <jic23 <at> cam.ac.uk>
Signed-off-by: Jean Delvare <khali <at> linux-fr.org>
Cc: stable <at> kernel.org
---
 drivers/hwmon/sht15.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- linux-2.6.34-rc3.orig/drivers/hwmon/sht15.c	2010-04-01 16:24:33.000000000 +0200
+++ linux-2.6.34-rc3/drivers/hwmon/sht15.c	2010-04-01 16:49:45.000000000 +0200
 <at>  <at>  -302,13 +302,13  <at>  <at>  error_ret:
  **/
 static inline int sht15_calc_temp(struct sht15_data *data)
 {
-	int d1 = 0;
+	int d1 = temppoints[0].d1;
 	int i;

(Continue reading)

Jon & Lisa Williams | 1 Apr 2010 21:23
Picon
Favicon

lm-sensors with ASUS P6TD Deluxe and Ubuntu 9.04

Hi,

I make use of lm-sensors to monitor CPU core temps in Ubuntu 9.04 while running the Folding <at> Home project (it thrashes the CPU) – it’s been great with ASUS P5K and P5Q skt 775 motherboards!

However, I’ve moved to a skt 1366 motherboard, the ASUS P6TD Deluxe (like many other ‘Folders’), and I can’t get lm-sensors to work. I downloaded the latest lm-sensors version (Feb 2010) and tried that - someone on the official Folding Forum has said that even this doesn’t support the P6TD – is that right? If this is not right, how do you get it to work? If true, then is there a new version due out soon which will?

Folding as DocJonz



_______________________________________________
lm-sensors mailing list
lm-sensors <at> lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Luca Tettamanti | 1 Apr 2010 21:30
Picon

Re: lm-sensors with ASUS P6TD Deluxe and Ubuntu 9.04

On Thu, Apr 1, 2010 at 9:23 PM, Jon & Lisa Williams
<jon-lisa <at> doctors.org.uk> wrote:
> Hi,
>
> I make use of lm-sensors to monitor CPU core temps in Ubuntu 9.04 while
> running the Folding <at> Home project (it thrashes the CPU) – it’s been great
> with ASUS P5K and P5Q skt 775 motherboards!
>
> However, I’ve moved to a skt 1366 motherboard, the ASUS P6TD Deluxe (like
> many other ‘Folders’), and I can’t get lm-sensors to work.

I suspect that you're seeing this:
http://www.lm-sensors.org/wiki/FAQ/Chapter3#Mysensorshavestoppedworkinginkernel2.6.31

> someone on the
> official Folding Forum has said that even this doesn’t support the P6TD – is
> that right?

asus_atk0110 driver should be able to handle the monitoring (but it
does not support direct fan control); if it doesn't work please report
back so I can fix it :-)

Luca

_______________________________________________
lm-sensors mailing list
lm-sensors <at> lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Luca Tettamanti | 1 Apr 2010 22:34
Picon

Re: lm-sensors with ASUS P6TD Deluxe and Ubuntu 9.04

Please keep the list in CC.

On Thu, Apr 1, 2010 at 9:59 PM, Jon & Lisa Williams
<jon-lisa <at> doctors.org.uk> wrote:
> On Thu, Apr 1, 2010 at 9:23 PM, Jon & Lisa Williams
> <jon-lisa <at> doctors.org.uk> wrote:
>>> someone on the
>>> official Folding Forum has said that even this doesn’t support the P6TD – is
>>> that right?
>>
>> asus_atk0110 driver should be able to handle the monitoring (but it
>> does not support direct fan control); if it doesn't work please report
>> back so I can fix it :-)
>
> Is there a 'crib sheet' or 'how to' that describes the process required
> to fix things with the asus_atk0110 driver - the 'in-and-outs' of Linux
> are not my strong point - I'm more of a Linux n00b!!

If your kernel is recent enough (which version are you currently
using?) you can load the driver with "modprobe asus_atk0110"; the
module should be inserted automagically though, can you check whether
it's already there or not (lsmod)?
If "sensors" still reports nothing - even after loading the driver
manually - please include the output of "ls -l /sys/class/hwmon/",
dmesg and a copy of the DSDT (/sys/firmware/acpi/tables/DSDT).

Luca

_______________________________________________
lm-sensors mailing list
lm-sensors <at> lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Jean Delvare | 2 Apr 2010 10:13
Gravatar

Re: [PATCH] hwmon: (ltc4245) Read GPIO registers correctly

Hi Ira,

On Tue, 30 Mar 2010 15:57:04 -0700, Ira W. Snyder wrote:
> The GPIO registers on the ltc4245 behave in a strage way. Every time the
> ADC updates the values for one GPIO, it updates all three GPIO registers to
> the same value.

This is not how I read the datasheet. The datasheet says that only one
of the GPIO pins can be routed to the 13th input of the ADC and thus
used as an extra analog voltage input. It also says that there is ONE
register (U) holding the result of the conversion. Apparently many
registers can be access using more than one address, and register U can
be accessed using 4 different addresses (0x1c, 0x1d, 0x1e, 0x1f) but
this is still only one register. So the fact that all addresses return
the same value is not a surprise.

> To read all three GPIO registers correctly, we cache copies of each
> register and update the GPIO MUX to read the next GPIO register. Each GPIO
> sample will take 3 * HZ to read, but at least we are returning the correct
> values to userspace.

I think this is wrong. You should not expose 3 values to user-space,
you should only expose one. The two other GPIOs are supposed to be used
in digital mode. It's not even clear to me that you should always expose
it, as the application may be using all 3 GPIO pins in digital mode and
not be interested in sampling an analog voltage value from any of them.
I admit I am a little surprised that there is no way to disable ADC
operation on the GPIO pin.

> Signed-off-by: Ira W. Snyder <iws <at> ovro.caltech.edu>
> ---
> 
> When I implemented the ltc4245 driver, I did not have the ability to test
> the GPIO pins. I now have devices hooked up, and they don't work exactly as
> the datasheet describes (though it is vague in this section). See the patch
> description for more detail.

I think it does behave as the datasheet describes, I'm not sure what
you think is vague, it looks clear to me.

> I'd really like to see this picked up. I hunch I am the only user of the
> driver, or others would have complained. :) I wish the code wasn't as ugly
> as it is, but it is the best I can come up with.

I agree the driver is broken currently, but I don't agree with the
proposed fix. Please just drop the LTC4245_GPIOADC2 and
LTC4245_GPIOADC3 commands, which do not exist, and rename
LTC4245_GPIOADC1 to LTC4245_GPIOADC.

Thanks,
--

-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
lm-sensors <at> lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

Luca Tettamanti | 2 Apr 2010 11:15
Picon

Re: lm-sensors with ASUS P6TD Deluxe and Ubuntu 9.04

Again, please keep the list in CC.

On Thu, Apr 1, 2010 at 11:28 PM, Jon & Lisa Williams
<jon-lisa <at> doctors.org.uk> wrote:
>> If your kernel is recent enough (which version are you currently
>> using?) you can load the driver with "modprobe asus_atk0110"; the
>> module should be inserted automagically though, can you check whether
>> it's already there or not (lsmod)?
>
> The kernel is 2.6.28-18.
> How/where do I obtain the asus_atk0110 driver (lsmod does not show it present).

Ah, the kernel is too old. The driver was first included in 2.6.30.
I think that the easiest way to get a newer kernel is to upgrade to
Ubuntu 9.10; in alternative you can try a packaged mainline kernel:
http://kernel.ubuntu.com/~kernel-ppa/mainline/

but this might break other things (so be sure to keep the old working
kernel installed when trying a package from the PPA).

Luca

_______________________________________________
lm-sensors mailing list
lm-sensors <at> lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

Ira W. Snyder | 2 Apr 2010 18:12
Picon
Favicon

Re: [PATCH] hwmon: (ltc4245) Read GPIO registers correctly

On Fri, Apr 02, 2010 at 10:13:41AM +0200, Jean Delvare wrote:
> Hi Ira,
> 
> On Tue, 30 Mar 2010 15:57:04 -0700, Ira W. Snyder wrote:
> > The GPIO registers on the ltc4245 behave in a strage way. Every time the
> > ADC updates the values for one GPIO, it updates all three GPIO registers to
> > the same value.
> 
> This is not how I read the datasheet. The datasheet says that only one
> of the GPIO pins can be routed to the 13th input of the ADC and thus
> used as an extra analog voltage input. It also says that there is ONE
> register (U) holding the result of the conversion. Apparently many
> registers can be access using more than one address, and register U can
> be accessed using 4 different addresses (0x1c, 0x1d, 0x1e, 0x1f) but
> this is still only one register. So the fact that all addresses return
> the same value is not a surprise.
> 

Ok, re-reading tables 6 and 15 in the datasheet, this makes sense now.

> > To read all three GPIO registers correctly, we cache copies of each
> > register and update the GPIO MUX to read the next GPIO register. Each GPIO
> > sample will take 3 * HZ to read, but at least we are returning the correct
> > values to userspace.
> 
> I think this is wrong. You should not expose 3 values to user-space,
> you should only expose one. The two other GPIOs are supposed to be used
> in digital mode. It's not even clear to me that you should always expose
> it, as the application may be using all 3 GPIO pins in digital mode and
> not be interested in sampling an analog voltage value from any of them.
> I admit I am a little surprised that there is no way to disable ADC
> operation on the GPIO pin.
> 

If I do this, how do I make userspace work?

On my board, I have three different devices hooked up to the three GPIO
pins. They're all analog voltages. From userspace, I currently read
in{9,10,11}_input and report those in volts. It works fine, and was
pretty easy to implement.

If I only report a single GPIO value to userspace, then I can only read
one device. How do I switch which GPIO pin is routed to the ADC? I could
open the /dev/i2c-0 device and poke the LTC4245_CONTROL register
directly, but that seems very anti-hwmon, doesn't it?

> > Signed-off-by: Ira W. Snyder <iws <at> ovro.caltech.edu>
> > ---
> > 
> > When I implemented the ltc4245 driver, I did not have the ability to test
> > the GPIO pins. I now have devices hooked up, and they don't work exactly as
> > the datasheet describes (though it is vague in this section). See the patch
> > description for more detail.
> 
> I think it does behave as the datasheet describes, I'm not sure what
> you think is vague, it looks clear to me.
> 
> > I'd really like to see this picked up. I hunch I am the only user of the
> > driver, or others would have complained. :) I wish the code wasn't as ugly
> > as it is, but it is the best I can come up with.
> 
> I agree the driver is broken currently, but I don't agree with the
> proposed fix. Please just drop the LTC4245_GPIOADC2 and
> LTC4245_GPIOADC3 commands, which do not exist, and rename
> LTC4245_GPIOADC1 to LTC4245_GPIOADC.
> 

Ok, so I should use LTC4245_GPIOADC (0x1c) to read all of the GPIO
values. That seems fine to me, I can implement that.

See above about how to report this to userspace. I don't know how you
want this exposed in sysfs.

Ira

_______________________________________________
lm-sensors mailing list
lm-sensors <at> lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

Jean Delvare | 2 Apr 2010 18:24
Gravatar

Re: [PATCH] hwmon: (ltc4245) Read GPIO registers correctly

On Fri, 2 Apr 2010 09:12:59 -0700, Ira W. Snyder wrote:
> On Fri, Apr 02, 2010 at 10:13:41AM +0200, Jean Delvare wrote:
> > Hi Ira,
> > 
> > On Tue, 30 Mar 2010 15:57:04 -0700, Ira W. Snyder wrote:
> > > The GPIO registers on the ltc4245 behave in a strage way. Every time the
> > > ADC updates the values for one GPIO, it updates all three GPIO registers to
> > > the same value.
> > 
> > This is not how I read the datasheet. The datasheet says that only one
> > of the GPIO pins can be routed to the 13th input of the ADC and thus
> > used as an extra analog voltage input. It also says that there is ONE
> > register (U) holding the result of the conversion. Apparently many
> > registers can be access using more than one address, and register U can
> > be accessed using 4 different addresses (0x1c, 0x1d, 0x1e, 0x1f) but
> > this is still only one register. So the fact that all addresses return
> > the same value is not a surprise.
> > 
> 
> Ok, re-reading tables 6 and 15 in the datasheet, this makes sense now.
> 
> > > To read all three GPIO registers correctly, we cache copies of each
> > > register and update the GPIO MUX to read the next GPIO register. Each GPIO
> > > sample will take 3 * HZ to read, but at least we are returning the correct
> > > values to userspace.
> > 
> > I think this is wrong. You should not expose 3 values to user-space,
> > you should only expose one. The two other GPIOs are supposed to be used
> > in digital mode. It's not even clear to me that you should always expose
> > it, as the application may be using all 3 GPIO pins in digital mode and
> > not be interested in sampling an analog voltage value from any of them.
> > I admit I am a little surprised that there is no way to disable ADC
> > operation on the GPIO pin.
> > 
> 
> If I do this, how do I make userspace work?
> 
> On my board, I have three different devices hooked up to the three GPIO
> pins. They're all analog voltages. From userspace, I currently read
> in{9,10,11}_input and report those in volts. It works fine, and was
> pretty easy to implement.
> 
> If I only report a single GPIO value to userspace, then I can only read
> one device. How do I switch which GPIO pin is routed to the ADC? I could
> open the /dev/i2c-0 device and poke the LTC4245_CONTROL register
> directly, but that seems very anti-hwmon, doesn't it?

You wired your chip in a way it was not meant to be. You shouldn't have.

> 
> > > Signed-off-by: Ira W. Snyder <iws <at> ovro.caltech.edu>
> > > ---
> > > 
> > > When I implemented the ltc4245 driver, I did not have the ability to test
> > > the GPIO pins. I now have devices hooked up, and they don't work exactly as
> > > the datasheet describes (though it is vague in this section). See the patch
> > > description for more detail.
> > 
> > I think it does behave as the datasheet describes, I'm not sure what
> > you think is vague, it looks clear to me.
> > 
> > > I'd really like to see this picked up. I hunch I am the only user of the
> > > driver, or others would have complained. :) I wish the code wasn't as ugly
> > > as it is, but it is the best I can come up with.
> > 
> > I agree the driver is broken currently, but I don't agree with the
> > proposed fix. Please just drop the LTC4245_GPIOADC2 and
> > LTC4245_GPIOADC3 commands, which do not exist, and rename
> > LTC4245_GPIOADC1 to LTC4245_GPIOADC.
> > 
> 
> Ok, so I should use LTC4245_GPIOADC (0x1c) to read all of the GPIO
> values. That seems fine to me, I can implement that.
> 
> See above about how to report this to userspace. I don't know how you
> want this exposed in sysfs.

I don't want it exposed at all.

--

-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
lm-sensors <at> lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

Ira W. Snyder | 2 Apr 2010 18:45
Picon
Favicon

Re: [PATCH] hwmon: (ltc4245) Read GPIO registers correctly

On Fri, Apr 02, 2010 at 06:24:38PM +0200, Jean Delvare wrote:
> On Fri, 2 Apr 2010 09:12:59 -0700, Ira W. Snyder wrote:
> > On Fri, Apr 02, 2010 at 10:13:41AM +0200, Jean Delvare wrote:
> > > Hi Ira,
> > > 
> > > On Tue, 30 Mar 2010 15:57:04 -0700, Ira W. Snyder wrote:
> > > > The GPIO registers on the ltc4245 behave in a strage way. Every time the
> > > > ADC updates the values for one GPIO, it updates all three GPIO registers to
> > > > the same value.
> > > 
> > > This is not how I read the datasheet. The datasheet says that only one
> > > of the GPIO pins can be routed to the 13th input of the ADC and thus
> > > used as an extra analog voltage input. It also says that there is ONE
> > > register (U) holding the result of the conversion. Apparently many
> > > registers can be access using more than one address, and register U can
> > > be accessed using 4 different addresses (0x1c, 0x1d, 0x1e, 0x1f) but
> > > this is still only one register. So the fact that all addresses return
> > > the same value is not a surprise.
> > > 
> > 
> > Ok, re-reading tables 6 and 15 in the datasheet, this makes sense now.
> > 
> > > > To read all three GPIO registers correctly, we cache copies of each
> > > > register and update the GPIO MUX to read the next GPIO register. Each GPIO
> > > > sample will take 3 * HZ to read, but at least we are returning the correct
> > > > values to userspace.
> > > 
> > > I think this is wrong. You should not expose 3 values to user-space,
> > > you should only expose one. The two other GPIOs are supposed to be used
> > > in digital mode. It's not even clear to me that you should always expose
> > > it, as the application may be using all 3 GPIO pins in digital mode and
> > > not be interested in sampling an analog voltage value from any of them.
> > > I admit I am a little surprised that there is no way to disable ADC
> > > operation on the GPIO pin.
> > > 
> > 
> > If I do this, how do I make userspace work?
> > 
> > On my board, I have three different devices hooked up to the three GPIO
> > pins. They're all analog voltages. From userspace, I currently read
> > in{9,10,11}_input and report those in volts. It works fine, and was
> > pretty easy to implement.
> > 
> > If I only report a single GPIO value to userspace, then I can only read
> > one device. How do I switch which GPIO pin is routed to the ADC? I could
> > open the /dev/i2c-0 device and poke the LTC4245_CONTROL register
> > directly, but that seems very anti-hwmon, doesn't it?
> 
> You wired your chip in a way it was not meant to be. You shouldn't have.
> 

Why do you think it is wired incorrectly? Nothing I've found in the
datasheet suggests that. If you can provide some insight into why you
think this is, maybe we can come to an agreement, instead of just making
me very frustrated.

On Page 24, "General Purpose Input/Outputs", the text says that any of
the three GPIO pins can be connected to the ADC. Page 32, Table 13 "GPIO
Register G" supports this. Each of the three GPIO pins has exactly the
same configurable settings as all the others.

Page 13 "Configuration, GPIO, and Precharge" also states: The GPIO1 to
GPIO3 pins can be used as general purpose inputs or outputs. One of the
pins can also be multiplexed to the GPIO channel of the ADC.

The way I read this, it means: only one of the pins can be multiplexed
onto the ADC ***at a single moment in time***. Why else would the GPIO
register (0x6) exist, other than to let the user switch between them at
runtime? This kind of design sucks, but it is common in the embedded
world, where we are always trying to use fewer parts to do the same job.

Ira

> > 
> > > > Signed-off-by: Ira W. Snyder <iws <at> ovro.caltech.edu>
> > > > ---
> > > > 
> > > > When I implemented the ltc4245 driver, I did not have the ability to test
> > > > the GPIO pins. I now have devices hooked up, and they don't work exactly as
> > > > the datasheet describes (though it is vague in this section). See the patch
> > > > description for more detail.
> > > 
> > > I think it does behave as the datasheet describes, I'm not sure what
> > > you think is vague, it looks clear to me.
> > > 
> > > > I'd really like to see this picked up. I hunch I am the only user of the
> > > > driver, or others would have complained. :) I wish the code wasn't as ugly
> > > > as it is, but it is the best I can come up with.
> > > 
> > > I agree the driver is broken currently, but I don't agree with the
> > > proposed fix. Please just drop the LTC4245_GPIOADC2 and
> > > LTC4245_GPIOADC3 commands, which do not exist, and rename
> > > LTC4245_GPIOADC1 to LTC4245_GPIOADC.
> > > 
> > 
> > Ok, so I should use LTC4245_GPIOADC (0x1c) to read all of the GPIO
> > values. That seems fine to me, I can implement that.
> > 
> > See above about how to report this to userspace. I don't know how you
> > want this exposed in sysfs.
> 
> I don't want it exposed at all.
> 
> -- 
> Jean Delvare
> 

_______________________________________________
lm-sensors mailing list
lm-sensors <at> lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors


Gmane