Commit graph

87 commits

Author SHA1 Message Date
silverspy18
d3f49c72e1 Implements i2c_smbus_amdadl::i2c_xfer for AMD ADL I2C. 2025-07-10 14:16:57 -05:00
Jana Rettig
5589aad730 Add I2C_SMBUS_I2C_BLOCK_DATA mode to i2c_smbus_amdadl 2025-06-18 18:05:58 -05:00
Peter Berendi
af5f66bc9e piix4: fix SMBHSTSTS test before and after transaction 2025-05-16 02:10:34 -05:00
Stephen Horvath
2c4b159901 Fix SPDDetector only scanning bus 0 on Linux 2025-04-21 14:42:22 -05:00
RedBlackAka
c57d58d49b Miscellaneous cleanups 2025-02-17 15:46:33 +00:00
Shady Nawara
aca9d27808 macOS smbus Piix4, SuperIO, and Nct6775 2025-02-06 17:20:30 +00:00
morg
9d229e2a0c Prevent non AMD devices to be registered from i2c_smbus_amdadl 2024-11-28 08:11:49 +01:00
Adam Honse
428355761e Fix unrecognized escape sequence warning in i2c_smbus_piix4.cpp 2024-08-17 01:24:37 -05:00
Adam Honse
a18211cc57 Fix unrecognized escape sequence and possible loss of data warnings in i2c_smbus_i801.cpp 2024-08-17 01:23:50 -05:00
Adam Honse
20e4d18cb4 Fix unreferenced parameter warning in i2c_smbus_piix4.cpp 2024-08-17 00:54:20 -05:00
Adam Honse
62b6e7175f Fix unreferenced variable and parameter warnings in i2c_smbus_nct6775.cpp 2024-08-17 00:53:01 -05:00
Adam Honse
cffac6c255 Fix unreferenced variable and parameter warnings in i2c_smbus_i801.cpp 2024-08-17 00:51:03 -05:00
Adam Honse
66a1496f18 Fix unreferenced parameter warning in i2c_smbus_amdadl.cpp 2024-08-17 00:46:33 -05:00
Adam Honse
1b26908104 Fix unreferenced local variable warning in i2c_smbus_nvapi.cpp 2024-08-17 00:25:30 -05:00
Adam Honse
bb1ae9cf2e Fix possible loss of data warning in i2c_smbus.cpp 2024-08-17 00:22:53 -05:00
Adam Honse
b12cd438cd Update more file header comments to standardized new format 2024-05-03 00:39:21 -05:00
morg
999bb03a45 Piix4 SMBus: set HANDLE initial value to prevent a crash on rescan 2023-11-14 08:43:06 +01:00
Sandipan Das
a934c4c034 i2c-smbus: linux: Remove stray whitespaces
Remove stray whitespaces in newlines.

Signed-off-by: Sandipan Das <sandipan.osd@gmail.com>
2023-09-12 08:43:28 -05:00
Sandipan Das
49a6905ab5 i2c-smbus: linux: Fix interface detection
There are cases where detection of an interface fails due to lack of
permissions when accessing /dev/i2c-*. In some instances, the current
code will perform a double readdir() and skip what should have been
the next interface to be enumerated.

E.g. consider a system with the following configuration

  $ ls -l /sys/bus/i2c/devices

  total 0
  lrwxrwxrwx. 1 root 0 Sep  4 07:19 i2c-0 -> ../../../devices/platform/AMDI0010:03/i2c-0/
  lrwxrwxrwx. 1 root 0 Sep  4 01:49 i2c-1 -> ../../../devices/pci0000:00/0000:00:08.1/0000:03:00.0/i2c-1/
  lrwxrwxrwx. 1 root 0 Sep  4 01:50 i2c-10 -> ../../../devices/pci0000:00/0000:00:14.0/i2c-10/
  lrwxrwxrwx. 1 root 0 Sep  4 01:49 i2c-2 -> ../../../devices/pci0000:00/0000:00:08.1/0000:03:00.0/i2c-2/
  lrwxrwxrwx. 1 root 0 Sep  4 01:49 i2c-3 -> ../../../devices/pci0000:00/0000:00:08.1/0000:03:00.0/i2c-3/
  lrwxrwxrwx. 1 root 0 Sep  4 01:49 i2c-4 -> ../../../devices/pci0000:00/0000:00:08.1/0000:03:00.0/i2c-4/
  lrwxrwxrwx. 1 root 0 Sep  4 01:49 i2c-5 -> ../../../devices/pci0000:00/0000:00:08.1/0000:03:00.0/drm/card1/card1-eDP-1/i2c-5/
  lrwxrwxrwx. 1 root 0 Sep  4 01:49 i2c-6 -> ../../../devices/pci0000:00/0000:00:08.1/0000:03:00.0/drm/card1/card1-DP-1/i2c-6/
  lrwxrwxrwx. 1 root 0 Sep  4 01:49 i2c-7 -> ../../../devices/pci0000:00/0000:00:08.1/0000:03:00.0/drm/card1/card1-DP-2/i2c-7/
  lrwxrwxrwx. 1 root 0 Sep  4 01:50 i2c-8 -> ../../../devices/pci0000:00/0000:00:14.0/i2c-8/
  lrwxrwxrwx. 1 root 0 Sep  4 01:50 i2c-9 -> ../../../devices/pci0000:00/0000:00:14.0/i2c-9/
  lrwxrwxrwx. 1 root 0 Sep  4 07:19 i2c-PNP0C50:0e -> ../../../devices/platform/AMDI0010:03/i2c-0/i2c-PNP0C50:0e/

  $ openrgb --verbose --list-devices

Before:

  ...
  Registering I2C interface: /dev/i2c-3 Device 1002:164C Subsystem: 1462:130C
  Registering I2C interface: /dev/i2c-10 Device 1022:790B Subsystem: 1462:130C
  Registering I2C interface: /dev/i2c-1 Device 1002:164C Subsystem: 1462:130C
  Registering I2C interface: /dev/i2c-8 Device 1022:790B Subsystem: 1462:130C
  [i2c_smbus_linux] Failed to read i2c device PCI device ID
  Registering I2C interface: /dev/i2c-6 Device 0000:0000 Subsystem: 0000:0000
  Registering I2C interface: /dev/i2c-4 Device 1002:164C Subsystem: 1462:130C
  [i2c_smbus_linux] Failed to read i2c device PCI device ID
  Registering I2C interface: /dev/i2c-PNP0C50:0e Device 0000:0000 Subsystem: 0000:0000
  Registering I2C interface: /dev/i2c-0 Device 0000:0000 Subsystem: 0000:0000
  Registering I2C interface: /dev/i2c-9 Device 1022:790B Subsystem: 1462:130C
  [i2c_smbus_linux] Failed to read i2c device PCI device ID
  Registering I2C interface: /dev/i2c-7 Device 0000:0000 Subsystem: 0000:0000
  [i2c_smbus_linux] Failed to read i2c device PCI device ID
  Registering I2C interface: /dev/i2c-5 Device 0000:0000 Subsystem: 0000:0000
  ...

After:

  ...
  Registering I2C interface: /dev/i2c-3 Device 1002:164C Subsystem: 1462:130C
  Registering I2C interface: /dev/i2c-10 Device 1022:790B Subsystem: 1462:130C
  Registering I2C interface: /dev/i2c-1 Device 1002:164C Subsystem: 1462:130C
  Registering I2C interface: /dev/i2c-8 Device 1022:790B Subsystem: 1462:130C
  [i2c_smbus_linux] Failed to read i2c device PCI device ID
  Registering I2C interface: /dev/i2c-6 Device 0000:0000 Subsystem: 0000:0000
  Registering I2C interface: /dev/i2c-4 Device 1002:164C Subsystem: 1462:130C
  [i2c_smbus_linux] Failed to read i2c device PCI device ID
  Registering I2C interface: /dev/i2c-PNP0C50:0e Device 0000:0000 Subsystem: 0000:0000
  Registering I2C interface: /dev/i2c-2 Device 1002:164C Subsystem: 1462:130C
  Registering I2C interface: /dev/i2c-0 Device 0000:0000 Subsystem: 0000:0000
  Registering I2C interface: /dev/i2c-9 Device 1022:790B Subsystem: 1462:130C
  [i2c_smbus_linux] Failed to read i2c device PCI device ID
  Registering I2C interface: /dev/i2c-7 Device 0000:0000 Subsystem: 0000:0000
  [i2c_smbus_linux] Failed to read i2c device PCI device ID
  Registering I2C interface: /dev/i2c-5 Device 0000:0000 Subsystem: 0000:0000
  ...

Signed-off-by: Sandipan Das <sandipan.osd@gmail.com>
2023-09-12 08:43:28 -05:00
Dmitry K
51712f08b5 Removed include directives from ResourceManager.h to speed up build process 2023-07-12 14:51:47 +00:00
Andrey
8c6cba5117 AMD ADL Multiple bus support 2023-05-28 23:23:55 +00:00
Adam Honse
ff8ac680ad Replace most instances of sprintf() with snprintf() 2023-03-02 00:15:03 -06:00
TheRogueZeta
c4d11993b6 Add logging for ADL GPU device ID's 2022-11-25 17:24:29 -08:00
Shady Nawara
6f477d6c4c Shared SMBus Access Using Global Mutex on Windows 2022-10-14 00:58:54 +00:00
Adam Honse
6341d629d8 AMD ADL SMBus improvements
* Allow word (2 byte) transfers
  * Fix block writes not sending data size
2022-09-30 09:42:19 -05:00
Adam Honse
3219dbfdc4 Fix read() warnings 2022-09-25 19:39:22 -05:00
nick black
99cd322721
i2c_smbus_linux: closedir() on error path 2022-09-03 03:08:33 -04:00
rob Dunn
185c1c3cae Fix Windows crash on startup in Intel i801 detection (Jeampan fix) https://gitlab.com/CalcProgrammer1/OpenRGB/-/issues/766
Commit amended by Adam Honse <calcprogrammer1@gmail.com>
2022-07-08 18:41:09 -05:00
Shady Nawara
e9c382d2e6 Add support for Intel i801 SMBus on MacOS 2022-05-31 00:59:07 +00:00
Vidar Karlsen
7faa3b4875 Unbreak macOS build 2022-05-04 04:32:24 +00:00
Vidar Karlsen
6ae5242ed5 Add FreeBSD support 2022-05-03 16:41:11 +00:00
Hacker Bonsai
54ba9aca02 Remove unnecessary context creation from ADL I2C controller 2022-04-12 16:39:11 +00:00
1000001101000
0bbc63aaf5 fix ptr/address of ptr confusion? 2022-01-27 19:19:36 +00:00
Shady Nawara
cd06401edd Switched InpOut32 with WinRing0 2022-01-24 04:15:06 +00:00
Shady Nawara
d90ea6b843 Reduce CPU usage when accessing i2c smbus devices on windows (AMD) 2022-01-24 00:20:03 +00:00
Érico Rolim
48d1a4f7b6 Don't use glibc specific function. 2022-01-02 20:01:01 +00:00
Adam Honse
341607ec3e Free allocated buffer in Linux pure i2c block transfer function 2021-12-29 03:48:19 -06:00
Adam Honse
46d8ca718e Fix pure i2c block read in Linux 2021-12-29 03:45:12 -06:00
1000001101000
e36b52136c Add functions to i2c_smbus for pure i2c block transactions
Commit amended to rework API and change for code style by Adam Honse <calcprogrammer1@gmail.com>
2021-11-24 15:42:54 -06:00
TheRogueZeta
922659cab0 Remove NVIDIA Windows only print and apply to all i2c interfaces 2021-11-18 23:04:14 -08:00
Adam Honse
e27cc4d0af Add ASUS RTX 3070 and 3090 GPUs to ENE controller 2021-11-18 20:53:57 +00:00
Thomas Rohloff
92dda2f390 Fix i2c detection on Linux.
Signed-off-by: Thomas Rohloff <v10lator@myway.de>
2021-11-17 20:45:16 -06:00
Adam Honse
c74a9849c0 Properly detect I2C initialization fail on Linux and fix dialog always being displayed even when I2C initialization was successful 2021-11-07 14:14:24 -06:00
Adam Honse
de4231f3ea Show dialog if any common I2C/SMBus initialization errors occur 2021-11-07 13:53:48 -06:00
Alex
14f9495444 Fix nvapi i2c smbus byte_data read return 2021-10-17 22:42:54 +00:00
TheRogueZeta
b3b67bd72e Fix NULL assignment for non block transactions in i2c_smbus_nvapi.cpp 2021-09-26 10:37:47 -07:00
Adam Honse
dd47256f06 Initialize WMI only once, remove init calls from everywhere it is called and initialize it once as a static variable
* See comment: https://gitlab.com/CalcProgrammer1/OpenRGB/-/issues/1581#note_684260496
2021-09-24 18:05:04 +00:00
TheRogueZeta
eaaed7fd83 Patch i2c_smbus_nvapi for I2C_SMBUS_I2C_BLOCK_DATA and add GPU logging 2021-09-24 17:54:42 +00:00
Alex
4af8614fce Add formated loging for device detection
Commits merged and amended for code style by Adam Honse <calcprogrammer1@gmail.com>
2021-07-05 03:23:34 -05:00
Adam Honse
2a3a736f09 Don't delete i2c bus list on redetect, as WMI query issues prevent them from being redetected 2021-05-24 17:00:18 -05:00