Skip to content

Commit 55c63aa

Browse files
jpirkodavem330
authored andcommitted
mlxsw: reg: Add Management Fan Speed Limit register
The MFSL register is used to configure the fan speed event / interrupt notification mechanism. Fan speed threshold are defined for both under-speed and over-speed. Signed-off-by: Jiri Pirko <[email protected]> Reviewed-by: Ido Schimmel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2903372 commit 55c63aa

File tree

1 file changed

+49
-0
lines changed
  • drivers/net/ethernet/mellanox/mlxsw

1 file changed

+49
-0
lines changed

drivers/net/ethernet/mellanox/mlxsw/reg.h

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4518,6 +4518,54 @@ static inline void mlxsw_reg_mfsm_pack(char *payload, u8 tacho)
45184518
mlxsw_reg_mfsm_tacho_set(payload, tacho);
45194519
}
45204520

4521+
/* MFSL - Management Fan Speed Limit Register
4522+
* ------------------------------------------
4523+
* The Fan Speed Limit register is used to configure the fan speed
4524+
* event / interrupt notification mechanism. Fan speed threshold are
4525+
* defined for both under-speed and over-speed.
4526+
*/
4527+
#define MLXSW_REG_MFSL_ID 0x9004
4528+
#define MLXSW_REG_MFSL_LEN 0x0C
4529+
4530+
MLXSW_REG_DEFINE(mfsl, MLXSW_REG_MFSL_ID, MLXSW_REG_MFSL_LEN);
4531+
4532+
/* reg_mfsl_tacho
4533+
* Fan tachometer index.
4534+
* Access: Index
4535+
*/
4536+
MLXSW_ITEM32(reg, mfsl, tacho, 0x00, 24, 4);
4537+
4538+
/* reg_mfsl_tach_min
4539+
* Tachometer minimum value (minimum RPM).
4540+
* Access: RW
4541+
*/
4542+
MLXSW_ITEM32(reg, mfsl, tach_min, 0x04, 0, 16);
4543+
4544+
/* reg_mfsl_tach_max
4545+
* Tachometer maximum value (maximum RPM).
4546+
* Access: RW
4547+
*/
4548+
MLXSW_ITEM32(reg, mfsl, tach_max, 0x08, 0, 16);
4549+
4550+
static inline void mlxsw_reg_mfsl_pack(char *payload, u8 tacho,
4551+
u16 tach_min, u16 tach_max)
4552+
{
4553+
MLXSW_REG_ZERO(mfsl, payload);
4554+
mlxsw_reg_mfsl_tacho_set(payload, tacho);
4555+
mlxsw_reg_mfsl_tach_min_set(payload, tach_min);
4556+
mlxsw_reg_mfsl_tach_max_set(payload, tach_max);
4557+
}
4558+
4559+
static inline void mlxsw_reg_mfsl_unpack(char *payload, u8 tacho,
4560+
u16 *p_tach_min, u16 *p_tach_max)
4561+
{
4562+
if (p_tach_min)
4563+
*p_tach_min = mlxsw_reg_mfsl_tach_min_get(payload);
4564+
4565+
if (p_tach_max)
4566+
*p_tach_max = mlxsw_reg_mfsl_tach_max_get(payload);
4567+
}
4568+
45214569
/* MTCAP - Management Temperature Capabilities
45224570
* -------------------------------------------
45234571
* This register exposes the capabilities of the device and
@@ -5228,6 +5276,7 @@ static const struct mlxsw_reg_info *mlxsw_reg_infos[] = {
52285276
MLXSW_REG(mfcr),
52295277
MLXSW_REG(mfsc),
52305278
MLXSW_REG(mfsm),
5279+
MLXSW_REG(mfsl),
52315280
MLXSW_REG(mtcap),
52325281
MLXSW_REG(mtmp),
52335282
MLXSW_REG(mpat),

0 commit comments

Comments
 (0)