diff options
| author | Mike Baiocchi <baiocchi@us.ibm.com> | 2013-07-22 14:48:25 -0500 |
|---|---|---|
| committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-08-08 15:16:29 -0500 |
| commit | b390d78d49a76b69c80afe036ee5350878686152 (patch) | |
| tree | 053b958bc54911138b6c69a6ccccbff2e24a3d75 /src/include/usr/devicefw | |
| parent | 96d2b18667f66fc4997ca354c4098de5ca382625 (diff) | |
| download | talos-hostboot-b390d78d49a76b69c80afe036ee5350878686152.tar.gz talos-hostboot-b390d78d49a76b69c80afe036ee5350878686152.zip | |
New I2C Interface that adds device offset parameter
Adding an I2C Device Driver interface that has an additional
offset paramter which allows for a single operation to set both the
device's internal offset and then do a read or write to the device.
RTC: 73815
Change-Id: Ib77682f3b7e2088d77ce28b885c544e5cb785f6a
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/5524
Tested-by: Jenkins Server
Reviewed-by: ADAM R. MUHLE <armuhle@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include/usr/devicefw')
| -rw-r--r-- | src/include/usr/devicefw/driverif.H | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/include/usr/devicefw/driverif.H b/src/include/usr/devicefw/driverif.H index eab488baf..f1a52e98f 100644 --- a/src/include/usr/devicefw/driverif.H +++ b/src/include/usr/devicefw/driverif.H @@ -102,11 +102,29 @@ namespace DeviceFW * @param[in] i_port - Which port to use from the I2C master. * @param[in] i_engine - Which I2C master engine to use. * @param[in] i_devAddr - The device address on a given engine/port. + * @note '0' and 'NULL' added to line up with other DeviceFW::I2C */ #define DEVICE_I2C_ADDRESS( i_port, i_engine, i_devAddr )\ DeviceFW::I2C, static_cast<uint64_t>(( i_port )),\ static_cast<uint64_t>(( i_engine )),\ - static_cast<uint64_t>(( i_devAddr )) + static_cast<uint64_t>(( i_devAddr )),\ + 0,\ + NULL + + /** + * Construct the device addressing parameters for the I2C-offset device ops. + * @param[in] i_port - Which port to use from the I2C master. + * @param[in] i_engine - Which I2C master engine to use. + * @param[in] i_devAddr - The device address on a given engine/port. + * @param[in] i_offset_len - Length of offset (in bytes) + * @param[in] i_offset - Offset into I2C device + */ + #define DEVICE_I2C_ADDRESS_OFFSET( i_port, i_engine, i_devAddr, i_offset_len, i_offset)\ + DeviceFW::I2C, static_cast<uint64_t>(( i_port )),\ + static_cast<uint64_t>(( i_engine )),\ + static_cast<uint64_t>(( i_devAddr )),\ + static_cast<uint64_t>(( i_offset_len )),\ + static_cast<uint8_t*>(( i_offset )) /** @class InvalidParameterType * @brief Unused type to cause compiler fails for invalid template types. |

