From 332c6fe2b98aa79f3db0d549b8115d7394d97371 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 31 May 2015 11:53:30 +0000 Subject: [PATCH] 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. --- CHANGES | 1 + prog/detect/sensors-detect | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index be22247a..f06a317d 100644 --- a/CHANGES +++ b/CHANGES @@ -37,6 +37,7 @@ SVN HEAD Document driver support for NCT7802Y Add detection of NCT7904D Add detection of IT8790E + Fix graphics cards detection (#2386, #2392) 3.3.5 "Happy Birthday Beddy" (2014-01-22) libsensors: Improve documentation of two functions diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index cd3e662e..ceab7624 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -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;