All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <jdelvare@suse.de>
To: lm-sensors@vger.kernel.org
Subject: [PATCH v2] sensors-detect: Fix the driver for Nuvoton W83677HG-I
Date: Tue, 12 May 2020 14:22:06 +0000	[thread overview]
Message-ID: <20200512162206.49c514f4@endymion> (raw)

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>
---
Changes since v1:
 * Enable run-time driver decision for Super-I/O devices

 prog/detect/sensors-detect |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--- lm-sensors.orig/prog/detect/sensors-detect	2020-05-07 14:29:34.731733274 +0200
+++ lm-sensors/prog/detect/sensors-detect	2020-05-12 11:08:07.989885399 +0200
@@ -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}->();
 		}

-- 
Jean Delvare
SUSE L3 Support

             reply	other threads:[~2020-05-12 14:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-12 14:22 Jean Delvare [this message]
2020-05-13  9:00 ` [PATCH v2] sensors-detect: Fix the driver for Nuvoton W83677HG-I Ondřej Lysoněk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200512162206.49c514f4@endymion \
    --to=jdelvare@suse.de \
    --cc=lm-sensors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.