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

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

Merge "devfreq: add use_ab tunnable"

parents 0b93ca3c ff6cf9dc
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ struct hwmon_node {
	unsigned int hyst_trigger_count;
	unsigned int hyst_length;
	unsigned int idle_mbps;
	unsigned int use_ab;
	unsigned int mbps_zones[NUM_MBPS_ZONES];

	unsigned long prev_ab;
@@ -467,8 +468,10 @@ static unsigned long get_bw_and_set_irq(struct hwmon_node *node,
	}

	node->prev_ab = new_bw;
	if (ab)
	if (ab && node->use_ab)
		*ab = roundup(new_bw, node->bw_step);
	else if (ab)
		*ab = 0;

	*freq = (new_bw * 100) / io_percent;
	trace_bw_hwmon_update(dev_name(node->hw->df->dev.parent),
@@ -772,6 +775,7 @@ gov_attr(hist_memory, 0U, 90U);
gov_attr(hyst_trigger_count, 0U, 90U);
gov_attr(hyst_length, 0U, 90U);
gov_attr(idle_mbps, 0U, 2000U);
gov_attr(use_ab, 0U, 1U);
gov_list_attr(mbps_zones, NUM_MBPS_ZONES, 0U, UINT_MAX);

static struct attribute *dev_attr[] = {
@@ -788,6 +792,7 @@ static struct attribute *dev_attr[] = {
	&dev_attr_hyst_trigger_count.attr,
	&dev_attr_hyst_length.attr,
	&dev_attr_idle_mbps.attr,
	&dev_attr_use_ab.attr,
	&dev_attr_mbps_zones.attr,
	&dev_attr_throttle_adj.attr,
	NULL,
@@ -931,6 +936,7 @@ int register_bw_hwmon(struct device *dev, struct bw_hwmon *hwmon)
	node->hyst_trigger_count = 3;
	node->hyst_length = 0;
	node->idle_mbps = 400;
	node->use_ab = 1;
	node->mbps_zones[0] = 0;
	node->hw = hwmon;