Skip to content

Commit

Permalink
include: fpga: adi-axi-common.h: add version helper macros
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alexandru Ardelean authored and Jonathan Cameron committed Apr 19, 2020
1 parent 641dedd commit 20d5fa4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/linux/fpga/adi-axi-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_ */

0 comments on commit 20d5fa4

Please sign in to comment.