Slave (special) type in SysFS
authorFlorian Pose <fp@igh-essen.com>
Tue, 11 Apr 2006 12:51:20 +0000
changeset 185 af570302dcee
parent 184 2fc86cec12df
child 186 644a053fe103
Slave (special) type in SysFS
master/slave.c
--- a/master/slave.c	Tue Apr 11 10:17:30 2006 +0000
+++ b/master/slave.c	Tue Apr 11 12:51:20 2006 +0000
@@ -33,6 +33,7 @@
 EC_SYSFS_READ_ATTR(vendor_name);
 EC_SYSFS_READ_ATTR(product_name);
 EC_SYSFS_READ_ATTR(product_desc);
+EC_SYSFS_READ_ATTR(type);
 
 static struct attribute *def_attrs[] = {
     &attr_ring_position,
@@ -40,6 +41,7 @@
     &attr_vendor_name,
     &attr_product_name,
     &attr_product_desc,
+    &attr_type,
     NULL,
 };
 
@@ -1224,6 +1226,14 @@
         if (slave->type)
             return sprintf(buffer, "%s\n", slave->type->description);
     }
+    else if (attr == &attr_type) {
+        if (slave->type) {
+            if (slave->type->special == EC_TYPE_BUS_COUPLER)
+                return sprintf(buffer, "coupler\n");
+            else
+                return sprintf(buffer, "normal\n");
+        }
+    }
 
     return 0;
 }