1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # T2 SDE: package/*/openrgb/hotfix-i2c-bus.patch
3 # Copyright (C) 2023 The T2 SDE Project
5 # This Copyright note is generated by scripts/Create-CopyPatch,
6 # more information can be found in the files COPYING and README.
8 # This patch file is dual-licensed. It is available under the license the
9 # patched project is licensed under, as long as it is an OpenSource license
10 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
11 # of the GNU General Public License version 2 as used by the T2 SDE.
12 # --- T2-COPYRIGHT-NOTE-END ---
14 --- OpenRGB-release_0.8/i2c_smbus/i2c_smbus_linux.cpp.vanilla 2023-05-11 16:59:57.687538263 +0200
15 +++ OpenRGB-release_0.8/i2c_smbus/i2c_smbus_linux.cpp 2023-05-11 18:49:27.062012602 +0200
17 char driver_path[512];
24 unsigned short pci_device, pci_vendor, pci_subsystem_device, pci_subsystem_vendor;
28 // Start looking for I2C adapters in /sys/bus/i2c/devices/
29 - strcpy(driver_path, "/sys/bus/i2c/devices/");
30 + strcpy(driver_path, "/sys/class/i2c-adapter/");
31 dir = opendir(driver_path);
39 // Loop through all entries in i2c-adapter list
51 strcat(device_string, ent->d_name);
52 test_fd = open(device_string, O_RDWR);
61 - bus = new i2c_smbus_linux();
62 - strcpy(bus->device_name, device_string);
63 - bus->handle = test_fd;
64 - bus->pci_device = pci_device;
65 - bus->pci_vendor = pci_vendor;
66 - bus->pci_subsystem_device = pci_subsystem_device;
67 - bus->pci_subsystem_vendor = pci_subsystem_vendor;
68 - bus->port_id = port_id;
69 - ResourceManager::get()->RegisterI2CBus(bus);
74 + bus = new i2c_smbus_linux();
75 + strcpy(bus->device_name, device_string);
76 + bus->handle = test_fd;
77 + bus->pci_device = pci_device;
78 + bus->pci_vendor = pci_vendor;
79 + bus->pci_subsystem_device = pci_subsystem_device;
80 + bus->pci_subsystem_vendor = pci_subsystem_vendor;
81 + bus->port_id = port_id;
82 + ResourceManager::get()->RegisterI2CBus(bus);