diff options
Diffstat (limited to 'drivers/cpufreq/cpufreq.c')
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 613314851ecc..64926aa990db 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -601,6 +601,31 @@ static ssize_t show_affected_cpus (struct cpufreq_policy * policy, char *buf) | |||
601 | return i; | 601 | return i; |
602 | } | 602 | } |
603 | 603 | ||
604 | static ssize_t store_scaling_setspeed(struct cpufreq_policy *policy, | ||
605 | const char *buf, size_t count) | ||
606 | { | ||
607 | unsigned int freq = 0; | ||
608 | unsigned int ret; | ||
609 | |||
610 | if (!policy->governor->store_setspeed) | ||
611 | return -EINVAL; | ||
612 | |||
613 | ret = sscanf(buf, "%u", &freq); | ||
614 | if (ret != 1) | ||
615 | return -EINVAL; | ||
616 | |||
617 | policy->governor->store_setspeed(policy, freq); | ||
618 | |||
619 | return count; | ||
620 | } | ||
621 | |||
622 | static ssize_t show_scaling_setspeed(struct cpufreq_policy *policy, char *buf) | ||
623 | { | ||
624 | if (!policy->governor->show_setspeed) | ||
625 | return sprintf(buf, "<unsupported>\n"); | ||
626 | |||
627 | return policy->governor->show_setspeed(policy, buf); | ||
628 | } | ||
604 | 629 | ||
605 | #define define_one_ro(_name) \ | 630 | #define define_one_ro(_name) \ |
606 | static struct freq_attr _name = \ | 631 | static struct freq_attr _name = \ |
@@ -624,6 +649,7 @@ define_one_ro(affected_cpus); | |||
624 | define_one_rw(scaling_min_freq); | 649 | define_one_rw(scaling_min_freq); |
625 | define_one_rw(scaling_max_freq); | 650 | define_one_rw(scaling_max_freq); |
626 | define_one_rw(scaling_governor); | 651 | define_one_rw(scaling_governor); |
652 | define_one_rw(scaling_setspeed); | ||
627 | 653 | ||
628 | static struct attribute * default_attrs[] = { | 654 | static struct attribute * default_attrs[] = { |
629 | &cpuinfo_min_freq.attr, | 655 | &cpuinfo_min_freq.attr, |
@@ -634,6 +660,7 @@ static struct attribute * default_attrs[] = { | |||
634 | &scaling_governor.attr, | 660 | &scaling_governor.attr, |
635 | &scaling_driver.attr, | 661 | &scaling_driver.attr, |
636 | &scaling_available_governors.attr, | 662 | &scaling_available_governors.attr, |
663 | &scaling_setspeed.attr, | ||
637 | NULL | 664 | NULL |
638 | }; | 665 | }; |
639 | 666 | ||