]> git.ipfire.org Git - thirdparty/linux.git/commit
mlxsw: core: Extend cooling device with cooling levels
authorVadim Pasternak <vadimp@mellanox.com>
Tue, 20 Nov 2018 06:52:03 +0000 (06:52 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 20 Nov 2018 18:31:15 +0000 (10:31 -0800)
commita421ce088ac8eb3591d2a1ae0ded2dcece72018f
treee2a53f2f1f6fb23c49a904c978e29db16d6a3698
parentb539ea60f5043b9acd7562f04fa2117f18776cbb
mlxsw: core: Extend cooling device with cooling levels

Extend cooling device with cooling levels vector to allow more
flexibility of PWM setting.

Thermal zone algorithm operates with the numerical states for PWM
setting. Each state is the index, defined in range from 0 to 10 and it's
mapped to the relevant duty cycle value, which is written to PWM
controller. With the current definition fan speed is set to 0% for state
0, 10% for state 1, and so on up to 100% for the maximum state 10.

Some systems have limitation for the PWM speed minimum. For such systems
PWM setting speed to 0% will just disable the ability to increase speed
anymore and such device will be stall on zero speed.  Cooling levels
allow to configure state vector according to the particular system
requirements. For example, if PWM speed is not allowed to be below 30%,
cooling levels could be configured as 30%, 30%, 30%, 30%, 40%, 50% and
so on.

Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/core_thermal.c