sysfs is a Linux-only feature.
[monky] / src / linux.h
index b9ea657..4b1f098 100644 (file)
@@ -28,4 +28,16 @@ void update_gateway_info(void);
 enum { PB_BATT_STATUS, PB_BATT_PERCENT, PB_BATT_TIME };
 void get_powerbook_batt_info(char *, size_t, int);
 
+int open_sysfs_sensor(const char *dir, const char *dev, const char *type, int n,
+       int *divisor, char *devtype);
+
+#define open_i2c_sensor(dev, type, n, divisor, devtype) \
+       open_sysfs_sensor("/sys/bus/i2c/devices/", dev, type, n, divisor, devtype)
+#define open_platform_sensor(dev, type, n, divisor, devtype) \
+       open_sysfs_sensor("/sys/bus/platform/devices/", dev, type, n, divisor, devtype)
+#define open_hwmon_sensor(dev, type, n, divisor, devtype) \
+       open_sysfs_sensor("/sys/class/hwmon/", dev, type, n, divisor, devtype)
+
+double get_sysfs_info(int *fd, int arg, char *devtype, char *type);
+
 #endif /* _LINUX_H */