IT87 voltage registers update (#1567)
* Update SuperIOHardware.cs The embedded switch on the model has no default and would break out of the manufacturer switch if the model wasn't Z790_Taichi. * Fix the voltage registers for IT87 * Based on linux Hwmon * Also go from 10 to 9 voltage readings, as no motherboard in LHM using IT87 has more than 9 voltage readings. * Update SuperIOHardware.cs * Update IT87XX.cs
This commit is contained in:
@@ -8,7 +8,6 @@ using System;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
|
||||
// ReSharper disable once InconsistentNaming
|
||||
|
||||
@@ -167,7 +166,7 @@ internal class IT87XX : ISuperIO
|
||||
break;
|
||||
|
||||
case Chip.IT87952E:
|
||||
Voltages = new float?[10];
|
||||
Voltages = new float?[9];
|
||||
Temperatures = new float?[3];
|
||||
Fans = new float?[3];
|
||||
Controls = new float?[3];
|
||||
@@ -194,7 +193,7 @@ internal class IT87XX : ISuperIO
|
||||
Fans = new float?[3];
|
||||
Controls = new float?[3];
|
||||
break;
|
||||
|
||||
|
||||
case Chip.IT8620E:
|
||||
Voltages = new float?[9];
|
||||
Temperatures = new float?[3];
|
||||
@@ -428,7 +427,7 @@ internal class IT87XX : ISuperIO
|
||||
|
||||
for (int i = 0; i < Voltages.Length; i++)
|
||||
{
|
||||
float value = _voltageGain * ReadByte((byte)(VOLTAGE_BASE_REG + i), out bool valid);
|
||||
float value = _voltageGain * ReadByte(IT87_REG_VIN[i], out bool valid);
|
||||
|
||||
if (!valid)
|
||||
continue;
|
||||
@@ -602,7 +601,9 @@ internal class IT87XX : ISuperIO
|
||||
|
||||
private const byte TEMPERATURE_BASE_REG = 0x29;
|
||||
private const byte VENDOR_ID_REGISTER = 0x58;
|
||||
private const byte VOLTAGE_BASE_REG = 0x20;
|
||||
|
||||
// https://github.com/torvalds/linux/blob/master/drivers/hwmon/it87.c
|
||||
private readonly byte[] IT87_REG_VIN = { 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x2f, 0x2c, 0x2d, 0x2e };
|
||||
|
||||
private readonly byte[] FAN_PWM_CTRL_REG;
|
||||
private readonly byte[] FAN_PWM_CTRL_EXT_REG = { 0x63, 0x6b, 0x73, 0x7b, 0xa3, 0xab };
|
||||
|
||||
@@ -452,9 +452,9 @@ internal sealed class SuperIOHardware : Hardware
|
||||
c.Add(new Control("System Fan #1", 2));
|
||||
c.Add(new Control("System Fan #2", 3));
|
||||
c.Add(new Control("System Fan #3", 4));
|
||||
|
||||
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
v.Add(new Voltage("+12V", 0));
|
||||
v.Add(new Voltage("+5V", 1));
|
||||
@@ -3391,7 +3391,7 @@ internal sealed class SuperIOHardware : Hardware
|
||||
f.Add(new Fan("Chassis Fan #1", 3)); // CHA_FAN1/WP
|
||||
f.Add(new Fan("Chassis Fan #2", 4)); // CHA_FAN2/WP
|
||||
f.Add(new Fan("Chassis Fan #3", 6)); // CHA_FAN3/WP
|
||||
|
||||
|
||||
c.Add(new Control("CPU Fan #1", 1)); // CPU_FAN1
|
||||
c.Add(new Control("CPU Fan #2", 0)); // CPU_FAN2/WP
|
||||
c.Add(new Control("Chassis Fan #1", 3)); // CHA_FAN1/WP
|
||||
@@ -4258,7 +4258,7 @@ internal sealed class SuperIOHardware : Hardware
|
||||
v.Add(new Voltage("CMOS Battery", 8, 34, 34));
|
||||
v.Add(new Voltage("CPU Termination", 9));
|
||||
v.Add(new Voltage("CPU VDDIO / MC", 10, 1, 1));
|
||||
|
||||
|
||||
t.Add(new Temperature("CPU", 22));
|
||||
t.Add(new Temperature("Motherboard", 2));
|
||||
t.Add(new Temperature("CPU Package", 3));
|
||||
@@ -4573,7 +4573,7 @@ internal sealed class SuperIOHardware : Hardware
|
||||
v.Add(new Voltage("+5V", 1, 4, 1));
|
||||
v.Add(new Voltage("AVCC", 2, 34, 34));
|
||||
v.Add(new Voltage("+3.3V", 3, 34, 34));
|
||||
v.Add(new Voltage("+12V", 4, 11, 1));
|
||||
v.Add(new Voltage("+12V", 4, 11, 1));
|
||||
//v.Add(new Voltage("Voltage #6", 5));
|
||||
v.Add(new Voltage("VIN4", 6, false));
|
||||
v.Add(new Voltage("+3V Standby", 7, 34, 34));
|
||||
|
||||
Reference in New Issue
Block a user