}
static DEVICE_ATTR_RO(trans_stat);
+static ssize_t load_show(struct device *dev, struct device_attribute *attr,
+ char *buf)
+{
+ int err;
+ struct devfreq *devfreq = to_devfreq(dev);
+ struct devfreq_dev_status stat = devfreq->last_status;
+ unsigned long freq;
+ ssize_t len;
+
+ err = devfreq_update_stats(devfreq);
+ if (err)
+ return err;
+
+ if (stat.total_time < stat.busy_time) {
+ err = devfreq_update_stats(devfreq);
+ if (err)
+ return err;
+ };
+
+ if (!stat.total_time)
+ return 0;
+
+ len = sprintf(buf, "%lu", stat.busy_time * 100 / stat.total_time);
+
+ if (devfreq->profile->get_cur_freq &&
+ !devfreq->profile->get_cur_freq(devfreq->dev.parent, &freq))
+ len += sprintf(buf + len, "@%luHz\n", freq);
+ else
+ len += sprintf(buf + len, "@%luHz\n", devfreq->previous_freq);
+
+ return len;
+}
+static DEVICE_ATTR_RO(load);
+
static struct attribute *devfreq_attrs[] = {
&dev_attr_governor.attr,
&dev_attr_available_governors.attr,
&dev_attr_min_freq.attr,
&dev_attr_max_freq.attr,
&dev_attr_trans_stat.attr,
+ &dev_attr_load.attr,
NULL,
};
ATTRIBUTE_GROUPS(devfreq);