mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-01-06 14:17:53 -05:00
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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user