[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200304133723.1263-3-alexandru.ardelean@analog.com>
Date: Wed, 4 Mar 2020 15:37:17 +0200
From: Alexandru Ardelean <alexandru.ardelean@...log.com>
To: <linux-iio@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<devicetree@...r.kernel.org>
CC: <jic23@...nel.org>, <robh+dt@...nel.org>,
Alexandru Ardelean <alexandru.ardelean@...log.com>
Subject: [PATCH v5 2/8] 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.
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@...log.com>
---
include/linux/fpga/adi-axi-common.h | 4 ++++
1 file changed, 4 insertions(+)
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_ */
--
2.20.1
Powered by blists - more mailing lists