Lines Matching refs:df
1388 struct devfreq *df = to_devfreq(dev); in name_show() local
1389 return sprintf(buf, "%s\n", dev_name(df->dev.parent)); in name_show()
1396 struct devfreq *df = to_devfreq(dev); in governor_show() local
1398 if (!df->governor) in governor_show()
1401 return sprintf(buf, "%s\n", df->governor->name); in governor_show()
1407 struct devfreq *df = to_devfreq(dev); in governor_store() local
1412 if (!df->governor) in governor_store()
1425 if (df->governor == governor) { in governor_store()
1428 } else if (IS_SUPPORTED_FLAG(df->governor->flags, IMMUTABLE) in governor_store()
1438 ret = df->governor->event_handler(df, DEVFREQ_GOV_STOP, NULL); in governor_store()
1441 __func__, df->governor->name, ret); in governor_store()
1444 remove_sysfs_files(df, df->governor); in governor_store()
1450 prev_governor = df->governor; in governor_store()
1451 df->governor = governor; in governor_store()
1452 ret = df->governor->event_handler(df, DEVFREQ_GOV_START, NULL); in governor_store()
1455 __func__, df->governor->name, ret); in governor_store()
1458 df->governor = prev_governor; in governor_store()
1459 ret = df->governor->event_handler(df, DEVFREQ_GOV_START, NULL); in governor_store()
1464 df->governor = NULL; in governor_store()
1473 create_sysfs_files(df, df->governor); in governor_store()
1488 struct devfreq *df = to_devfreq(d); in available_governors_show() local
1491 if (!df->governor) in available_governors_show()
1500 if (IS_SUPPORTED_FLAG(df->governor->flags, IMMUTABLE)) { in available_governors_show()
1502 "%s ", df->governor->name); in available_governors_show()
1534 struct devfreq *df = to_devfreq(dev); in cur_freq_show() local
1536 if (!df->profile) in cur_freq_show()
1539 if (df->profile->get_cur_freq && in cur_freq_show()
1540 !df->profile->get_cur_freq(df->dev.parent, &freq)) in cur_freq_show()
1543 return sprintf(buf, "%lu\n", df->previous_freq); in cur_freq_show()
1550 struct devfreq *df = to_devfreq(dev); in target_freq_show() local
1552 return sprintf(buf, "%lu\n", df->previous_freq); in target_freq_show()
1559 struct devfreq *df = to_devfreq(dev); in min_freq_store() local
1567 if (!dev_pm_qos_request_active(&df->user_min_freq_req)) in min_freq_store()
1575 ret = dev_pm_qos_update_request(&df->user_min_freq_req, in min_freq_store()
1586 struct devfreq *df = to_devfreq(dev); in min_freq_show() local
1589 mutex_lock(&df->lock); in min_freq_show()
1590 get_freq_range(df, &min_freq, &max_freq); in min_freq_show()
1591 mutex_unlock(&df->lock); in min_freq_show()
1600 struct devfreq *df = to_devfreq(dev); in max_freq_store() local
1608 if (!dev_pm_qos_request_active(&df->user_max_freq_req)) in max_freq_store()
1630 ret = dev_pm_qos_update_request(&df->user_max_freq_req, value); in max_freq_store()
1640 struct devfreq *df = to_devfreq(dev); in max_freq_show() local
1643 mutex_lock(&df->lock); in max_freq_show()
1644 get_freq_range(df, &min_freq, &max_freq); in max_freq_show()
1645 mutex_unlock(&df->lock); in max_freq_show()
1655 struct devfreq *df = to_devfreq(d); in available_frequencies_show() local
1659 if (!df->profile) in available_frequencies_show()
1662 mutex_lock(&df->lock); in available_frequencies_show()
1664 for (i = 0; i < df->profile->max_state; i++) in available_frequencies_show()
1666 "%lu ", df->profile->freq_table[i]); in available_frequencies_show()
1668 mutex_unlock(&df->lock); in available_frequencies_show()
1682 struct devfreq *df = to_devfreq(dev); in trans_stat_show() local
1687 if (!df->profile) in trans_stat_show()
1689 max_state = df->profile->max_state; in trans_stat_show()
1694 mutex_lock(&df->lock); in trans_stat_show()
1695 if (!df->stop_polling && in trans_stat_show()
1696 devfreq_update_status(df, df->previous_freq)) { in trans_stat_show()
1697 mutex_unlock(&df->lock); in trans_stat_show()
1700 mutex_unlock(&df->lock); in trans_stat_show()
1706 df->profile->freq_table[i]); in trans_stat_show()
1711 if (df->profile->freq_table[i] in trans_stat_show()
1712 == df->previous_freq) { in trans_stat_show()
1718 df->profile->freq_table[i]); in trans_stat_show()
1721 df->stats.trans_table[(i * max_state) + j]); in trans_stat_show()
1724 jiffies64_to_msecs(df->stats.time_in_state[i])); in trans_stat_show()
1728 df->stats.total_trans); in trans_stat_show()
1736 struct devfreq *df = to_devfreq(dev); in trans_stat_store() local
1739 if (!df->profile) in trans_stat_store()
1742 if (df->profile->max_state == 0) in trans_stat_store()
1749 mutex_lock(&df->lock); in trans_stat_store()
1750 memset(df->stats.time_in_state, 0, (df->profile->max_state * in trans_stat_store()
1751 sizeof(*df->stats.time_in_state))); in trans_stat_store()
1752 memset(df->stats.trans_table, 0, array3_size(sizeof(unsigned int), in trans_stat_store()
1753 df->profile->max_state, in trans_stat_store()
1754 df->profile->max_state)); in trans_stat_store()
1755 df->stats.total_trans = 0; in trans_stat_store()
1756 df->stats.last_update = get_jiffies_64(); in trans_stat_store()
1757 mutex_unlock(&df->lock); in trans_stat_store()
1780 struct devfreq *df = to_devfreq(dev); in polling_interval_show() local
1782 if (!df->profile) in polling_interval_show()
1785 return sprintf(buf, "%d\n", df->profile->polling_ms); in polling_interval_show()
1792 struct devfreq *df = to_devfreq(dev); in polling_interval_store() local
1796 if (!df->governor) in polling_interval_store()
1803 df->governor->event_handler(df, DEVFREQ_GOV_UPDATE_INTERVAL, &value); in polling_interval_store()
1813 struct devfreq *df = to_devfreq(dev); in timer_show() local
1815 if (!df->profile) in timer_show()
1818 return sprintf(buf, "%s\n", timer_name[df->profile->timer]); in timer_show()
1824 struct devfreq *df = to_devfreq(dev); in timer_store() local
1829 if (!df->governor || !df->profile) in timer_store()
1848 if (df->profile->timer == timer) { in timer_store()
1853 mutex_lock(&df->lock); in timer_store()
1854 df->profile->timer = timer; in timer_store()
1855 mutex_unlock(&df->lock); in timer_store()
1857 ret = df->governor->event_handler(df, DEVFREQ_GOV_STOP, NULL); in timer_store()
1860 __func__, df->governor->name, ret); in timer_store()
1864 ret = df->governor->event_handler(df, DEVFREQ_GOV_START, NULL); in timer_store()
1867 __func__, df->governor->name, ret); in timer_store()
1873 #define CREATE_SYSFS_FILE(df, name) \ argument
1876 ret = sysfs_create_file(&df->dev.kobj, &dev_attr_##name.attr); \
1878 dev_warn(&df->dev, \