If read byte fails, use read byte data for detecting ENE controller

* The Nuvoton NCT6793D Super-IO SMBus controller does not actually support read byte or quick operations.  The driver used for Windows and in the OpenRGB kernel patch will perform a read byte data operation in its place with a dummy address, but the driver I'm submitting upstream is not going to have this hack.  All controllers that could be used on a Nuvoton SMBus will need a detection path that doesn't rely only on byte read or quick operations.
This commit is contained in:
Adam Honse 2022-10-02 21:01:14 -05:00
parent 572d1d2416
commit b4ea36f997

View file

@ -128,7 +128,12 @@ bool TestForENESMBusController(i2c_smbus_interface* bus, unsigned char address)
int res = bus->i2c_smbus_read_byte(address);
if (res >= 0)
if(res < 0)
{
res = bus->i2c_smbus_read_byte_data(address, 0x00);
}
if(res >= 0)
{
pass = true;