All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Krzysztof Helt" <krzysztof.h1@wp.pl>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH] Add LM93 support
Date: Fri, 06 Jul 2007 07:59:52 +0000	[thread overview]
Message-ID: <468df6788d938@wp.pl> (raw)
In-Reply-To: <200704131723.42773.hjk@linutronix.de>

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\x1216



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

      parent reply	other threads:[~2007-07-06  7:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-13 15:23 [lm-sensors] [PATCH] Add LM93 support Hans-Jürgen Koch
2007-04-13 16:09 ` Hans-Jürgen Koch
2007-04-30  4:07 ` Mark M. Hoffman
2007-04-30  9:56 ` Hans-Jürgen Koch
2007-05-01  3:30 ` Mark M. Hoffman
2007-05-01 20:49 ` Hans-Jürgen Koch
2007-05-13  3:40 ` Mark M. Hoffman
2007-06-30 22:35 ` Hans-Jürgen Koch
2007-07-02 20:23 ` Hans-Jürgen Koch
2007-07-05 13:37 ` Mark M. Hoffman
2007-07-05 15:58 ` Hans-Jürgen Koch
2007-07-05 16:19 ` Mark M. Hoffman
2007-07-05 16:25 ` Hans-Jürgen Koch
2007-07-06  7:59 ` Krzysztof Helt [this message]

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=468df6788d938@wp.pl \
    --to=krzysztof.h1@wp.pl \
    --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.