summaryrefslogtreecommitdiff
path: root/lib/sysfs.c
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2009-10-18 12:05:16 +0000
committerJean Delvare <khali@linux-fr.org>2009-10-18 12:05:16 +0000
commit7c37bd44ac0e5c5d61731267e0133b27a9dd3b7d (patch)
tree17cab6936f7ead980916194d305ae8e3f5c696db /lib/sysfs.c
parentf5fc77eb58b7538a612e25b4dfa5027833db1b53 (diff)
downloadlm-sensors-git-7c37bd44ac0e5c5d61731267e0133b27a9dd3b7d.tar.gz
Add support for HID devices.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5786 7894878c-1315-0410-8ee3-d5d059ff63e0
Diffstat (limited to 'lib/sysfs.c')
-rw-r--r--lib/sysfs.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/sysfs.c b/lib/sysfs.c
index fec94981..44cf81e2 100644
--- a/lib/sysfs.c
+++ b/lib/sysfs.c
@@ -518,7 +518,7 @@ static int sensors_read_one_sysfs_chip(const char *dev_path,
const char *dev_name,
const char *hwmon_path)
{
- int domain, bus, slot, fn;
+ int domain, bus, slot, fn, vendor, product, id;
int err = -SENSORS_ERR_KERNEL;
char *bus_attr;
char bus_path[NAME_MAX];
@@ -612,6 +612,13 @@ static int sensors_read_one_sysfs_chip(const char *dev_path,
/* For now we assume that acpi devices are unique */
entry.chip.bus.nr = 0;
entry.chip.addr = 0;
+ } else
+ if (subsys && !strcmp(subsys, "hid") &&
+ sscanf(dev_name, "%x:%x:%x.%x", &bus, &vendor, &product, &id) == 4) {
+ entry.chip.bus.type = SENSORS_BUS_TYPE_HID;
+ /* As of kernel 2.6.32, the hid device names don't look good */
+ entry.chip.bus.nr = bus;
+ entry.chip.addr = id;
} else {
/* Ignore unknown device */
err = 0;