Re-add Super IO ID mask

This commit is contained in:
Adam Honse 2019-05-27 14:58:51 -05:00
parent dde0292719
commit 25d85a1db0

View file

@ -45,14 +45,15 @@ std::vector<i2c_smbus_interface *> busses;
* *
\******************************************************************************************/
#define SIO_NCT5577_ID 0xC333 /* Device ID for NCT5577D */
#define SIO_NCT6102_ID 0x1061 /* Device ID for NCT6102D/6106D */
#define SIO_NCT6793_ID 0xd121 /* Device ID for NCT6793D */
#define SIO_NCT6796_ID 0xd421 /* Device ID for NCT6796D */
#define SIO_REG_LOGDEV 0x07 /* Logical Device Register */
#define SIO_REG_DEVID 0x20 /* Device ID Register */
#define SIO_REG_SMBA 0x62 /* SMBus Base Address Register */
#define SIO_LOGDEV_SMBUS 0x0B /* Logical Device for SMBus */
#define SIO_NCT5577_ID 0xC330 /* Device ID for NCT5577D (C333) */
#define SIO_NCT6102_ID 0x1060 /* Device ID for NCT6102D/6106D (1061) */
#define SIO_NCT6793_ID 0xd120 /* Device ID for NCT6793D (D121) */
#define SIO_NCT6796_ID 0xd420 /* Device ID for NCT6796D (D421) */
#define SIO_REG_LOGDEV 0x07 /* Logical Device Register */
#define SIO_REG_DEVID 0x20 /* Device ID Register */
#define SIO_REG_SMBA 0x62 /* SMBus Base Address Register */
#define SIO_LOGDEV_SMBUS 0x0B /* Logical Device for SMBus */
#define SIO_ID_MASK 0xFFF8 /* Device ID mask */
/******************************************************************************************\
@ -117,7 +118,7 @@ void DetectNuvotonI2CBusses()
int val = (superio_inb(sioaddr, SIO_REG_DEVID) << 8) | superio_inb(sioaddr, SIO_REG_DEVID + 1);
switch (val)
switch (val & SIO_ID_MASK)
{
case SIO_NCT5577_ID:
case SIO_NCT6102_ID:
@ -133,7 +134,7 @@ void DetectNuvotonI2CBusses()
((i2c_smbus_nuvoton_nct6793d*)bus)->nuvoton_nct6793d_smba = smba;
// Set device name string
switch (val)
switch (val & SIO_ID_MASK)
{
case SIO_NCT5577_ID:
sprintf(bus->device_name, "Nuvoton NCT5577D SMBus at %X", smba);