Lines Matching refs:profile
125 unsigned long *freq_table = devfreq->profile->freq_table;
135 if (freq_table[0] < freq_table[devfreq->profile->max_state - 1]) {
137 *max_freq = freq_table[devfreq->profile->max_state - 1];
139 *min_freq = freq_table[devfreq->profile->max_state - 1];
169 for (lev = 0; lev < devfreq->profile->max_state; lev++) {
170 if (freq == devfreq->profile->freq_table[lev]) {
180 struct devfreq_dev_profile *profile = devfreq->profile;
191 profile->max_state = count;
192 profile->freq_table =
193 devm_kcalloc(devfreq->dev.parent, profile->max_state, sizeof(*profile->freq_table), GFP_KERNEL);
194 if (!profile->freq_table) {
195 profile->max_state = 0;
199 for (i = 0, freq = 0; i < profile->max_state; i++, freq++) {
202 devm_kfree(devfreq->dev.parent, profile->freq_table);
203 profile->max_state = 0;
207 profile->freq_table[i] = freq;
246 devfreq->stats.trans_table[(prev_lev * devfreq->profile->max_state) + lev]++;
355 if (devfreq->profile->get_cur_freq) {
356 devfreq->profile->get_cur_freq(devfreq->dev.parent, &cur_freq);
365 err = devfreq->profile->target(devfreq->dev.parent, &new_freq, flags);
445 queue_delayed_work(devfreq_wq, &devfreq->work, msecs_to_jiffies(devfreq->profile->polling_ms));
466 switch (devfreq->profile->timer) {
477 if (devfreq->profile->polling_ms) {
478 queue_delayed_work(devfreq_wq, &devfreq->work, msecs_to_jiffies(devfreq->profile->polling_ms));
554 if (!delayed_work_pending(&devfreq->work) && devfreq->profile->polling_ms) {
555 queue_delayed_work(devfreq_wq, &devfreq->work, msecs_to_jiffies(devfreq->profile->polling_ms));
562 if (devfreq->profile->get_cur_freq && !devfreq->profile->get_cur_freq(devfreq->dev.parent, &freq)) {
581 unsigned int cur_delay = devfreq->profile->polling_ms;
585 devfreq->profile->polling_ms = new_delay;
604 queue_delayed_work(devfreq_wq, &devfreq->work, msecs_to_jiffies(devfreq->profile->polling_ms));
614 queue_delayed_work(devfreq_wq, &devfreq->work, msecs_to_jiffies(devfreq->profile->polling_ms));
733 if (devfreq->profile->exit) {
734 devfreq->profile->exit(devfreq->dev.parent);
765 * @profile: device-specific profile to run devfreq.
770 struct devfreq *devfreq_add_device(struct device *dev, struct devfreq_dev_profile *profile, const char *governor_name,
777 if (!dev || !profile || !governor_name) {
803 devfreq->profile = profile;
805 devfreq->previous_freq = profile->initial_freq;
806 devfreq->last_status.current_frequency = profile->initial_freq;
810 if (devfreq->profile->timer < 0 || devfreq->profile->timer >= DEVFREQ_TIMER_NUM) {
816 if (!devfreq->profile->max_state && !devfreq->profile->freq_table) {
851 &devfreq->dev, array3_size(sizeof(unsigned int), devfreq->profile->max_state, devfreq->profile->max_state),
860 devm_kcalloc(&devfreq->dev, devfreq->profile->max_state, sizeof(*devfreq->stats.time_in_state), GFP_KERNEL);
949 * @profile: device-specific profile to run devfreq.
958 struct devfreq *devm_devfreq_add_device(struct device *dev, struct devfreq_dev_profile *profile,
968 devfreq = devfreq_add_device(dev, profile, governor_name, data);
1426 if (!df->profile) {
1430 if (df->profile->get_cur_freq && !df->profile->get_cur_freq(df->dev.parent, &freq)) {
1450 if (!df->profile) {
1454 return sprintf(buf, "%d\n", df->profile->polling_ms);
1582 if (!df->profile) {
1588 for (i = 0; i < df->profile->max_state; i++) {
1589 count += scnprintf(&buf[count], (PAGE_SIZE - count - 0x2), "%lu ", df->profile->freq_table[i]);
1611 if (!df->profile) {
1614 max_state = df->profile->max_state;
1630 len += sprintf(buf + len, "%10lu", df->profile->freq_table[i]);
1636 if (df->profile->freq_table[i] == df->previous_freq) {
1641 len += sprintf(buf + len, "%10lu:", df->profile->freq_table[i]);
1658 if (!df->profile) {
1662 if (df->profile->max_state == 0) {
1672 memset(df->stats.time_in_state, 0, (df->profile->max_state * sizeof(*df->stats.time_in_state)));
1673 memset(df->stats.trans_table, 0, array3_size(sizeof(unsigned int), df->profile->max_state, df->profile->max_state));
1686 if (!df->profile) {
1690 return sprintf(buf, "%s\n", timer_name[df->profile->timer]);
1700 if (!df->governor || !df->profile) {
1721 if (df->profile->timer == timer) {
1727 df->profile->timer = timer;
1771 if (devfreq->profile->get_cur_freq && !devfreq->profile->get_cur_freq(devfreq->dev.parent, &freq)) {
1841 polling_ms = devfreq->profile->polling_ms;
1842 timer = devfreq->profile->timer;