summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-10-17 13:33:59 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-10-17 13:33:59 -0700
commita18f0e81de0ee326e142b69db0b0d1d50edd64d7 (patch)
treec9779fba554246bb732b171b5df9f1c7b0ff8dbf
parent3993230d5c94accec096c28a3643529d27656982 (diff)
parent626da03683087ad2980df18dba9e3751b5a70d80 (diff)
Merge "PM / devfreq: memlat: add device attribute to show core to device bw map"
-rw-r--r--drivers/devfreq/governor_memlat.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/devfreq/governor_memlat.c b/drivers/devfreq/governor_memlat.c
index 010f9defe33e..a3c826e152e1 100644
--- a/drivers/devfreq/governor_memlat.c
+++ b/drivers/devfreq/governor_memlat.c
@@ -81,6 +81,29 @@ show_attr(__attr) \
store_attr(__attr, min, max) \
static DEVICE_ATTR(__attr, 0644, show_##__attr, store_##__attr)
+static ssize_t show_map(struct device *dev, struct device_attribute *attr,
+ char *buf)
+{
+ struct devfreq *df = to_devfreq(dev);
+ struct memlat_node *n = df->data;
+ struct core_dev_map *map = n->hw->freq_map;
+ unsigned int cnt = 0;
+
+ cnt += snprintf(buf, PAGE_SIZE, "Core freq (MHz)\tDevice BW\n");
+
+ while (map->core_mhz && cnt < PAGE_SIZE) {
+ cnt += snprintf(buf + cnt, PAGE_SIZE - cnt, "%15u\t%9u\n",
+ map->core_mhz, map->target_freq);
+ map++;
+ }
+ if (cnt < PAGE_SIZE)
+ cnt += snprintf(buf + cnt, PAGE_SIZE - cnt, "\n");
+
+ return cnt;
+}
+
+static DEVICE_ATTR(freq_map, 0444, show_map, NULL);
+
static unsigned long core_to_dev_freq(struct memlat_node *node,
unsigned long coref)
{
@@ -247,6 +270,7 @@ gov_attr(ratio_ceil, 1U, 10000U);
static struct attribute *dev_attr[] = {
&dev_attr_ratio_ceil.attr,
+ &dev_attr_freq_map.attr,
NULL,
};