[PATCH] First cut of a adt7470 driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jul 14, 2007 at 04:23:16PM +0200, Vadim Zeitlin wrote:
>  The first thing I noticed is that accessing any of them takes almost 3
> seconds:
> 
> # time cat fan1_input
> 2001
> cat fan1_input  0.00s user 0.00s system 0% cpu 2.760 total

Hm.... I see this with the v3 patch:
root at elm3a181:/usr/local/src/lm_sensors-2.10.3/prog# time cat
/sys/class/hwmon/hwmon0/device/temp1_input 
47000

real    0m1.701s
user    0m0.000s
sys     0m0.000s

Not sure why it takes 700ms to read the sensors after the 1s sleep,
perhaps that could just be the cost of reading the registers?  (I'd hope
not...)

> I wonder if this is normal? I see a 1 sec sleep in adt7470_update_device()
> but the delay happens not only for the temperatures and it's also much
> bigger than 1 second.
> 
>  Next, the fan speed detection seems to work as expected, i.e. the number
> it gives (like 2000 above) seem to be RPM. But reading the temperature
> files produces strange results:
> 
> # grep . temp?_input
> temp1_input:0
> temp2_input:228000
> temp3_input:59000
> temp4_input:54000
> temp5_input:226000
> temp6_input:228000
> temp7_input:58000
> temp8_input:54000
> temp9_input:49000
> 
> Again, I see the factor of 1000 in adt7470.c and, accounting for it, all

Documentation/hwmon/sysfs-interface says that the units for temperatures
are millidegrees C, hence the 1000 factor both here and for the pwm
controls below.

> numbers except 227000 may be correct -- but what about those latter ones?
> To confuse the matters (or at least me) further, temp_min files contain
> 129000 while temp_max files have 127000 (no typo) so something seems wrong

Mine are programmed like that too.  I suppose it's possible that the
datasheet could be wrong?  Page 14 of the adt7470 datasheet says that
the default temp low limit is 0x81 and the default temp high limit is
0x7F.  Weird...unless I'm misinterpreting the data sheet?

> here... At the very least, the factor of 1000 seems to be unnecessary:
> 
> # grep . pwm1*
> pwm1:0
> pwm1_auto_channels_temp:1023
> pwm1_auto_point1_pwm:128
> pwm1_auto_point1_temp:90000
> pwm1_auto_point2_pwm:255
> pwm1_auto_point2_temp:110000
> pwm1_enable:2
> 
> The values here clearly should be 90 and 110 degrees, shouldn't they?

(See above)

--D
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20070716/1f9955e3/attachment.bin 


[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux