diff options
author | Christian Pointner <equinox@helsinki.at> | 2024-05-10 18:26:46 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2024-05-10 18:26:46 (GMT) |
commit | 627f7d488817e308d6f3a92fd9a877723ac7ae1d (patch) | |
tree | 554a3c53c90b20da5bd0da0c8da67a9b169bd10f /snd-alpx/snd_alpx_xdma.c |
import snd-alpx V3.4.3
Diffstat (limited to 'snd-alpx/snd_alpx_xdma.c')
-rw-r--r-- | snd-alpx/snd_alpx_xdma.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/snd-alpx/snd_alpx_xdma.c b/snd-alpx/snd_alpx_xdma.c new file mode 100644 index 0000000..2941793 --- /dev/null +++ b/snd-alpx/snd_alpx_xdma.c @@ -0,0 +1,49 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* +* Support for Digigram AlpX PCI-e boards +* +* Copyright (c) 2024 Digigram Digital (info@digigram.com) +*/ + +#include <linux/version.h> +#include <linux/module.h> + + +/* Defined an exported symbol to allow dependency use */ +const char* SND_ALPX_XDMA_DEP(void) +{ + return "snd_alpx_xdma support"; +} +EXPORT_SYMBOL(SND_ALPX_XDMA_DEP); + + +/* + * Use the in-kernel driver if enabled and recent enough. Otherwise, use the + * mainline kernel driver backported locally and improved with cyclic transfers + * support (6.7 code) + */ +#if IS_ENABLED(CONFIG_XILINX_XDMA) && (KERNEL_VERSION(6, 7, 0) <= LINUX_VERSION_CODE) + /* EMPTY MODULE !!! */ + #include "alpx_version.h" + #warning "Use Kernel's XDMA" + + /* MODULE meta required for build only */ + MODULE_DESCRIPTION("AlpX XDMA support module placeholder"); + MODULE_AUTHOR("Digigram Digital"); + MODULE_VERSION("ALPX_MODULE_VERSION"); + MODULE_LICENSE("GPL"); + +#else +/* Need our module BUT with the right version !! */ + #if KERNEL_VERSION(6, 3, 0) > LINUX_VERSION_CODE + + #warning 6.2 + #include "core/generic/6.2/xilinx/xdma.c" + + #elif KERNEL_VERSION(6, 7, 0) > LINUX_VERSION_CODE + + #warning 6.3 + #include "core/generic/6.3/xilinx/xdma.c" + + #endif +#endif /* IS_ENABLED(CONFIG_XILINX_XDMA) && (KERNEL_VERSION(6, 7, 0) >= LINUX_VERSION_CODE) */ |