driver: update to build with old and 6.5+ kernel version
Apply minor changes and adjustments from mainline Linux kernel driver to allow standalone build with old and new kernel versions. The ifdefs not acceptable into mainline are required to allow build with older and new kernels from the single sources.
Code update is done on the old IP core version the first to check compatibility with all versions which are supported by mainline sources.