diff options
Diffstat (limited to 'src/include/usr/i2c/i2cif.H')
| -rw-r--r-- | src/include/usr/i2c/i2cif.H | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/include/usr/i2c/i2cif.H b/src/include/usr/i2c/i2cif.H index 7d678cb87..c219fca29 100644 --- a/src/include/usr/i2c/i2cif.H +++ b/src/include/usr/i2c/i2cif.H @@ -25,6 +25,11 @@ #ifndef __I2CIF_H #define __I2CIF_H +// Handy macros to check i2c ranges +// Pass in an instance of a TARGETING::ATTR_I2C_BUS_SPEED_ARRAY_type +#define I2C_BUS_MAX_ENGINE(var) (sizeof(var)/sizeof(var[0])) +#define I2C_BUS_MAX_PORT(var) (sizeof(var[0])/sizeof(var[0][0])) + namespace I2C { @@ -146,6 +151,31 @@ enum i2cSetAccessModeType void i2cSetAccessMode( i2cSetAccessModeType i_setModeType ); + +/** + * @brief Define a set of information about the I2C masters + * (primarily used to populate the devtree) + */ +struct MasterInfo_t +{ + uint64_t scomAddr; //< Base scom address for control regs + uint8_t engine; //< Engine number + uint32_t freq; //< Clock frequency of master in Hz +}; + +/** + * @brief Return a set of information related to each I2C master on + * the given target chip + * + * @param[in] i_chip - I2C Master chip (proc or membuf) + * @param[out] o_info - list of I2C Information + * + * @return errlHndl_t - Null if successful, otherwise a pointer to + * the error log. + */ +void getMasterInfo( const TARGETING::Target* i_chip, + std::list<MasterInfo_t>& o_info ); + }; // end namespace I2C #endif // end __I2CIF_H |

