From: Jan Dittmer <j.dittmer@portrix.net>
To: Greg KH <greg@kroah.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] i2c convert via686a temp_* to milli degree celsius
Date: Wed, 25 Jun 2003 09:25:11 +0200 [thread overview]
Message-ID: <3EF94E57.9070802@portrix.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 181 bytes --]
Forgot to send this.
This converts the i2c chip driver via686a to handle milli degree celsius
instead of centi degree celsius. Applies for temp_input, temp_min, temp_max.
Jan
[-- Attachment #2: via686a_convert_temp.patch --]
[-- Type: text/plain, Size: 2153 bytes --]
diff -u linux-mm/drivers/i2c/chips/via686a.c 2.5.73-mm1/drivers/i2c/chips/via686a.c
--- linux-mm/drivers/i2c/chips/via686a.c 2003-05-31 14:15:03.000000000 +0200
+++ 2.5.73-mm1/drivers/i2c/chips/via686a.c 2003-06-24 17:18:09.000000000 +0200
@@ -494,27 +494,27 @@
struct i2c_client *client = to_i2c_client(dev);
struct via686a_data *data = i2c_get_clientdata(client);
via686a_update_client(client);
- return sprintf(buf, "%ld\n", TEMP_FROM_REG10(data->temp[nr])*10 );
+ return sprintf(buf, "%ld\n", TEMP_FROM_REG10(data->temp[nr])*100 );
}
/* more like overshoot temperature */
static ssize_t show_temp_max(struct device *dev, char *buf, int nr) {
struct i2c_client *client = to_i2c_client(dev);
struct via686a_data *data = i2c_get_clientdata(client);
via686a_update_client(client);
- return sprintf(buf, "%ld\n", TEMP_FROM_REG(data->temp_over[nr])*10);
+ return sprintf(buf, "%ld\n", TEMP_FROM_REG(data->temp_over[nr])*100);
}
/* more like hysteresis temperature */
static ssize_t show_temp_min(struct device *dev, char *buf, int nr) {
struct i2c_client *client = to_i2c_client(dev);
struct via686a_data *data = i2c_get_clientdata(client);
via686a_update_client(client);
- return sprintf(buf, "%ld\n", TEMP_FROM_REG(data->temp_hyst[nr])*10);
+ return sprintf(buf, "%ld\n", TEMP_FROM_REG(data->temp_hyst[nr])*100);
}
static ssize_t set_temp_max(struct device *dev, const char *buf,
size_t count, int nr) {
struct i2c_client *client = to_i2c_client(dev);
struct via686a_data *data = i2c_get_clientdata(client);
- int val = simple_strtol(buf, NULL, 10)/10;
+ int val = simple_strtol(buf, NULL, 10)/100;
data->temp_over[nr] = TEMP_TO_REG(val);
via686a_write_value(client, VIA686A_REG_TEMP_OVER(nr), data->temp_over[nr]);
return count;
@@ -523,7 +523,7 @@
size_t count, int nr) {
struct i2c_client *client = to_i2c_client(dev);
struct via686a_data *data = i2c_get_clientdata(client);
- int val = simple_strtol(buf, NULL, 10)/10;
+ int val = simple_strtol(buf, NULL, 10)/100;
data->temp_hyst[nr] = TEMP_TO_REG(val);
via686a_write_value(client, VIA686A_REG_TEMP_HYST(nr), data->temp_hyst[nr]);
return count;
next reply other threads:[~2003-06-25 7:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-25 7:25 Jan Dittmer [this message]
2003-07-03 19:17 ` [PATCH] i2c convert via686a temp_* to milli degree celsius 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=3EF94E57.9070802@portrix.net \
--to=j.dittmer@portrix.net \
--cc=greg@kroah.com \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox