1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
2  * Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved
3  */
4 #ifndef __MLX5_HWMON_H__
5 #define __MLX5_HWMON_H__
6 
7 #include <linux/mlx5/driver.h>
8 
9 #if IS_ENABLED(CONFIG_HWMON)
10 
11 int mlx5_hwmon_dev_register(struct mlx5_core_dev *mdev);
12 void mlx5_hwmon_dev_unregister(struct mlx5_core_dev *mdev);
13 const char *hwmon_get_sensor_name(struct mlx5_hwmon *hwmon, int channel);
14 
15 #else
mlx5_hwmon_dev_register(struct mlx5_core_dev * mdev)16 static inline int mlx5_hwmon_dev_register(struct mlx5_core_dev *mdev)
17 {
18 	return 0;
19 }
20 
mlx5_hwmon_dev_unregister(struct mlx5_core_dev * mdev)21 static inline void mlx5_hwmon_dev_unregister(struct mlx5_core_dev *mdev) {}
22 
23 #endif
24 
25 #endif /* __MLX5_HWMON_H__ */
26