diff mbox

sensors-detect: Add Exar

Message ID 5a915597-c5d5-9e0e-b1f1-043e8ae48043@assembler.cz (mailing list archive)
State Not Applicable
Headers show

Commit Message

Rudolf Marek Dec. 29, 2016, 2:25 p.m. UTC
Hi,

I stumbled across a new SuperIOs from Exar. They do not contain any hw sensors,
but it could be useful to have them in sensors-detect

Funny is that those have configurable key sequence, which can clash with
existing devices. Perhaps this can be improved and check for vendor ID?

In the attached patch, I added just a default key sequence 0x67, 0x67

The datasheets can be found:

https://www.exar.com/products/interface/uarts/lpc-uarts
https://www.exar.com/product/interface/uarts/lpc-uarts/xr28v384
https://www.exar.com/product/interface/uarts/lpc-uarts/xr28v382

The patch is completely untested, please check the datasheet for relevant
information.

Thanks
Rudolf
diff mbox

Patch

diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect
index 057cd96..b47595e 100755
--- a/prog/detect/sensors-detect
+++ b/prog/detect/sensors-detect
@@ -1582,7 +1582,7 @@  use vars qw(@i2c_adapter_names);
 #      * FEAT_FAN
 #      * FEAT_TEMP
 use vars qw(@superio_ids_natsemi @superio_ids_smsc @superio_ids_smsc_ns
-	    @superio_ids_winbond @superio_ids_ite @superio_ids);
+	    @superio_ids_winbond @superio_ids_exar @superio_ids_ite @superio_ids);
 
 use constant FEAT_IN	=> (1 << 0);
 use constant FEAT_FAN	=> (1 << 1);
@@ -2022,6 +2022,18 @@  use constant FEAT_SMBUS	=> (1 << 7);
 	}
 );
 
+@superio_ids_exar = (
+	{
+		name => "Exar XR28V384",
+		driver => "not-a-sensor",
+		devid => 0x0384,
+	}, {
+		name => "Exar XR28V382",
+		driver => "not-a-sensor",
+		devid => 0x0382,
+	}
+);
+
 @superio_ids_winbond = (
 	{
 		name => "VIA VT1211 Super IO Sensors",
@@ -2483,6 +2495,14 @@  use constant FEAT_SMBUS	=> (1 << 7);
 		ns_detect => \&smsc_ns_detect_superio,
 		ns_chips => \@superio_ids_smsc_ns,
 	}, {
+		family => "Exar",
+		enter =>
+		{
+			0x2e => [0x67, 0x67], #The non-default key can be 0x87 0x87, 0x77 0x77 or 0xa0, 0xa0
+			0x4e => [0x67, 0x67],
+		},
+		chips => \@superio_ids_exar,
+	}, {
 		family => "VIA/Winbond/Nuvoton/Fintek",
 		guess => 0x290,
 		enter =>
@@ -4081,7 +4101,7 @@  sub exit_superio
 {
 	my ($addrreg, $datareg) = @_;
 
-	# Some chips (SMSC, Winbond) want this
+	# Some chips (SMSC, Winbond, Exar) want this
 	outb($addrreg, 0xaa);
 
 	# Return to "Wait For Key" state (PNP-ISA spec)