| #ifndef THIRD_PARTY_MILOTIC_EXTERNAL_CC_TLBMC_HAL_SYSFS_HWMON_H_ |
| #define THIRD_PARTY_MILOTIC_EXTERNAL_CC_TLBMC_HAL_SYSFS_HWMON_H_ |
| |
| #include <cstdint> |
| #include <string> |
| #include <string_view> |
| |
| #include "absl/status/status.h" |
| #include "boost/filesystem.hpp" // NOLINT: boost::filesystem is commonly used in BMC |
| #include "hal_common_config.pb.h" |
| |
| namespace milotic_tlbmc { |
| |
| // An abstract class for interacting with hwmon sysfs for example i2c, i3c, |
| // peci etc. |
| class HwmonSysfs { |
| public: |
| virtual ~HwmonSysfs() = default; |
| |
| virtual boost::filesystem::path GetBusPath(uint64_t bus) const = 0; |
| |
| virtual std::string GetDeviceDirectoryName( |
| const HalCommonConfig& config) const = 0; |
| |
| virtual absl::Status NewDevice(const HalCommonConfig& config, |
| std::string_view driver_name) const; |
| |
| virtual absl::Status DeleteDevice(const HalCommonConfig& config) const; |
| |
| virtual bool IsDevicePresent(const HalCommonConfig& config) const = 0; |
| }; |
| |
| } // namespace milotic_tlbmc |
| |
| #endif // THIRD_PARTY_MILOTIC_EXTERNAL_CC_TLBMC_HAL_SYSFS_HWMON_H_ |