mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-09-16 23:28:04 -04: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:
1 parent
572d1d2416
commit
b4ea36f997
1 file changed
+6
-1
@@ -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