Store name in GainwardGPUControllers to avoid setting it in detectors
This commit is contained in:
parent
8813c9936d
commit
0afcdbd0ca
7 changed files with 32 additions and 16 deletions
|
|
@ -77,9 +77,8 @@ void DetectGainwardGPUControllers(i2c_smbus_interface* bus, uint8_t i2c_addr, co
|
|||
\*-----------------------------------------------------------------*/
|
||||
case 0x08:
|
||||
{
|
||||
GainwardGPUv1Controller* controller = new GainwardGPUv1Controller(bus, i2c_addr);
|
||||
GainwardGPUv1Controller* controller = new GainwardGPUv1Controller(bus, i2c_addr, name);
|
||||
RGBController_GainwardGPUv1* rgb_controller = new RGBController_GainwardGPUv1(controller);
|
||||
rgb_controller->name = name;
|
||||
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
|
|
@ -90,9 +89,8 @@ void DetectGainwardGPUControllers(i2c_smbus_interface* bus, uint8_t i2c_addr, co
|
|||
\*-----------------------------------------------------------------*/
|
||||
case 0x49:
|
||||
{
|
||||
GainwardGPUv2Controller* controller = new GainwardGPUv2Controller(bus, i2c_addr);
|
||||
GainwardGPUv2Controller* controller = new GainwardGPUv2Controller(bus, i2c_addr, name);
|
||||
RGBController_GainwardGPUv2* rgb_controller = new RGBController_GainwardGPUv2(controller);
|
||||
rgb_controller->name = name;
|
||||
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,10 +12,11 @@
|
|||
#include <cstring>
|
||||
#include "GainwardGPUv1Controller.h"
|
||||
|
||||
GainwardGPUv1Controller::GainwardGPUv1Controller(i2c_smbus_interface* bus, gainward_gpu_dev_id dev)
|
||||
GainwardGPUv1Controller::GainwardGPUv1Controller(i2c_smbus_interface* bus, gainward_gpu_dev_id dev, std::string dev_name)
|
||||
{
|
||||
this->bus = bus;
|
||||
this->dev = dev;
|
||||
this->bus = bus;
|
||||
this->dev = dev;
|
||||
this->name = dev_name;
|
||||
}
|
||||
|
||||
GainwardGPUv1Controller::~GainwardGPUv1Controller()
|
||||
|
|
@ -33,6 +34,11 @@ std::string GainwardGPUv1Controller::GetDeviceLocation()
|
|||
return("I2C: " + return_string);
|
||||
}
|
||||
|
||||
std::string GainwardGPUv1Controller::GetDeviceName()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
unsigned char GainwardGPUv1Controller::GetLEDRed()
|
||||
{
|
||||
return(GainwardGPURegisterRead(GAINWARD_RED_REGISTER));
|
||||
|
|
|
|||
|
|
@ -28,10 +28,12 @@ enum
|
|||
class GainwardGPUv1Controller
|
||||
{
|
||||
public:
|
||||
GainwardGPUv1Controller(i2c_smbus_interface* bus, gainward_gpu_dev_id);
|
||||
GainwardGPUv1Controller(i2c_smbus_interface* bus, gainward_gpu_dev_id, std::string dev_name);
|
||||
~GainwardGPUv1Controller();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetDeviceName();
|
||||
|
||||
unsigned char GetLEDRed();
|
||||
unsigned char GetLEDGreen();
|
||||
unsigned char GetLEDBlue();
|
||||
|
|
@ -44,4 +46,5 @@ public:
|
|||
private:
|
||||
i2c_smbus_interface * bus;
|
||||
gainward_gpu_dev_id dev;
|
||||
std::string name;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -32,10 +32,10 @@ RGBController_GainwardGPUv1::RGBController_GainwardGPUv1(GainwardGPUv1Controller
|
|||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = "Gainward GPU";
|
||||
name = controller->GetDeviceName();
|
||||
vendor = "Gainward";
|
||||
type = DEVICE_TYPE_GPU;
|
||||
description = "Gainward GTX GPU";
|
||||
description = "Gainward GPU V1 Device";
|
||||
location = controller->GetDeviceLocation();
|
||||
|
||||
mode Direct;
|
||||
|
|
|
|||
|
|
@ -12,10 +12,11 @@
|
|||
#include <cstring>
|
||||
#include "GainwardGPUv2Controller.h"
|
||||
|
||||
GainwardGPUv2Controller::GainwardGPUv2Controller(i2c_smbus_interface* bus, gainward_gpu_dev_id dev)
|
||||
GainwardGPUv2Controller::GainwardGPUv2Controller(i2c_smbus_interface* bus, gainward_gpu_dev_id dev, std::string dev_name)
|
||||
{
|
||||
this->bus = bus;
|
||||
this->dev = dev;
|
||||
this->bus = bus;
|
||||
this->dev = dev;
|
||||
this->name = dev_name;
|
||||
}
|
||||
|
||||
GainwardGPUv2Controller::~GainwardGPUv2Controller() = default;
|
||||
|
|
@ -30,6 +31,11 @@ std::string GainwardGPUv2Controller::GetDeviceLocation()
|
|||
return("I2C: " + return_string);
|
||||
}
|
||||
|
||||
std::string GainwardGPUv2Controller::GetDeviceName()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
unsigned char GainwardGPUv2Controller::GetLEDRed()
|
||||
{
|
||||
return(bus->i2c_smbus_read_byte_data(dev, GAINWARD_V2_RED_REGISTER));
|
||||
|
|
|
|||
|
|
@ -80,10 +80,12 @@ enum
|
|||
class GainwardGPUv2Controller
|
||||
{
|
||||
public:
|
||||
GainwardGPUv2Controller(i2c_smbus_interface* bus, gainward_gpu_dev_id);
|
||||
GainwardGPUv2Controller(i2c_smbus_interface* bus, gainward_gpu_dev_id, std::string dev_name);
|
||||
~GainwardGPUv2Controller();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetDeviceName();
|
||||
|
||||
unsigned char GetLEDRed();
|
||||
unsigned char GetLEDGreen();
|
||||
unsigned char GetLEDBlue();
|
||||
|
|
@ -95,4 +97,5 @@ public:
|
|||
private:
|
||||
i2c_smbus_interface * bus;
|
||||
gainward_gpu_dev_id dev;
|
||||
std::string name;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -26,10 +26,10 @@ RGBController_GainwardGPUv2::RGBController_GainwardGPUv2(GainwardGPUv2Controller
|
|||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = "Gainward GPU";
|
||||
name = controller->GetDeviceName();
|
||||
vendor = "Gainward";
|
||||
type = DEVICE_TYPE_GPU;
|
||||
description = "Gainward RTX GPU";
|
||||
description = "Gainward GPU V2 Device";
|
||||
location = controller->GetDeviceLocation();
|
||||
|
||||
mode Static;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue