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

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

Merge "devfreq: add use_ab tunnable"

parents 263c564b 703ff88b
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -40,6 +40,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;
@@ -448,8 +449,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),
@@ -822,6 +825,9 @@ static DEVICE_ATTR_RW(hyst_length);
show_attr(idle_mbps);
store_attr(idle_mbps, 0U, 2000U);
static DEVICE_ATTR_RW(idle_mbps);
show_attr(use_ab);
store_attr(use_ab, 0U, 1U);
static DEVICE_ATTR_RW(use_ab);
show_list_attr(mbps_zones, NUM_MBPS_ZONES);
store_list_attr(mbps_zones, NUM_MBPS_ZONES, 0U, UINT_MAX);
static DEVICE_ATTR_RW(mbps_zones);
@@ -840,6 +846,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,
@@ -987,6 +994,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;