public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org, sensors@stimpy.netroedge.com
Subject: Re: [PATCH] I2C update for 2.6.5
Date: Wed, 14 Apr 2004 15:24:09 -0700	[thread overview]
Message-ID: <10819814492866@kroah.com> (raw)
In-Reply-To: <10819814492936@kroah.com>

ChangeSet 1.1643.36.4, 2004/03/25 10:51:45-08:00, khali@linux-fr.org

[PATCH] I2C: initialize fan_mins in w83781d, asb100 and lm78

Quoting myself:

> While testing, I found a corner case that isn't handled properly. It
> doesn't seem to be handled by the lm78 and the asb100 either. Setting
> fanN_div before ever reading from the chip or setting fanN_min will
> make use of fanN_min while it was never initialized.

The following patch addesses the issue. Tested to work on my AS99127F
rev.1 (which means that only the changes to the w83781d driver were
actually tested). Testers welcome.


 drivers/i2c/chips/asb100.c  |    5 +++++
 drivers/i2c/chips/lm78.c    |    6 ++++++
 drivers/i2c/chips/w83781d.c |    6 ++++++
 3 files changed, 17 insertions(+)


diff -Nru a/drivers/i2c/chips/asb100.c b/drivers/i2c/chips/asb100.c
--- a/drivers/i2c/chips/asb100.c	Wed Apr 14 15:14:44 2004
+++ b/drivers/i2c/chips/asb100.c	Wed Apr 14 15:14:44 2004
@@ -807,6 +807,11 @@
 	/* Initialize the chip */
 	asb100_init_client(new_client);
 
+	/* A few vars need to be filled upon startup */
+	data->fan_min[0] = asb100_read_value(new_client, ASB100_REG_FAN_MIN(0));
+	data->fan_min[1] = asb100_read_value(new_client, ASB100_REG_FAN_MIN(1));
+	data->fan_min[2] = asb100_read_value(new_client, ASB100_REG_FAN_MIN(2));
+
 	/* Register sysfs hooks */
 	device_create_file_in(new_client, 0);
 	device_create_file_in(new_client, 1);
diff -Nru a/drivers/i2c/chips/lm78.c b/drivers/i2c/chips/lm78.c
--- a/drivers/i2c/chips/lm78.c	Wed Apr 14 15:14:44 2004
+++ b/drivers/i2c/chips/lm78.c	Wed Apr 14 15:14:44 2004
@@ -625,6 +625,12 @@
 	/* Initialize the LM78 chip */
 	lm78_init_client(new_client);
 
+	/* A few vars need to be filled upon startup */
+	for (i = 0; i < 3; i++) {
+		data->fan_min[i] = lm78_read_value(new_client,
+					LM78_REG_FAN_MIN(i));
+	}
+
 	/* Register sysfs hooks */
 	device_create_file(&new_client->dev, &dev_attr_in0_input);
 	device_create_file(&new_client->dev, &dev_attr_in0_min);
diff -Nru a/drivers/i2c/chips/w83781d.c b/drivers/i2c/chips/w83781d.c
--- a/drivers/i2c/chips/w83781d.c	Wed Apr 14 15:14:44 2004
+++ b/drivers/i2c/chips/w83781d.c	Wed Apr 14 15:14:44 2004
@@ -1252,6 +1252,12 @@
 	/* Initialize the chip */
 	w83781d_init_client(new_client);
 
+	/* A few vars need to be filled upon startup */
+	for (i = 1; i <= 3; i++) {
+		data->fan_min[i - 1] = w83781d_read_value(new_client,
+					W83781D_REG_FAN_MIN(i));
+	}
+
 	/* Register sysfs hooks */
 	device_create_file_in(new_client, 0);
 	if (kind != w83783s && kind != w83697hf)


  reply	other threads:[~2004-04-14 22:37 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-14 22:22 [BK PATCH] I2C update for 2.6.5 Greg KH
2004-04-14 22:24 ` [PATCH] " Greg KH
2004-04-14 22:24   ` Greg KH
2004-04-14 22:24     ` Greg KH
2004-04-14 22:24       ` Greg KH [this message]
2004-04-14 22:24         ` Greg KH
2004-04-14 22:24           ` Greg KH
2004-04-14 22:24             ` Greg KH
2004-04-14 22:24               ` Greg KH
2004-04-14 22:24                 ` Greg KH
2004-04-14 22:24                   ` Greg KH
2004-04-14 22:24                     ` Greg KH
2004-04-14 22:24                       ` Greg KH
2004-04-14 22:24                         ` Greg KH
2004-04-14 22:24                           ` Greg KH
2004-04-14 22:24                             ` Greg KH
2004-04-14 22:24                               ` Greg KH
2004-04-14 22:24                                 ` Greg KH
2004-04-14 22:24                                   ` Greg KH
2004-04-14 22:24                                     ` Greg KH
2004-04-14 22:24                                       ` Greg KH
2004-04-14 22:24                                         ` Greg KH
2004-04-14 22:24                                           ` Greg KH
2004-04-14 22:24                                             ` Greg KH
2004-04-14 22:24                                               ` Greg KH
2004-04-14 22:24                                                 ` Greg KH
2004-04-14 22:24                                                   ` Greg KH
2004-04-14 22:24                                                     ` Greg KH
2004-04-14 22:24                                                       ` Greg KH
2004-04-14 22:24                                                         ` Greg KH
2004-04-14 22:24                                                           ` Greg KH

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=10819814492866@kroah.com \
    --to=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sensors@stimpy.netroedge.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox