linux/drivers/net/ethernet/mellanox/mlx5/core/hwmon.c

// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
// Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved

#include <linux/hwmon.h>
#include <linux/bitmap.h>
#include <linux/mlx5/device.h>
#include <linux/mlx5/mlx5_ifc.h>
#include <linux/mlx5/port.h>
#include "mlx5_core.h"
#include "hwmon.h"

#define CHANNELS_TYPE_NUM
#define CHIP_CONFIG_NUM

/* module 0 is mapped to sensor_index 64 in MTMP register */
#define to_mtmp_module_sensor_idx(idx)

/* All temperatures retrieved in units of 0.125C. hwmon framework expect
 * it in units of millidegrees C. Hence multiply values by 125.
 */
#define mtmp_temp_to_mdeg(temp)

struct temp_channel_desc {};

/* chip_channel_config and channel_info arrays must be 0-terminated, hence + 1 */
struct mlx5_hwmon {};

static int mlx5_hwmon_query_mtmp(struct mlx5_core_dev *mdev, u32 sensor_index, u32 *mtmp_out)
{}

static int mlx5_hwmon_reset_max_temp(struct mlx5_core_dev *mdev, int sensor_index)
{}

static int mlx5_hwmon_enable_max_temp(struct mlx5_core_dev *mdev, int sensor_index)
{}

static int mlx5_hwmon_read(struct device *dev, enum hwmon_sensor_types type, u32 attr,
			   int channel, long *val)
{}

static int mlx5_hwmon_write(struct device *dev, enum hwmon_sensor_types type, u32 attr,
			    int channel, long val)
{}

static umode_t mlx5_hwmon_is_visible(const void *data, enum hwmon_sensor_types type, u32 attr,
				     int channel)
{}

static int mlx5_hwmon_read_string(struct device *dev, enum hwmon_sensor_types type, u32 attr,
				  int channel, const char **str)
{}

static const struct hwmon_ops mlx5_hwmon_ops =;

static int mlx5_hwmon_init_channels_names(struct mlx5_hwmon *hwmon)
{}

static int mlx5_hwmon_get_module_sensor_index(struct mlx5_core_dev *mdev, u32 *module_index)
{}

static int mlx5_hwmon_init_sensors_indexes(struct mlx5_hwmon *hwmon, u64 sensor_map)
{}

static void mlx5_hwmon_channel_info_init(struct mlx5_hwmon *hwmon)
{}

static int mlx5_hwmon_is_module_mon_cap(struct mlx5_core_dev *mdev, bool *mon_cap)
{}

static int mlx5_hwmon_get_sensors_count(struct mlx5_core_dev *mdev, u32 *asic_platform_scount)
{}

static void mlx5_hwmon_free(struct mlx5_hwmon *hwmon)
{}

static struct mlx5_hwmon *mlx5_hwmon_alloc(struct mlx5_core_dev *mdev)
{}

static int mlx5_hwmon_dev_init(struct mlx5_hwmon *hwmon)
{}

int mlx5_hwmon_dev_register(struct mlx5_core_dev *mdev)
{}

void mlx5_hwmon_dev_unregister(struct mlx5_core_dev *mdev)
{}