From b0f7ea5c8f25ddea65f3224bfa2acce67474a10a Mon Sep 17 00:00:00 2001 From: Adam Honse Date: Thu, 26 Nov 2020 15:55:32 -0600 Subject: [PATCH] Special detection for 0x48 address in Gigabyte RGB Fusion GPU controller --- .../GigabyteRGBFusionGPUControllerDetect.cpp | 76 ++++++++++++++----- 1 file changed, 56 insertions(+), 20 deletions(-) diff --git a/Controllers/GigabyteRGBFusionGPUController/GigabyteRGBFusionGPUControllerDetect.cpp b/Controllers/GigabyteRGBFusionGPUController/GigabyteRGBFusionGPUControllerDetect.cpp index 08cf5a556..514cdcdb5 100644 --- a/Controllers/GigabyteRGBFusionGPUController/GigabyteRGBFusionGPUControllerDetect.cpp +++ b/Controllers/GigabyteRGBFusionGPUController/GigabyteRGBFusionGPUControllerDetect.cpp @@ -42,33 +42,69 @@ bool TestForGigabyteRGBFusionGPUController(i2c_smbus_interface* bus, unsigned ch bool pass = false; int res; - //Write out 0xAB 0x00 0x00 0x00 sequence - res = bus->i2c_smbus_write_byte(address, 0xAB); - - if (res >= 0) + switch(address) { - bus->i2c_smbus_write_byte(address, 0x00); - bus->i2c_smbus_write_byte(address, 0x00); - bus->i2c_smbus_write_byte(address, 0x00); + case 0x47: + //Write out 0xAB 0x00 0x00 0x00 sequence + res = bus->i2c_smbus_write_byte(address, 0xAB); - pass = true; + if (res >= 0) + { + bus->i2c_smbus_write_byte(address, 0x00); + bus->i2c_smbus_write_byte(address, 0x00); + bus->i2c_smbus_write_byte(address, 0x00); - res = bus->i2c_smbus_read_byte(address); + pass = true; - if (res != 0xAB) - { - pass = false; - } + res = bus->i2c_smbus_read_byte(address); - res = bus->i2c_smbus_read_byte(address); + if (res != 0xAB) + { + pass = false; + } - if(res != 0x14) - { - pass = false; - } + res = bus->i2c_smbus_read_byte(address); - bus->i2c_smbus_read_byte(address); - bus->i2c_smbus_read_byte(address); + if(res != 0x14) + { + pass = false; + } + + bus->i2c_smbus_read_byte(address); + bus->i2c_smbus_read_byte(address); + } + break; + + case 0x48: + //Write out 0xCC 0x01 0x00 0x00 sequence + res = bus->i2c_smbus_write_byte(address, 0xCC); + + if (res >= 0) + { + bus->i2c_smbus_write_byte(address, 0x01); + bus->i2c_smbus_write_byte(address, 0x00); + bus->i2c_smbus_write_byte(address, 0x00); + + pass = true; + + res = bus->i2c_smbus_read_byte(address); + + if (res != 0xCC) + { + pass = false; + } + + res = bus->i2c_smbus_read_byte(address); + + if(res != 0x01) + { + pass = false; + } + + bus->i2c_smbus_read_byte(address); + bus->i2c_smbus_read_byte(address); + } + break; } return(pass);