mlxsw_hwmon
struct mlxsw_hwmon *hwmon;
struct mlxsw_hwmon;
struct mlxsw_hwmon **p_hwmon);
void mlxsw_hwmon_fini(struct mlxsw_hwmon *mlxsw_hwmon);
struct mlxsw_hwmon **p_hwmon)
static inline void mlxsw_hwmon_fini(struct mlxsw_hwmon *mlxsw_hwmon)
err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mtmp), mtmp_pl);
dev_err(mlxsw_hwmon->bus_info->dev, "Failed to query temp sensor\n");
struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon;
err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mtmp), mtmp_pl);
err = mlxsw_reg_write(mlxsw_hwmon->core, MLXSW_REG(mtmp), mtmp_pl);
dev_err(mlxsw_hwmon->bus_info->dev, "Failed to reset temp sensor history\n");
struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon;
err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mfsm), mfsm_pl);
dev_err(mlxsw_hwmon->bus_info->dev, "Failed to query fan\n");
struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon;
err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(fore), fore_pl);
dev_err(mlxsw_hwmon->bus_info->dev, "Failed to query fan\n");
struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon;
err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mfsc), mfsc_pl);
dev_err(mlxsw_hwmon->bus_info->dev, "Failed to query PWM\n");
struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon;
err = mlxsw_reg_write(mlxsw_hwmon->core, MLXSW_REG(mfsc), mfsc_pl);
dev_err(mlxsw_hwmon->bus_info->dev, "Failed to write PWM\n");
struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon;
err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mtmp), mtmp_pl);
struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon;
err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mtbr), mtbr_pl);
struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon;
err = mlxsw_env_module_temp_thresholds_get(mlxsw_hwmon->core,
struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon;
err = mlxsw_env_module_temp_thresholds_get(mlxsw_hwmon->core,
struct mlxsw_hwmon *hwmon;
struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon;
err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mtcap), mtcap_pl);
dev_err(mlxsw_hwmon->bus_info->dev, "Failed to get number of temp sensors\n");
err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mtmp),
err = mlxsw_reg_write(mlxsw_hwmon->core,
dev_err(mlxsw_hwmon->bus_info->dev, "Failed to setup temp sensor number %d\n",
struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon;
err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mfcr), mfcr_pl);
dev_err(mlxsw_hwmon->bus_info->dev, "Failed to get to probe PWMs and Tachometers\n");
struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon;
err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mgpir), mgpir_pl);
struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon;
struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon;
err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mgpir), mgpir_pl);
err = mlxsw_reg_write(mlxsw_hwmon->core,
dev_err(mlxsw_hwmon->bus_info->dev, "Failed to setup temp sensor number %d\n",
struct mlxsw_hwmon *hwmon = priv;
err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mtmp), mtmp_pl);
dev_err(mlxsw_hwmon->bus_info->dev, "Failed to query temp sensor\n");
struct mlxsw_hwmon *hwmon = priv;
struct mlxsw_hwmon **p_hwmon)
struct mlxsw_hwmon *mlxsw_hwmon;
mlxsw_hwmon = kzalloc_flex(*mlxsw_hwmon, line_cards, num_of_slots + 1);
if (!mlxsw_hwmon)
mlxsw_hwmon->core = mlxsw_core;
mlxsw_hwmon->bus_info = mlxsw_bus_info;
mlxsw_hwmon->line_cards[0].hwmon = mlxsw_hwmon;
mlxsw_hwmon->line_cards[0].slot_index = 0;
err = mlxsw_hwmon_temp_init(&mlxsw_hwmon->line_cards[0]);
err = mlxsw_hwmon_fans_init(&mlxsw_hwmon->line_cards[0]);
err = mlxsw_hwmon_module_init(&mlxsw_hwmon->line_cards[0]);
err = mlxsw_hwmon_gearbox_init(&mlxsw_hwmon->line_cards[0]);
mlxsw_hwmon->line_cards[0].groups[0] = &mlxsw_hwmon->line_cards[0].group;
mlxsw_hwmon->line_cards[0].group.attrs = mlxsw_hwmon->line_cards[0].attrs;
&mlxsw_hwmon->line_cards[0],
mlxsw_hwmon->line_cards[0].groups);
err = mlxsw_linecards_event_ops_register(mlxsw_hwmon->core,
mlxsw_hwmon);
mlxsw_hwmon->line_cards[0].hwmon_dev = hwmon_dev;
mlxsw_hwmon->line_cards[0].active = true;
*p_hwmon = mlxsw_hwmon;
hwmon_device_unregister(mlxsw_hwmon->line_cards[0].hwmon_dev);
kfree(mlxsw_hwmon);
void mlxsw_hwmon_fini(struct mlxsw_hwmon *mlxsw_hwmon)
mlxsw_hwmon->line_cards[0].active = false;
mlxsw_linecards_event_ops_unregister(mlxsw_hwmon->core,
&mlxsw_hwmon_event_ops, mlxsw_hwmon);
hwmon_device_unregister(mlxsw_hwmon->line_cards[0].hwmon_dev);
kfree(mlxsw_hwmon);
struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon;