* [PATCH] i2c convert via686a temp_* to milli degree celsius
@ 2003-06-25 7:25 Jan Dittmer
2003-07-03 19:17 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Jan Dittmer @ 2003-06-25 7:25 UTC (permalink / raw)
To: Greg KH; +Cc: Linux Kernel Mailing List
[-- 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;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] i2c convert via686a temp_* to milli degree celsius
2003-06-25 7:25 [PATCH] i2c convert via686a temp_* to milli degree celsius Jan Dittmer
@ 2003-07-03 19:17 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2003-07-03 19:17 UTC (permalink / raw)
To: Jan Dittmer; +Cc: Linux Kernel Mailing List
On Wed, Jun 25, 2003 at 09:25:11AM +0200, Jan Dittmer wrote:
> 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.
Sorry for the delay, I've now applied this and will send it on.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-07-03 19:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-25 7:25 [PATCH] i2c convert via686a temp_* to milli degree celsius Jan Dittmer
2003-07-03 19:17 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).