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:
parent
572d1d2416
commit
b4ea36f997
1 changed files with 6 additions and 1 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue