From b5c0ec5d7446152ec07d47f7a833c396e91b3000 Mon Sep 17 00:00:00 2001 From: "Mark D. Studebaker" Date: Mon, 12 Jan 2004 05:21:17 +0000 Subject: [PATCH] fix /proc magnitudes; convert temp from Kelvin to C git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2215 7894878c-1315-0410-8ee3-d5d059ff63e0 --- CHANGES | 2 +- kernel/chips/smartbatt.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index 57d7979e..ab950666 100644 --- a/CHANGES +++ b/CHANGES @@ -30,7 +30,7 @@ ask CVS about it: remove initialization of temp_type and fan_ctl; remove init and temp_type module parameters Module lm90: Handle hysteresis differently - Module smartbatt: Fix detection + Module smartbatt: Fix detection, magnitudes, temp Module w83781d: Fix negative voltages Module w83l785ts: New Program eeprog: Make 8 bit mode the default diff --git a/kernel/chips/smartbatt.c b/kernel/chips/smartbatt.c index f272237d..0b415ffd 100644 --- a/kernel/chips/smartbatt.c +++ b/kernel/chips/smartbatt.c @@ -431,10 +431,10 @@ void smartbatt_temp(struct i2c_client *client, int operation, int ctl_name, { struct smartbatt_data *data = client->data; if (operation == SENSORS_PROC_REAL_INFO) - *nrels_mag = 0; + *nrels_mag = 1; else if (operation == SENSORS_PROC_REAL_READ) { smartbatt_update_client(client); - results[0] = data->temp; + results[0] = data->temp - 2731; /* convert from Kelvin */ *nrels_mag = 1; } } @@ -444,7 +444,7 @@ void smartbatt_i(struct i2c_client *client, int operation, int ctl_name, { struct smartbatt_data *data = client->data; if (operation == SENSORS_PROC_REAL_INFO) - *nrels_mag = 0; + *nrels_mag = 3; else if (operation == SENSORS_PROC_REAL_READ) { smartbatt_update_client(client); results[0] = data->chgi; @@ -459,7 +459,7 @@ void smartbatt_v(struct i2c_client *client, int operation, int ctl_name, { struct smartbatt_data *data = client->data; if (operation == SENSORS_PROC_REAL_INFO) - *nrels_mag = 0; + *nrels_mag = 3; else if (operation == SENSORS_PROC_REAL_READ) { smartbatt_update_client(client); results[0] = data->chgv;