From 56d80b9a47d11fbb8c47e659632cd6e76d50bf7f Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Thu, 6 Jan 2022 13:08:38 +0000 Subject: [PATCH] video: tegra: Migrate to fuse helpers The fuse function tegra_get_sku_id() does not exist in upstream and so when building downstream drivers against an upstream kernel, the build fails. The tegra_get_sku_id() calls the function tegra_fuse_readl() which is supported in upstream and exported so can be used by external kernel modules. The implementation of the tegra_get_sku_id() has been moved to the header file 'fuse-helpers.h' that can be used by drivers and allow drivers to be built as external modules. Therefore, migrate drivers to use this implementation so we can move the implementation from the downstream kernel. Bug 2444929 Change-Id: I5a71044a11b63becc726784b9afb31c6384cb651 Signed-off-by: Jon Hunter Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2653442 Reviewed-by: Bibek Basu Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2894845 Reviewed-by: svcacv Reviewed-by: Laxman Dewangan GVS: Gerrit_Virtual_Submit Tested-by: Laxman Dewangan --- include/soc/tegra/fuse-helper.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/include/soc/tegra/fuse-helper.h b/include/soc/tegra/fuse-helper.h index fafbb83c..fde88999 100644 --- a/include/soc/tegra/fuse-helper.h +++ b/include/soc/tegra/fuse-helper.h @@ -5,10 +5,18 @@ #include -#ifdef CONFIG_TEGRA_FUSE_UPSTREAM - #define FUSE_SKU_INFO 0x10 +static inline u32 tegra_get_sku_id(void) +{ + if (!tegra_sku_info.sku_id) + tegra_fuse_readl(FUSE_SKU_INFO, &tegra_sku_info.sku_id); + + return tegra_sku_info.sku_id; +} + +#ifdef CONFIG_TEGRA_FUSE_UPSTREAM + /* * For upstream the following functions to determine if the * platform is silicon and simulator are not supported and @@ -24,12 +32,4 @@ static inline bool tegra_platform_is_sim(void) return false; } -static inline u32 tegra_get_sku_id(void) -{ - if (!tegra_sku_info.sku_id) - tegra_fuse_readl(FUSE_SKU_INFO, &tegra_sku_info.sku_id); - - return tegra_sku_info.sku_id; -} - #endif /* CONFIG_TEGRA_FUSE_UPSTREAM */