[PATCH] Add LM93 support

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

 



Dnia 5-07-2007 o godz. 17:58 Hans-J?rgen Koch napisa?(a):
> > See also: Documentation/hwmon/sysfs_interface.
> 
> Quote from there:
> 
> pwm[1-*]_enable
> 		Switch PWM on and off.
> 		Not always present even if pwmN is.
> 		0: turn off
> 		1: turn on in manual mode
> 		2+: turn on in automatic mode
> 

I know it is confusing because the 0 means PWM turn off (so
control is off, no fan is off - and no control sets usually fan
to always on). I felt into the same trap with my driver.


> OK, I changed the patch, see below. 
> 

A general issue. It seems that the chip uses two's complement
format for temperature values, but you have declared them as u8.
You may try redefine them as s8 and get rid of unneeded castings.

Also, checking for temperature may be more clear after division
(in register values) as values -128 to 127 is more clear (seems
8-bit limit) than -128000 to 127000.

You have never used values returned by lm93_write_[byte|word]
functions - you can make them return no value. Actually, you have
used lm93_write_word function only once - you may replace it with
the call i2c function directly.

I hope it helps improve your driver.

Regards,
Krzysztof
 

----------------------------------------------------
12 Play Festiwal Gwiazd z gwiazdorsk? obsad?! 5-8 lipca w Gda?sku!
Wi?cej: http://klik.wp.pl/?adr=http%3A%2F%2Fadv.reklama.wp.pl%2Fas%2Ffestival3.html&sid=1216






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

  Powered by Linux