Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d480a9b0 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: kgsl: Show max gpu temperature"

parents b8d4dbb8 4ee25aa2
Loading
Loading
Loading
Loading
+20 −20
Original line number Diff line number Diff line
@@ -1007,23 +1007,27 @@ static ssize_t freq_table_mhz_show(struct device *dev,
static ssize_t _gpu_tmu_show(struct kgsl_device *device,
					char *buf)
{
	struct kgsl_pwrctrl *pwr = &device->pwrctrl;
	struct device *dev;
	struct thermal_zone_device *thermal_dev;
	int ret, temperature = 0;
	int temperature = 0, max_temp = 0;
	const char *name;
	struct property *prop;

	if (!pwr->tzone_name)
		return 0;
	dev = &device->pdev->dev;

	thermal_dev = thermal_zone_get_zone_by_name((char *)pwr->tzone_name);
	if (thermal_dev == NULL)
		return 0;
	of_property_for_each_string(dev->of_node, "qcom,tzone-names", prop, name) {
		thermal_dev = thermal_zone_get_zone_by_name(name);
		if (IS_ERR(thermal_dev))
			continue;

	ret = thermal_zone_get_temp(thermal_dev, &temperature);
	if (ret)
		return 0;
		if (thermal_zone_get_temp(thermal_dev, &temperature))
			continue;

		max_temp = max(temperature, max_temp);
	}

	return scnprintf(buf, PAGE_SIZE, "%d\n",
			temperature);
			max_temp);
}

static ssize_t temp_show(struct device *dev,
@@ -1127,15 +1131,15 @@ static const struct attribute *pwrctrl_attr_list[] = {
	NULL,
};

static GPU_SYSFS_ATTR(gpu_model, 0200, _gpu_model_show, NULL);
static GPU_SYSFS_ATTR(gpu_busy, 0200, _gpu_busy_show, NULL);
static GPU_SYSFS_ATTR(gpu_model, 0444, _gpu_model_show, NULL);
static GPU_SYSFS_ATTR(gpu_busy, 0444, _gpu_busy_show, NULL);
static GPU_SYSFS_ATTR(gpu_min_clock, 0644, _min_clock_mhz_show,
		_min_clock_mhz_store);
static GPU_SYSFS_ATTR(gpu_max_clock, 0644, _max_clock_mhz_show,
		_max_clock_mhz_store);
static GPU_SYSFS_ATTR(gpu_clock, 0200, _clock_mhz_show, NULL);
static GPU_SYSFS_ATTR(gpu_freq_table, 0200, _freq_table_mhz_show, NULL);
static GPU_SYSFS_ATTR(gpu_tmu, 0200, _gpu_tmu_show, NULL);
static GPU_SYSFS_ATTR(gpu_clock, 0444, _clock_mhz_show, NULL);
static GPU_SYSFS_ATTR(gpu_freq_table, 0444, _freq_table_mhz_show, NULL);
static GPU_SYSFS_ATTR(gpu_tmu, 0444, _gpu_tmu_show, NULL);

static const struct attribute *gpu_sysfs_attr_list[] = {
	&gpu_sysfs_attr_gpu_model.attr,
@@ -1574,10 +1578,6 @@ int kgsl_pwrctrl_init(struct kgsl_device *device)

	timer_setup(&pwr->minbw_timer, kgsl_minbw_timer, 0);

	/* temperature sensor name */
	of_property_read_string(pdev->dev.of_node, "qcom,tzone-name",
		&pwr->tzone_name);

	return 0;
}

+0 −2
Original line number Diff line number Diff line
@@ -110,7 +110,6 @@ struct kgsl_pwrlevel {
 * higher priority thread
 * isense_clk_indx - index of isense clock, 0 if no isense
 * isense_clk_on_level - isense clock rate is XO rate below this level.
 * tzone_name - pointer to thermal zone name of GPU temperature sensor
 */

struct kgsl_pwrctrl {
@@ -158,7 +157,6 @@ struct kgsl_pwrctrl {
	bool superfast;
	unsigned int gpu_bimc_int_clk_freq;
	bool gpu_bimc_interface_enabled;
	const char *tzone_name;
	/** @icc_path: Interconnect path for the GPU (if applicable) */
	struct icc_path *icc_path;
	/** cur_ab: The last ab voted by the driver */