~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/opp.h

Version: ~ [ linux-5.5-rc1 ] ~ [ linux-5.4.2 ] ~ [ linux-5.3.15 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.88 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.158 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.206 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.206 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.78 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Generic OPP Interface
  3  *
  4  * Copyright (C) 2009-2010 Texas Instruments Incorporated.
  5  *      Nishanth Menon
  6  *      Romit Dasgupta
  7  *      Kevin Hilman
  8  *
  9  * This program is free software; you can redistribute it and/or modify
 10  * it under the terms of the GNU General Public License version 2 as
 11  * published by the Free Software Foundation.
 12  */
 13 
 14 #ifndef __LINUX_OPP_H__
 15 #define __LINUX_OPP_H__
 16 
 17 #include <linux/err.h>
 18 #include <linux/cpufreq.h>
 19 #include <linux/notifier.h>
 20 
 21 struct opp;
 22 
 23 enum opp_event {
 24         OPP_EVENT_ADD, OPP_EVENT_ENABLE, OPP_EVENT_DISABLE,
 25 };
 26 
 27 #if defined(CONFIG_PM_OPP)
 28 
 29 unsigned long opp_get_voltage(struct opp *opp);
 30 
 31 unsigned long opp_get_freq(struct opp *opp);
 32 
 33 int opp_get_opp_count(struct device *dev);
 34 
 35 struct opp *opp_find_freq_exact(struct device *dev, unsigned long freq,
 36                                 bool available);
 37 
 38 struct opp *opp_find_freq_floor(struct device *dev, unsigned long *freq);
 39 
 40 struct opp *opp_find_freq_ceil(struct device *dev, unsigned long *freq);
 41 
 42 int opp_add(struct device *dev, unsigned long freq, unsigned long u_volt);
 43 
 44 int opp_enable(struct device *dev, unsigned long freq);
 45 
 46 int opp_disable(struct device *dev, unsigned long freq);
 47 
 48 struct srcu_notifier_head *opp_get_notifier(struct device *dev);
 49 
 50 #else
 51 static inline unsigned long opp_get_voltage(struct opp *opp)
 52 {
 53         return 0;
 54 }
 55 
 56 static inline unsigned long opp_get_freq(struct opp *opp)
 57 {
 58         return 0;
 59 }
 60 
 61 static inline int opp_get_opp_count(struct device *dev)
 62 {
 63         return 0;
 64 }
 65 
 66 static inline struct opp *opp_find_freq_exact(struct device *dev,
 67                                         unsigned long freq, bool available)
 68 {
 69         return ERR_PTR(-EINVAL);
 70 }
 71 
 72 static inline struct opp *opp_find_freq_floor(struct device *dev,
 73                                         unsigned long *freq)
 74 {
 75         return ERR_PTR(-EINVAL);
 76 }
 77 
 78 static inline struct opp *opp_find_freq_ceil(struct device *dev,
 79                                         unsigned long *freq)
 80 {
 81         return ERR_PTR(-EINVAL);
 82 }
 83 
 84 static inline int opp_add(struct device *dev, unsigned long freq,
 85                                         unsigned long u_volt)
 86 {
 87         return -EINVAL;
 88 }
 89 
 90 static inline int opp_enable(struct device *dev, unsigned long freq)
 91 {
 92         return 0;
 93 }
 94 
 95 static inline int opp_disable(struct device *dev, unsigned long freq)
 96 {
 97         return 0;
 98 }
 99 
100 static inline struct srcu_notifier_head *opp_get_notifier(struct device *dev)
101 {
102         return ERR_PTR(-EINVAL);
103 }
104 #endif          /* CONFIG_PM_OPP */
105 
106 #if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP)
107 int opp_init_cpufreq_table(struct device *dev,
108                             struct cpufreq_frequency_table **table);
109 void opp_free_cpufreq_table(struct device *dev,
110                                 struct cpufreq_frequency_table **table);
111 #else
112 static inline int opp_init_cpufreq_table(struct device *dev,
113                             struct cpufreq_frequency_table **table)
114 {
115         return -EINVAL;
116 }
117 
118 static inline
119 void opp_free_cpufreq_table(struct device *dev,
120                                 struct cpufreq_frequency_table **table)
121 {
122 }
123 #endif          /* CONFIG_CPU_FREQ */
124 
125 #endif          /* __LINUX_OPP_H__ */
126 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp