2cad31a4 | 18-Dec-2024 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: re-format for clang-19
clang-format-19 isn't compatible with the clang-format-18 output, so we need to reformat the code with the latest version. A few parameters in clang-tidy have b
clang-format: re-format for clang-19
clang-format-19 isn't compatible with the clang-format-18 output, so we need to reformat the code with the latest version. A few parameters in clang-tidy have been deprecated, so adjust the style file accordingly.
See Ie2f6eb3b043f2d655c9df806815afd7971fd0947 for updated style. See I88192b41ab7a95599a90915013579608af7bc56f for clang-19 enablement.
Change-Id: I0f3c1b9ae57b1a2a21185b4d54559cd3b18bee9b Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
a3ff7e71 | 15-Oct-2024 |
Shawn McCarney <shawnmm@us.ibm.com> |
I2CInterface: Add process call methods
Add C++ methods to perform the following SMBus commands: * Process Call * Block Write-Block Read Process Call
For Block Write-Block Read Process Call, impleme
I2CInterface: Add process call methods
Add C++ methods to perform the following SMBus commands: * Process Call * Block Write-Block Read Process Call
For Block Write-Block Read Process Call, implement support for writes up to 255 bytes. SMBus 2.0 supported a maximum of 32 bytes, and SMBus 3.0 supports a maximum of 255 bytes. The current Linux SMBus function only supports 32 byte writes. Provide an alternate implementation using the lower level I2C_RDWR ioctl() to support up to 255 bytes.
Tested: * Verified Process Call worked correctly * Verified Block Write-Block Read Process Call worked correctly * When using SMBus function * When using I2C_RDWR ioctl() * Tested error cases * See complete test plan at https://gist.github.com/smccarney/96eda4c7c11fe4f89e4491c768f76047
Change-Id: Icc1ba840741b1e26a50fe32bad8b2181a01dbb24 Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
show more ...
|
38ed88d6 | 11-Dec-2019 |
Shawn McCarney <shawnmm@us.ibm.com> |
i2c: Cache adapter functionality
Enhance the I2CDevice class to cache the I2C adapter functionality value. The adapter functionality value should not change while the device interface is open.
Cac
i2c: Cache adapter functionality
Enhance the I2CDevice class to cache the I2C adapter functionality value. The adapter functionality value should not change while the device interface is open.
Caching the functionality value will reduce the number of ioctl() calls by 50% when doing long sequences of I2C operations.
Tested: * Verified adapter functionality value is cached * Verified read() method works on a Witherspoon * Verified close() method discards the cached functionality value
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com> Change-Id: I2b17d91ae4e21aaf52cd4cec9eddb5aab7be37e5
show more ...
|
d45a9a6d | 10-Dec-2019 |
Shawn McCarney <shawnmm@us.ibm.com> |
i2c: Support explicit open/close and re-open
Add the ability to explicitly open and close the I2CInterface/I2CDevice. Also add support to re-open the I2CInterface/I2CDevice after it was closed.
Thi
i2c: Support explicit open/close and re-open
Add the ability to explicitly open and close the I2CInterface/I2CDevice. Also add support to re-open the I2CInterface/I2CDevice after it was closed.
This support is needed for use cases like the following:
* I2C device information (bus and address) is parsed from a configuration file at standby. However, an I2C connection to the device should not be opened yet. The device may not have power until the system has been booted. Additionally, if the device is a FRU, it could be replaced (remove + add) while at standby, leading to communication errors.
* The device is sometimes bound to a device driver. The I2C connection should only be open during the time periods when the device driver is not bound.
Tested: * Verified create() function with default value of OPEN, explicit value of OPEN, and explicit value of CLOSED. * Verified device interface can be explicitly opened, closed, and re-opened. * Verified read() and write() functions still work when device interface is open. * Verified open() fails with appropriate error if already open. * Verified read() fails with appropriate error if not open. * Verified write() fails with appropriate error if not open. * Verified close() fails with appropriate error if not open.
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com> Change-Id: I0182966f0b0614eac0de69eb95d960035f9d0426
show more ...
|
1d103428 | 29-Nov-2019 |
Lei YU <mine260309@gmail.com> |
i2c: Add i2c block transaction support
The previous code always uses SMBus block read/write. On some PSU (e.g. FP5280G2's PSU) the I2C block read/write is required, so add that support.
Specificall
i2c: Add i2c block transaction support
The previous code always uses SMBus block read/write. On some PSU (e.g. FP5280G2's PSU) the I2C block read/write is required, so add that support.
Specifically, add a Mode enum class and add the parameter for block read/write to indicate whether SMBus or I2C block read/write is to be called.
Tested: Verify the code works on FP5280G2 with I2C block write.
Note: Currently there is no case for I2C block read, so that function is not tested.
Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: I5f77ffe6900d14f3703dae7241799a7b37c5a726
show more ...
|
9af82a5c | 06-Nov-2019 |
Lei YU <mine260309@gmail.com> |
i2c: Implement open and close
Implement open() and close() function, and invoke open() on creating I2CDevice, and invoke close() in destructor.
Tested: Manually write test codet and run on Withersp
i2c: Implement open and close
Implement open() and close() function, and invoke open() on creating I2CDevice, and invoke close() in destructor.
Tested: Manually write test codet and run on Witherspoon that it opens and closes the i2c device correctly.
Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: I709fcc80474a4a0cef067748a78256ceb76430a5
show more ...
|