summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Szuba <marecki@gentoo.org>2022-09-07 14:04:01 +0100
committerMarek Szuba <marecki@gentoo.org>2022-09-07 15:30:06 +0100
commitc578a4e87a66dd39ebaf96aea13b06f4ceaca8b9 (patch)
tree7a2ff2e6887106c9f461a6749e91e888e64f7d17 /sys-apps/lm-sensors/files
parentdev-java/objenesis: add 3.3 (diff)
downloadgentoo-c578a4e87a66dd39ebaf96aea13b06f4ceaca8b9.tar.gz
gentoo-c578a4e87a66dd39ebaf96aea13b06f4ceaca8b9.tar.bz2
gentoo-c578a4e87a66dd39ebaf96aea13b06f4ceaca8b9.zip
sys-apps/lm-sensors: recommend new module for Nuvoton W83677HG-I in sensors-detect
Backported patch from upstream Git master. Closes: https://bugs.gentoo.org/811327 Signed-off-by: Marek Szuba <marecki@gentoo.org>
Diffstat (limited to 'sys-apps/lm-sensors/files')
-rw-r--r--sys-apps/lm-sensors/files/lm-sensors-3.6.0-w83627ehf-nct6775.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/sys-apps/lm-sensors/files/lm-sensors-3.6.0-w83627ehf-nct6775.patch b/sys-apps/lm-sensors/files/lm-sensors-3.6.0-w83627ehf-nct6775.patch
new file mode 100644
index 000000000000..e4493c414a49
--- /dev/null
+++ b/sys-apps/lm-sensors/files/lm-sensors-3.6.0-w83627ehf-nct6775.patch
@@ -0,0 +1,46 @@
+From 23c53b457407ab3ed217f963fc0329d0ae4bdeac Mon Sep 17 00:00:00 2001
+From: Jean Delvare <jdelvare@suse.de>
+Date: Tue, 12 May 2020 16:22:06 +0200
+Subject: [PATCH] sensors-detect: Fix the driver for Nuvoton W83677HG-I
+
+Originally, support for the Nuvoton W83677HG-I and derivatives was
+first added to the w83627ehf driver, so that's the driver recommended
+by sensors-detect. Later, support for the same device was added to
+the nct6775 driver. In kernel v5.6, support was removed from the
+w83627ehf driver to get rid of the duplicate code.
+
+So sensors-detect should now point users of this device to the
+nct6775 driver. We can't do that for very old kernels though, as this
+driver did not exist back then. I chose v3.10 for the cut-over, as
+this is when support for the Nuvoton W83677HG-I was finalized in the
+nct6775 driver, at least according to git log.
+
+Signed-off-by: Jean Delvare <jdelvare@suse.de>
+---
+ prog/detect/sensors-detect | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect
+index 6fc441aa6..319b1b7b9 100755
+--- a/prog/detect/sensors-detect
++++ b/prog/detect/sensors-detect
+@@ -2273,7 +2273,7 @@ use constant FEAT_SMBUS => (1 << 7);
+ features => FEAT_IN | FEAT_FAN | FEAT_TEMP,
+ }, {
+ name => "Nuvoton W83677HG-I (NCT5572D/NCT6771F/NCT6772F/NCT6775F) Super IO Sensors",
+- driver => "w83627ehf",
++ driver => sub { kernel_version_at_least(3, 10, 0) ? "nct6775" : "w83627ehf" },
+ devid => 0xB470,
+ devid_mask => 0xFFF0,
+ logdev => 0x0b,
+@@ -4574,7 +4574,9 @@ sub scan_cpu
+ sub chip_special_cases
+ {
+ # Some chip to driver mappings depend on the environment
+- foreach my $chip (@chip_ids) {
++ foreach my $chip (@chip_ids, @superio_ids_natsemi, @superio_ids_smsc,
++ @superio_ids_smsc_ns, @superio_ids_winbond,
++ @superio_ids_ite) {
+ if (ref($chip->{driver}) eq 'CODE') {
+ $chip->{driver} = $chip->{driver}->();
+ }