summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAlexandru Ardelean <alexandru.ardelean@analog.com>2020-03-24 15:46:30 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2020-04-19 16:56:21 +0100
commit20d5fa48d333670ffbc08d387a80710be91259a0 (patch)
tree20de9a3950760c961063c0b23a348813029db69a /include
parent641dedd50c488739b56ef0f716988e646295dce4 (diff)
include: fpga: adi-axi-common.h: add version helper macros
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>
Diffstat (limited to 'include')
-rw-r--r--include/linux/fpga/adi-axi-common.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/fpga/adi-axi-common.h b/include/linux/fpga/adi-axi-common.h
index ebd4e07ae3d8..141ac3f251e6 100644
--- a/include/linux/fpga/adi-axi-common.h
+++ b/include/linux/fpga/adi-axi-common.h
@@ -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_ */