diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-11-29 18:48:44 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-12-01 11:38:26 -0500 |
commit | b6ed2c6d96fc6c37830b1450921f080c47b4a7bc (patch) | |
tree | 3c7891245704f674736c6736d83a444519628827 /drivers | |
parent | 3ca22f894c75b9f8eb9d28945ff7a88ebf885e36 (diff) |
gpu: nvgpu: Fix build with Tegra DVFS disabled
Avoid using Tegra DVFS APIs when it is not built in. This is done by
protecting the code using Tegra DVFS with #ifdef.
Change-Id: Ia50b77aba8a085f436891e522514bb2b5b717c4d
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1607583
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/sysfs.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/sysfs.c b/drivers/gpu/nvgpu/common/linux/sysfs.c index 053c1a12..9d2eab92 100644 --- a/drivers/gpu/nvgpu/common/linux/sysfs.c +++ b/drivers/gpu/nvgpu/common/linux/sysfs.c | |||
@@ -17,7 +17,9 @@ | |||
17 | #include <linux/device.h> | 17 | #include <linux/device.h> |
18 | #include <linux/pm_runtime.h> | 18 | #include <linux/pm_runtime.h> |
19 | #include <linux/fb.h> | 19 | #include <linux/fb.h> |
20 | #ifdef CONFIG_TEGRA_DVFS | ||
20 | #include <soc/tegra/tegra-dvfs.h> | 21 | #include <soc/tegra/tegra-dvfs.h> |
22 | #endif | ||
21 | 23 | ||
22 | #include <nvgpu/kmem.h> | 24 | #include <nvgpu/kmem.h> |
23 | #include <nvgpu/nvhost.h> | 25 | #include <nvgpu/nvhost.h> |
@@ -726,6 +728,7 @@ static ssize_t emc3d_ratio_read(struct device *dev, | |||
726 | 728 | ||
727 | static DEVICE_ATTR(emc3d_ratio, ROOTRW, emc3d_ratio_read, emc3d_ratio_store); | 729 | static DEVICE_ATTR(emc3d_ratio, ROOTRW, emc3d_ratio_read, emc3d_ratio_store); |
728 | 730 | ||
731 | #ifdef CONFIG_TEGRA_DVFS | ||
729 | static ssize_t fmax_at_vmin_safe_read(struct device *dev, | 732 | static ssize_t fmax_at_vmin_safe_read(struct device *dev, |
730 | struct device_attribute *attr, char *buf) | 733 | struct device_attribute *attr, char *buf) |
731 | { | 734 | { |
@@ -739,6 +742,7 @@ static ssize_t fmax_at_vmin_safe_read(struct device *dev, | |||
739 | } | 742 | } |
740 | 743 | ||
741 | static DEVICE_ATTR(fmax_at_vmin_safe, S_IRUGO, fmax_at_vmin_safe_read, NULL); | 744 | static DEVICE_ATTR(fmax_at_vmin_safe, S_IRUGO, fmax_at_vmin_safe_read, NULL); |
745 | #endif | ||
742 | 746 | ||
743 | #ifdef CONFIG_PM | 747 | #ifdef CONFIG_PM |
744 | static ssize_t force_idle_store(struct device *dev, | 748 | static ssize_t force_idle_store(struct device *dev, |
@@ -1014,7 +1018,9 @@ void nvgpu_remove_sysfs(struct device *dev) | |||
1014 | device_remove_file(dev, &dev_attr_elpg_enable); | 1018 | device_remove_file(dev, &dev_attr_elpg_enable); |
1015 | device_remove_file(dev, &dev_attr_mscg_enable); | 1019 | device_remove_file(dev, &dev_attr_mscg_enable); |
1016 | device_remove_file(dev, &dev_attr_emc3d_ratio); | 1020 | device_remove_file(dev, &dev_attr_emc3d_ratio); |
1021 | #ifdef CONFIG_TEGRA_DVFS | ||
1017 | device_remove_file(dev, &dev_attr_fmax_at_vmin_safe); | 1022 | device_remove_file(dev, &dev_attr_fmax_at_vmin_safe); |
1023 | #endif | ||
1018 | device_remove_file(dev, &dev_attr_counters); | 1024 | device_remove_file(dev, &dev_attr_counters); |
1019 | device_remove_file(dev, &dev_attr_counters_reset); | 1025 | device_remove_file(dev, &dev_attr_counters_reset); |
1020 | device_remove_file(dev, &dev_attr_load); | 1026 | device_remove_file(dev, &dev_attr_load); |
@@ -1061,7 +1067,9 @@ int nvgpu_create_sysfs(struct device *dev) | |||
1061 | error |= device_create_file(dev, &dev_attr_elpg_enable); | 1067 | error |= device_create_file(dev, &dev_attr_elpg_enable); |
1062 | error |= device_create_file(dev, &dev_attr_mscg_enable); | 1068 | error |= device_create_file(dev, &dev_attr_mscg_enable); |
1063 | error |= device_create_file(dev, &dev_attr_emc3d_ratio); | 1069 | error |= device_create_file(dev, &dev_attr_emc3d_ratio); |
1070 | #ifdef CONFIG_TEGRA_DVFS | ||
1064 | error |= device_create_file(dev, &dev_attr_fmax_at_vmin_safe); | 1071 | error |= device_create_file(dev, &dev_attr_fmax_at_vmin_safe); |
1072 | #endif | ||
1065 | error |= device_create_file(dev, &dev_attr_counters); | 1073 | error |= device_create_file(dev, &dev_attr_counters); |
1066 | error |= device_create_file(dev, &dev_attr_counters_reset); | 1074 | error |= device_create_file(dev, &dev_attr_counters_reset); |
1067 | error |= device_create_file(dev, &dev_attr_load); | 1075 | error |= device_create_file(dev, &dev_attr_load); |