~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to include/linux/opp.h

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno, Martin Michlmayr
  • Date: 2011-04-06 13:53:30 UTC
  • mfrom: (43.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110406135330-wjufxhd0tvn3zx4z
Tags: 2.6.38-3
[ Ben Hutchings ]
* [ppc64] Add to linux-tools package architectures (Closes: #620124)
* [amd64] Save cr4 to mmu_cr4_features at boot time (Closes: #620284)
* appletalk: Fix bugs introduced when removing use of BKL
* ALSA: Fix yet another race in disconnection
* cciss: Fix lost command issue
* ath9k: Fix kernel panic in AR2427
* ses: Avoid kernel panic when lun 0 is not mapped
* PCI/ACPI: Report ASPM support to BIOS if not disabled from command line

[ Aurelien Jarno ]
* rtlwifi: fix build when PCI is not enabled.

[ Martin Michlmayr ]
* rtlwifi: Eliminate udelay calls with too large values (Closes: #620204)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
20
struct opp;
 
21
 
 
22
#if defined(CONFIG_PM_OPP)
 
23
 
 
24
unsigned long opp_get_voltage(struct opp *opp);
 
25
 
 
26
unsigned long opp_get_freq(struct opp *opp);
 
27
 
 
28
int opp_get_opp_count(struct device *dev);
 
29
 
 
30
struct opp *opp_find_freq_exact(struct device *dev, unsigned long freq,
 
31
                                bool available);
 
32
 
 
33
struct opp *opp_find_freq_floor(struct device *dev, unsigned long *freq);
 
34
 
 
35
struct opp *opp_find_freq_ceil(struct device *dev, unsigned long *freq);
 
36
 
 
37
int opp_add(struct device *dev, unsigned long freq, unsigned long u_volt);
 
38
 
 
39
int opp_enable(struct device *dev, unsigned long freq);
 
40
 
 
41
int opp_disable(struct device *dev, unsigned long freq);
 
42
 
 
43
#else
 
44
static inline unsigned long opp_get_voltage(struct opp *opp)
 
45
{
 
46
        return 0;
 
47
}
 
48
 
 
49
static inline unsigned long opp_get_freq(struct opp *opp)
 
50
{
 
51
        return 0;
 
52
}
 
53
 
 
54
static inline int opp_get_opp_count(struct device *dev)
 
55
{
 
56
        return 0;
 
57
}
 
58
 
 
59
static inline struct opp *opp_find_freq_exact(struct device *dev,
 
60
                                        unsigned long freq, bool available)
 
61
{
 
62
        return ERR_PTR(-EINVAL);
 
63
}
 
64
 
 
65
static inline struct opp *opp_find_freq_floor(struct device *dev,
 
66
                                        unsigned long *freq)
 
67
{
 
68
        return ERR_PTR(-EINVAL);
 
69
}
 
70
 
 
71
static inline struct opp *opp_find_freq_ceil(struct device *dev,
 
72
                                        unsigned long *freq)
 
73
{
 
74
        return ERR_PTR(-EINVAL);
 
75
}
 
76
 
 
77
static inline int opp_add(struct device *dev, unsigned long freq,
 
78
                                        unsigned long u_volt)
 
79
{
 
80
        return -EINVAL;
 
81
}
 
82
 
 
83
static inline int opp_enable(struct device *dev, unsigned long freq)
 
84
{
 
85
        return 0;
 
86
}
 
87
 
 
88
static inline int opp_disable(struct device *dev, unsigned long freq)
 
89
{
 
90
        return 0;
 
91
}
 
92
#endif          /* CONFIG_PM */
 
93
 
 
94
#if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP)
 
95
int opp_init_cpufreq_table(struct device *dev,
 
96
                            struct cpufreq_frequency_table **table);
 
97
#else
 
98
static inline int opp_init_cpufreq_table(struct device *dev,
 
99
                            struct cpufreq_frequency_table **table)
 
100
{
 
101
        return -EINVAL;
 
102
}
 
103
#endif          /* CONFIG_CPU_FREQ */
 
104
 
 
105
#endif          /* __LINUX_OPP_H__ */