habanalabs: create static map of f/w hwmon enums
authorRajaravi Krishna Katta <rkatta@habana.ai>
Tue, 24 Aug 2021 13:39:16 +0000 (16:39 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Mon, 18 Oct 2021 09:05:46 +0000 (12:05 +0300)
commit7457269136043fdbb7ff28bbc82d9655ad6012d7
treecdc696b431820b43093964da0967250279e57ce6
parent4be9fb53039ab1327f058e09039404ad33926adb
habanalabs: create static map of f/w hwmon enums

Instead of using the Linux kernel HWMON enums definition when
communicating with the firmware, use proprietary HWMON based enums
i.e. map hwmon.h header enum to cpucp_if.h based enum while.

This is needed because the HWMON enums are not forcing backward
compatibility and therefore changes can break compatibility between
newer driver and older firmware.

The driver will check for CPU_BOOT_DEV_STS0_MAP_HWMON_EN bit to
validate if f/w supports cpucp->hwmon enum mapping to support older
firmware where this mapping won't be available.

Signed-off-by: Rajaravi Krishna Katta <rkatta@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/common/hwmon.c
drivers/misc/habanalabs/include/common/hl_boot_if.h