Hi Nuno, On Thu, Sep 26, 2019 at 12:39:23PM +0200, Nuno Sá wrote: > Add commom macros to "parse" ADI HDL cores version, in terms of > major, minor and patch. > > Signed-off-by: Nuno Sá <nuno.sa@xxxxxxxxxx> > --- > 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 7fc95d5c95bb..5bc5603e6bc8 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.23.0 > While implemented in an FPGA I'm not sure if this needs to go into includelinux/fpga/. I'd suggest to add this to the actual driver for now, and once you have multiple users you can find a common location. Cheers, Moritz