Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 336783
b: refs/heads/master
c: 50a5b33
h: refs/heads/master
i:
  336781: 710e6d5
  336779: b26e2f5
  336775: 0f59d9a
  336767: 2bedc83
v: v3
  • Loading branch information
Nishanth Menon authored and MyungJoo Ham committed Nov 20, 2012
1 parent d1f3204 commit 306e3ca
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0359d1afe4013d1a216908b6be4c6695a1db6fd6
refs/heads/master: 50a5b33e0159f8783ef617cdb9d5fbb6a3955b6f
7 changes: 7 additions & 0 deletions trunk/Documentation/ABI/testing/sysfs-class-devfreq
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,10 @@ Description:
the available frequencies of the corresponding devfreq object.
This is a snapshot of available frequencies and not limited
by the min/max frequency restrictions.

What: /sys/class/devfreq/.../available_governors
Date: October 2012
Contact: Nishanth Menon <nm@ti.com>
Description:
The /sys/class/devfreq/.../available_governors shows
currently available governors in the system.
22 changes: 22 additions & 0 deletions trunk/drivers/devfreq/devfreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,27 @@ static ssize_t store_governor(struct device *dev, struct device_attribute *attr,
ret = count;
return ret;
}
static ssize_t show_available_governors(struct device *d,
struct device_attribute *attr,
char *buf)
{
struct devfreq_governor *tmp_governor;
ssize_t count = 0;

mutex_lock(&devfreq_list_lock);
list_for_each_entry(tmp_governor, &devfreq_governor_list, node)
count += scnprintf(&buf[count], (PAGE_SIZE - count - 2),
"%s ", tmp_governor->name);
mutex_unlock(&devfreq_list_lock);

/* Truncate the trailing space */
if (count)
count--;

count += sprintf(&buf[count], "\n");

return count;
}

static ssize_t show_freq(struct device *dev,
struct device_attribute *attr, char *buf)
Expand Down Expand Up @@ -917,6 +938,7 @@ static ssize_t show_trans_table(struct device *dev, struct device_attribute *att

static struct device_attribute devfreq_attrs[] = {
__ATTR(governor, S_IRUGO | S_IWUSR, show_governor, store_governor),
__ATTR(available_governors, S_IRUGO, show_available_governors, NULL),
__ATTR(cur_freq, S_IRUGO, show_freq, NULL),
__ATTR(available_frequencies, S_IRUGO, show_available_freqs, NULL),
__ATTR(target_freq, S_IRUGO, show_target_freq, NULL),
Expand Down

0 comments on commit 306e3ca

Please sign in to comment.