OSDN Git Service

mlxsw: thermal: Add function for reading module temperature and thresholds
authorMykola Kostenok <c_mykolak@nvidia.com>
Tue, 8 Jun 2021 12:44:13 +0000 (15:44 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 8 Jun 2021 21:39:07 +0000 (14:39 -0700)
commite57977b34ab5d52d73bc0b8b2ff941ac21d7166f
tree19307bc5921858cc19c0315f98e89c728398ee09
parentbefc2048088aefbcd88b18225ba33231887137dc
mlxsw: thermal: Add function for reading module temperature and thresholds

Provide new function mlxsw_thermal_module_temp_and_thresholds_get() for
reading temperature and temperature thresholds by a single operation.
The motivation is to reduce the number of transactions with the device
which is important when operating over a slow bus such as I2C.

Currently, the sole caller of the function is only using it to read the
module's temperature. The next patch will also use it to query the
module's temperature thresholds.

Signed-off-by: Mykola Kostenok <c_mykolak@nvidia.com>
Acked-by: Vadim Pasternak <vadimp@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/core_thermal.c