Implemented ColorfulGPUController to support iGame 3070. Closes #2841
This commit is contained in:
parent
4d4c18f1ef
commit
3b9f06b10b
7 changed files with 228 additions and 1 deletions
|
|
@ -0,0 +1,40 @@
|
|||
#include "Detector.h"
|
||||
#include "ColorfulGPUController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_ColorfulGPU.h"
|
||||
#include "i2c_smbus.h"
|
||||
#include "pci_ids.h"
|
||||
#include <vector>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
bool TestForColorfulGPU(i2c_smbus_interface* bus, uint8_t i2c_addr)
|
||||
{
|
||||
int pktsz;
|
||||
const int read_sz = 0x40;
|
||||
const int write_sz = 6;
|
||||
|
||||
uint8_t data_pkt[write_sz] = { 0xAA, 0xEF, 0x81, 0x02, 0x1C, 0x02};
|
||||
bus->i2c_write_block(i2c_addr, write_sz, data_pkt);
|
||||
|
||||
uint8_t read_pkt[read_sz] = {};
|
||||
pktsz = read_sz;
|
||||
|
||||
int res = bus->i2c_read_block(i2c_addr, &pktsz, read_pkt);
|
||||
|
||||
return res == 0 && (read_pkt[0] == 0xAA && read_pkt[1] == 0xEF && read_pkt[2] == 0x81);
|
||||
}
|
||||
|
||||
void DetectColorfulGPUControllers(i2c_smbus_interface* bus, uint8_t i2c_addr, const std::string& name)
|
||||
{
|
||||
if(TestForColorfulGPU(bus, i2c_addr))
|
||||
{
|
||||
ColorfulGPUController* controller = new ColorfulGPUController(bus, i2c_addr);
|
||||
RGBController_ColorfulGPU* rgb_controller = new RGBController_ColorfulGPU(controller);
|
||||
rgb_controller->name = name;
|
||||
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
}
|
||||
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3070 Advanced OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3070_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3070_ADVANCED_OCV, 0x61);
|
||||
Loading…
Add table
Add a link
Reference in a new issue