diff options
author | reinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2004-05-09 05:41:42 +0000 |
---|---|---|
committer | reinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2004-05-09 05:41:42 +0000 |
commit | 014935e97ddea2da5b9c7935b90a78c38b68da82 (patch) | |
tree | fade13e8788850dc422322b1c101bf9ba6d58fc8 /plugin_i2c_sensors.c | |
parent | 749b60b30b173296a0a7e041521645913aa05808 (diff) | |
download | lcd4linux-014935e97ddea2da5b9c7935b90a78c38b68da82.tar.gz |
[lcd4linux @ 2004-05-09 05:41:41 by reinelt]
i2c fix for kernel 2.6.5 (temp_input1 vs. temp1_input) from Xavier
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@420 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to 'plugin_i2c_sensors.c')
-rw-r--r-- | plugin_i2c_sensors.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/plugin_i2c_sensors.c b/plugin_i2c_sensors.c index 151ea96..70e03dc 100644 --- a/plugin_i2c_sensors.c +++ b/plugin_i2c_sensors.c @@ -1,4 +1,4 @@ -/* $Id: plugin_i2c_sensors.c,v 1.13 2004/03/03 03:47:04 reinelt Exp $ +/* $Id: plugin_i2c_sensors.c,v 1.14 2004/05/09 05:41:42 reinelt Exp $ * * I2C sensors plugin * @@ -23,6 +23,10 @@ * * * $Log: plugin_i2c_sensors.c,v $ + * Revision 1.14 2004/05/09 05:41:42 reinelt + * + * i2c fix for kernel 2.6.5 (temp_input1 vs. temp1_input) from Xavier + * * Revision 1.13 2004/03/03 03:47:04 reinelt * big patch from Martin Hejl: * - use qprintf() where appropriate @@ -173,9 +177,9 @@ static int parse_i2c_sensors_sysfs(char *key) // now the formating stuff, depending on the file : // Some values must be divided by 1000, the others // are parsed directly (we just remove the \n). - if (!strncmp(key, "temp_", 5) || - !strncmp(key, "curr_", 5) || - !strncmp(key, "in_", 3) || + if (!strncmp(key, "temp", 4) || + !strncmp(key, "curr", 4) || + !strncmp(key, "in", 2) || !strncmp(key, "vid", 3)) { value = strtod(buffer, NULL); // FIXME: any way to do this without converting to double ? @@ -332,7 +336,7 @@ void my_i2c_sensors_path(char *method) fd2 = opendir(dname); done = 0; while((file = readdir(fd2))) { - if (!strcmp(file->d_name, "temp_input1") || !strcmp(file->d_name, "temp1")) { // FIXME : do all sensors have a temp_input1 ? + if (!strcmp(file->d_name, "temp_input1") || !strcmp(file->d_name, "temp1_input") || !strcmp(file->d_name, "temp1")) { // FIXME : do all sensors have a temp_input1 ? path = realloc(path, strlen(dname)+1); strcpy(path, dname); done=1; |