include: fpga: adi-axi-common.h: add version helper macros
authorAlexandru Ardelean <alexandru.ardelean@analog.com>
Tue, 24 Mar 2020 13:46:30 +0000 (15:46 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 19 Apr 2020 15:56:21 +0000 (16:56 +0100)
The format for all ADI AXI IP cores is the same.
i.e. 'major.minor.patch'.

This patch adds the helper macros to be re-used in ADI AXI drivers.

Acked-by: Moritz Fischer <mdf@kernel.org>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
include/linux/fpga/adi-axi-common.h

index ebd4e07ae3d86a35b6e6f2ce36903c5b4d60c725..141ac3f251e6f256526812b9d55cd440a2a46e76 100644 (file)
@@ -16,4 +16,8 @@
 #define ADI_AXI_PCORE_VER(major, minor, patch) \
        (((major) << 16) | ((minor) << 8) | (patch))
 
+#define ADI_AXI_PCORE_VER_MAJOR(version)       (((version) >> 16) & 0xff)
+#define ADI_AXI_PCORE_VER_MINOR(version)       (((version) >> 8) & 0xff)
+#define ADI_AXI_PCORE_VER_PATCH(version)       ((version) & 0xff)
+
 #endif /* ADI_AXI_COMMON_H_ */