static ssize_t show_norm_utilization(struct device *dev, struct device_attribute *attr, char *buf) { ssize_t ret = 0; #ifdef CONFIG_EXYNOS_THERMAL struct kbase_device *kbdev; kbdev = dev_get_drvdata(dev); if (!kbdev) return -ENODEV; #ifdef CONFIG_MALI_T6XX_DVFS ret += snprintf(buf+ret, PAGE_SIZE-ret, "%d", gpu_ipa_dvfs_get_norm_utilisation(kbdev)); #else ret += snprintf(buf+ret, PAGE_SIZE-ret, "-1"); #endif if (ret < PAGE_SIZE - 1) { ret += snprintf(buf+ret, PAGE_SIZE-ret, "\n"); } else { buf[PAGE_SIZE-2] = '\n'; buf[PAGE_SIZE-1] = '\0'; ret = PAGE_SIZE-1; } #else GPU_LOG(DVFS_WARNING, "EXYNOS THERMAL build config is disabled. You can not set\n"); #endif return ret; }
static ssize_t show_norm_utilization(struct device *dev, struct device_attribute *attr, char *buf) { ssize_t ret = 0; #ifdef CONFIG_EXYNOS_THERMAL ret += snprintf(buf+ret, PAGE_SIZE-ret, "%d", gpu_ipa_dvfs_get_norm_utilisation(pkbdev)); if (ret < PAGE_SIZE - 1) { ret += snprintf(buf+ret, PAGE_SIZE-ret, "\n"); } else { buf[PAGE_SIZE-2] = '\n'; buf[PAGE_SIZE-1] = '\0'; ret = PAGE_SIZE-1; } #else GPU_LOG(DVFS_WARNING, DUMMY, 0u, 0u, "%s: EXYNOS THERMAL build config is disabled\n", __func__); #endif /* CONFIG_EXYNOS_THERMAL */ return ret; }