blob: b2352e5ba00e338570fe8163f7c3a88f9b6ddcf0 [file] [log] [blame]
#ifndef THIRD_PARTY_MILOTIC_EXTERNAL_CC_TLBMC_HAL_SYSFS_I3C_H_
#define THIRD_PARTY_MILOTIC_EXTERNAL_CC_TLBMC_HAL_SYSFS_I3C_H_
#include <cstdint>
#include <string>
#include "boost/filesystem.hpp" // NOLINT: boost::filesystem is commonly used in BMC
#include "hal_common_config.pb.h"
#include "tlbmc/hal/sysfs/hwmon.h"
namespace milotic_tlbmc {
struct I3cSysfsConfig {
std::string i3c_sysfs_path = "/sys/bus/i3c/devices/";
};
// The class is thread-safe.
class I3cSysfs : public HwmonSysfs {
public:
explicit I3cSysfs(const I3cSysfsConfig& config) : config_(config) {}
virtual ~I3cSysfs() = default;
boost::filesystem::path GetBusPath(uint64_t bus) const override;
std::string GetDeviceDirectoryName(
const HalCommonConfig& config) const override;
bool IsDevicePresent(const HalCommonConfig& config) const override;
private:
const I3cSysfsConfig config_;
};
} // namespace milotic_tlbmc
#endif // THIRD_PARTY_MILOTIC_EXTERNAL_CC_TLBMC_HAL_SYSFS_I3C_H_