hwmon: (mlxreg-fan) Modify macros for tachometer fault status reading
Modify macros for tachometer fault status reading for making it more simple and clear. Signed-off-by: Vadim Pasternak <vadimp@mellanox.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
Родитель
9a629d7ada
Коммит
3f9ffa5c3a
|
@ -51,7 +51,7 @@
|
||||||
*/
|
*/
|
||||||
#define MLXREG_FAN_GET_RPM(rval, d, s) (DIV_ROUND_CLOSEST(15000000 * 100, \
|
#define MLXREG_FAN_GET_RPM(rval, d, s) (DIV_ROUND_CLOSEST(15000000 * 100, \
|
||||||
((rval) + (s)) * (d)))
|
((rval) + (s)) * (d)))
|
||||||
#define MLXREG_FAN_GET_FAULT(val, mask) (!((val) ^ (mask)))
|
#define MLXREG_FAN_GET_FAULT(val, mask) ((val) == (mask))
|
||||||
#define MLXREG_FAN_PWM_DUTY2STATE(duty) (DIV_ROUND_CLOSEST((duty) * \
|
#define MLXREG_FAN_PWM_DUTY2STATE(duty) (DIV_ROUND_CLOSEST((duty) * \
|
||||||
MLXREG_FAN_MAX_STATE, \
|
MLXREG_FAN_MAX_STATE, \
|
||||||
MLXREG_FAN_MAX_DUTY))
|
MLXREG_FAN_MAX_DUTY))
|
||||||
|
|
Загрузка…
Ссылка в новой задаче