From 6cd83e4d26cb2f9d2a294c51eb5026dabb2e99a7 Mon Sep 17 00:00:00 2001 From: Sameer Pujar Date: Mon, 27 Apr 2020 13:45:19 +0530 Subject: [PATCH] nvadsp: don't use tegra-pd for kernel 5.4 onwards The usage of Tegra power-domains is deprecated from kernel-5.4 and instead generic power-domains should be used. Current driver code is common across multiple kernel versions and to maintain backward compatibility kernel version checks are added. Bug 200593718 Change-Id: Ia49c0bab0d320de2d4a3a23e7e675242f56dbff7 Signed-off-by: Sameer Pujar Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2334795 Reviewed-by: automaticguardword Reviewed-by: Mohan Kumar D Reviewed-by: Dipesh Gandhi Reviewed-by: Sharad Gupta Reviewed-by: mobile promotions GVS: Gerrit_Virtual_Submit Tested-by: mobile promotions --- drivers/platform/tegra/nvadsp/dev.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/platform/tegra/nvadsp/dev.c b/drivers/platform/tegra/nvadsp/dev.c index 4447aeb6..ead43e69 100644 --- a/drivers/platform/tegra/nvadsp/dev.c +++ b/drivers/platform/tegra/nvadsp/dev.c @@ -3,7 +3,7 @@ * * A device driver for ADSP and APE * - * Copyright (C) 2014-2019, NVIDIA Corporation. All rights reserved. + * Copyright (C) 2014-2020, NVIDIA Corporation. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and @@ -29,7 +29,10 @@ #include #include #include +#include +#if KERNEL_VERSION(5, 4, 0) > LINUX_VERSION_CODE #include +#endif #include #include #include @@ -321,7 +324,9 @@ static int __init nvadsp_probe(struct platform_device *pdev) nvadsp_drv_data = drv_data; #ifdef CONFIG_PM +#if KERNEL_VERSION(5, 4, 0) > LINUX_VERSION_CODE tegra_pd_add_device(dev); +#endif pm_runtime_enable(dev); @@ -400,7 +405,9 @@ static int nvadsp_remove(struct platform_device *pdev) nvadsp_runtime_suspend(&pdev->dev); #endif +#if KERNEL_VERSION(5, 4, 0) > LINUX_VERSION_CODE tegra_pd_remove_device(&pdev->dev); +#endif return 0; }