Skip to content

Commit 09197be

Browse files
authored
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
1 parent 90e7c3e commit 09197be

2 files changed

Lines changed: 11 additions & 10 deletions

File tree

LibreHardwareMonitorLib/Hardware/Motherboard/Lpc/IT87XX.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
using System.Globalization;
99
using System.Linq;
1010
using System.Text;
11-
using System.Threading;
1211

1312
// ReSharper disable once InconsistentNaming
1413

@@ -167,7 +166,7 @@ Chip.IT8631E or
167166
break;
168167

169168
case Chip.IT87952E:
170-
Voltages = new float?[10];
169+
Voltages = new float?[9];
171170
Temperatures = new float?[3];
172171
Fans = new float?[3];
173172
Controls = new float?[3];
@@ -194,7 +193,7 @@ Chip.IT8631E or
194193
Fans = new float?[3];
195194
Controls = new float?[3];
196195
break;
197-
196+
198197
case Chip.IT8620E:
199198
Voltages = new float?[9];
200199
Temperatures = new float?[3];
@@ -428,7 +427,7 @@ public void Update()
428427

429428
for (int i = 0; i < Voltages.Length; i++)
430429
{
431-
float value = _voltageGain * ReadByte((byte)(VOLTAGE_BASE_REG + i), out bool valid);
430+
float value = _voltageGain * ReadByte(IT87_REG_VIN[i], out bool valid);
432431

433432
if (!valid)
434433
continue;
@@ -602,7 +601,9 @@ private void RestoreDefaultFanPwmControl(int index)
602601

603602
private const byte TEMPERATURE_BASE_REG = 0x29;
604603
private const byte VENDOR_ID_REGISTER = 0x58;
605-
private const byte VOLTAGE_BASE_REG = 0x20;
604+
605+
// https://github.com/torvalds/linux/blob/master/drivers/hwmon/it87.c
606+
private readonly byte[] IT87_REG_VIN = { 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x2f, 0x2c, 0x2d, 0x2e };
606607

607608
private readonly byte[] FAN_PWM_CTRL_REG;
608609
private readonly byte[] FAN_PWM_CTRL_EXT_REG = { 0x63, 0x6b, 0x73, 0x7b, 0xa3, 0xab };

LibreHardwareMonitorLib/Hardware/Motherboard/SuperIOHardware.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -452,9 +452,9 @@ private static void GetBoardSpecificConfiguration
452452
c.Add(new Control("System Fan #1", 2));
453453
c.Add(new Control("System Fan #2", 3));
454454
c.Add(new Control("System Fan #3", 4));
455-
455+
456456
break;
457-
457+
458458
default:
459459
v.Add(new Voltage("+12V", 0));
460460
v.Add(new Voltage("+5V", 1));
@@ -3391,7 +3391,7 @@ private static void GetNuvotonConfigurationD(ISuperIO superIO, Manufacturer manu
33913391
f.Add(new Fan("Chassis Fan #1", 3)); // CHA_FAN1/WP
33923392
f.Add(new Fan("Chassis Fan #2", 4)); // CHA_FAN2/WP
33933393
f.Add(new Fan("Chassis Fan #3", 6)); // CHA_FAN3/WP
3394-
3394+
33953395
c.Add(new Control("CPU Fan #1", 1)); // CPU_FAN1
33963396
c.Add(new Control("CPU Fan #2", 0)); // CPU_FAN2/WP
33973397
c.Add(new Control("Chassis Fan #1", 3)); // CHA_FAN1/WP
@@ -4258,7 +4258,7 @@ private static void GetNuvotonConfigurationD(ISuperIO superIO, Manufacturer manu
42584258
v.Add(new Voltage("CMOS Battery", 8, 34, 34));
42594259
v.Add(new Voltage("CPU Termination", 9));
42604260
v.Add(new Voltage("CPU VDDIO / MC", 10, 1, 1));
4261-
4261+
42624262
t.Add(new Temperature("CPU", 22));
42634263
t.Add(new Temperature("Motherboard", 2));
42644264
t.Add(new Temperature("CPU Package", 3));
@@ -4573,7 +4573,7 @@ private static void GetNuvotonConfigurationD(ISuperIO superIO, Manufacturer manu
45734573
v.Add(new Voltage("+5V", 1, 4, 1));
45744574
v.Add(new Voltage("AVCC", 2, 34, 34));
45754575
v.Add(new Voltage("+3.3V", 3, 34, 34));
4576-
v.Add(new Voltage("+12V", 4, 11, 1));
4576+
v.Add(new Voltage("+12V", 4, 11, 1));
45774577
//v.Add(new Voltage("Voltage #6", 5));
45784578
v.Add(new Voltage("VIN4", 6, false));
45794579
v.Add(new Voltage("+3V Standby", 7, 34, 34));

0 commit comments

Comments
 (0)