Skip to contentSkip to conversation

sensors-detect: Detect graphics card in all cases

PATCH New Jean Delvare 1 participant 1 message May 28, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sensors-detect: Detect graphics card in all cases

On recent kernels, the i2c bus may not be an immediate child of the graphics device, instead there can be a drm class device in between. Treat all drm class devices as graphics devices so that probing the i2c bus is disabled by default as intended.

---
 prog/detect/sensors-detect |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
prog/detect/sensors-detect +3 -1
@@ -3897,7 +3897,9 @@ sub get_pci_class
 	my ($subsystem, $class);
 
 	$subsystem = sysfs_device_subsystem($device);
-	return 0 unless defined $subsystem && $subsystem eq "pci";
+	return 0 unless defined $subsystem;
+	return 0x0300 if $subsystem eq "drm";	# Graphics card
+	return 0 unless $subsystem eq "pci";
 
 	$class = sysfs_device_attribute($device, "class");
 	return 0 unless defined $class;
Signature · 7 lines
Jean Delvare
SUSE L3 Support

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors