From ded768ff7766d927dacdb11c196ffb7dff26d454 Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Sun, 23 Oct 2022 10:46:50 +0100 Subject: [PATCH] sound: tegra-safety: Fix build for Linux v5.17+ Starting with Linux kernel v5.17, the 'slave_id' member is removed from the DMA Engine 'dma_slave_config' structure. Building the Tegra Safety Audio driver against Linux v5.17, v5.18 and v5.19 breaks because this filed is not defined. There are already comments in the driver to not used the 'slave_id' field and move to using device-tree to get this information. For now, fix the build by not using the 'slave_id' field for Linux v5.17+. Bug 3820317 Bug 3735757 Change-Id: I2fb8317604b0a797f4e1b22a53994ec0085ea584 Signed-off-by: Jon Hunter Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2796900 Reviewed-by: Laxman Dewangan GVS: Gerrit_Virtual_Submit --- Makefile | 2 -- sound/tegra-safety-audio/sound-card.c | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 7d9fd627..809ff3d2 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,4 @@ obj-m += drivers/ obj-m += sound/soc/tegra/ -ifeq ($(shell test $$VERSION -lt 6; echo $$?),0) obj-m += sound/tegra-safety-audio/ -endif diff --git a/sound/tegra-safety-audio/sound-card.c b/sound/tegra-safety-audio/sound-card.c index 1fb038dd..bd19afc7 100644 --- a/sound/tegra-safety-audio/sound-card.c +++ b/sound/tegra-safety-audio/sound-card.c @@ -13,6 +13,7 @@ #include #include #include +#include #include "tegra_i2s.h" @@ -455,7 +456,10 @@ static int gpcdma_hw_params(struct snd_pcm_substream *substream, slave_config.src_maxburst = 2; } +#if (KERNEL_VERSION(5, 17, 0) > LINUX_VERSION_CODE) + //TODO: Read from DT later on slave_config.slave_id = dma_data->req_sel; +#endif ret = dmaengine_slave_config(chan, &slave_config); if (ret < 0) {