Hey there,

On my debian system with kernel 2.6.23, the i2c temperatures and fan
speeds aren't stored in /sys/bus/i2c/devices/, they're stored in
/sys/bus/platform/devices.  So, I wrote a patch for tempget.c (diff
below).  What it does is tries the i2c directory first, and then looks
at the platform one if it can't find any valid therms.  I'm sure others
must have the same problem, maybe this patch could get included in CVS
if it works?  I haven't tested it on a system that has the temperatures
stored in the i2c directory but I don't see much reason it shouldn't
work.  

The code could be written much more efficiently, but the problem on my
system is that I have an i2c directory with devices in it, but just not
the temperature ones, so the first test for the i2c bus, "if (therms)",
succeeds but the second one fails, "if ((name =
ecore_list_next(therms))".

Cheers,
Andrew "Rooster" Stack

diff -Naurb tempget.c.original tempget.c          
--- tempget.c.original  2008-06-01 23:14:39.000000000 -0400
+++ tempget.c   2008-06-05 20:32:08.000000000 -0400
@@ -161,6 +161,34 @@
                         }
                       ecore_list_destroy(therms);
                    }
+                       
+                 if (!sensor_path)
+                   {
+                      char *name;
+                          
+                          therms =
temperature_get_bus_files("platform");
+                      if ((name = ecore_list_next(therms)))
+                        {
+                           if (ecore_file_exists(name))
+                             {
+                                int len;
+                                
+                                snprintf(path, sizeof(path),
+                                         "%s",
ecore_file_file_get(name));
+                                len = strlen(path);
+                                if (len > 6) path[len - 6] = '\0';
+                                sensor_type = SENSOR_TYPE_LINUX_I2C;
+                                sensor_path = strdup(name);
+                                sensor_name = strdup(path);
+                                printf("sensor type = i2c\n"
+                                      "sensor path = %s\n"
+                                      "sensor name = %s\n",
+                                      sensor_path, sensor_name);
+                             }
+                        }
+                      ecore_list_destroy(therms);
+                   }
+                                               
                  if (!sensor_path)
                    {
                       // try the pci bus


      

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
enlightenment-users mailing list
enlightenment-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-users

Reply via email to