summaryrefslogtreecommitdiff
path: root/include/linux/fpga
diff options
context:
space:
mode:
authorAlexandru Ardelean <alexandru.ardelean@analog.com>2020-03-24 16:46:30 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2020-04-19 18:56:21 +0300
commit20d5fa48d333670ffbc08d387a80710be91259a0 (patch)
tree20de9a3950760c961063c0b23a348813029db69a /include/linux/fpga
parent641dedd50c488739b56ef0f716988e646295dce4 (diff)
downloadlinux-20d5fa48d333670ffbc08d387a80710be91259a0.tar.xz
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/linux/fpga')
-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_ */