All pastes #38353 Raw Edit

Anonymous

public text v1 · immutable
#38353 ·published 2006-01-24 14:22 UTC
rendered paste body
#ifdef CONFIG_CPU_FREQ
#include <linux/cpufreq.h>

static int rt3000_cpufreq_notifier(struct notifier_block *nb, unsigned long val, void *data)
{
        struct cpufreq_freqs *freqs = data;

        switch (val) {
        case CPUFREQ_PRECHANGE:
                //printk("CPUFREQ_PRECHANGE: %d -> %d\n", freqs->old, freqs->new);
                if (freqs->new >= 300000) {
                        MN_CPLD_PWR |= RT3000_PWR_CORE_HIGH;
                        // printk("MN_CPLD_PWR |= RT3000_PWR_CORE_HIGH\n");
                }
                break;
        case CPUFREQ_POSTCHANGE:
                //printk("CPUFREQ_POSTCHANGE: %d -> %d\n", freqs->old, freqs->new);
                if (freqs->new < 300000) {
                        MN_CPLD_PWR &= ~RT3000_PWR_CORE_HIGH;
                        // printk("MN_CPLD_PWR &= ~RT3000_PWR_CORE_HIGH\n");
                }
                break;
        }
        return 0;
}

static struct notifier_block rt3000_cpufreq_notifier_block = {
        .notifier_call  = rt3000_cpufreq_notifier,
};
#endif