Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
ade0c949
Commit
ade0c949
authored
Dec 14, 2018
by
Viresh Kumar
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'opp/genpd/propagation' into opp/linux-next
parents
46f48aca
18edf49c
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
756 additions
and
216 deletions
+756
-216
drivers/base/power/domain.c
drivers/base/power/domain.c
+175
-97
drivers/opp/core.c
drivers/opp/core.c
+254
-70
drivers/opp/of.c
drivers/opp/of.c
+278
-41
drivers/opp/opp.h
drivers/opp/opp.h
+20
-0
include/linux/pm_domain.h
include/linux/pm_domain.h
+10
-4
include/linux/pm_opp.h
include/linux/pm_opp.h
+19
-4
No files found.
drivers/base/power/domain.c
View file @
ade0c949
This diff is collapsed.
Click to expand it.
drivers/opp/core.c
View file @
ade0c949
This diff is collapsed.
Click to expand it.
drivers/opp/of.c
View file @
ade0c949
This diff is collapsed.
Click to expand it.
drivers/opp/opp.h
View file @
ade0c949
...
@@ -63,6 +63,7 @@ extern struct list_head opp_tables;
...
@@ -63,6 +63,7 @@ extern struct list_head opp_tables;
* @supplies: Power supplies voltage/current values
* @supplies: Power supplies voltage/current values
* @clock_latency_ns: Latency (in nanoseconds) of switching to this OPP's
* @clock_latency_ns: Latency (in nanoseconds) of switching to this OPP's
* frequency from any other OPP's frequency.
* frequency from any other OPP's frequency.
* @required_opps: List of OPPs that are required by this OPP.
* @opp_table: points back to the opp_table struct this opp belongs to
* @opp_table: points back to the opp_table struct this opp belongs to
* @np: OPP's device node.
* @np: OPP's device node.
* @dentry: debugfs dentry pointer (per opp)
* @dentry: debugfs dentry pointer (per opp)
...
@@ -84,6 +85,7 @@ struct dev_pm_opp {
...
@@ -84,6 +85,7 @@ struct dev_pm_opp {
unsigned
long
clock_latency_ns
;
unsigned
long
clock_latency_ns
;
struct
dev_pm_opp
**
required_opps
;
struct
opp_table
*
opp_table
;
struct
opp_table
*
opp_table
;
struct
device_node
*
np
;
struct
device_node
*
np
;
...
@@ -133,6 +135,11 @@ enum opp_table_access {
...
@@ -133,6 +135,11 @@ enum opp_table_access {
* @parsed_static_opps: True if OPPs are initialized from DT.
* @parsed_static_opps: True if OPPs are initialized from DT.
* @shared_opp: OPP is shared between multiple devices.
* @shared_opp: OPP is shared between multiple devices.
* @suspend_opp: Pointer to OPP to be used during device suspend.
* @suspend_opp: Pointer to OPP to be used during device suspend.
* @genpd_virt_dev_lock: Mutex protecting the genpd virtual device pointers.
* @genpd_virt_devs: List of virtual devices for multiple genpd support.
* @required_opp_tables: List of device OPP tables that are required by OPPs in
* this table.
* @required_opp_count: Number of required devices.
* @supported_hw: Array of version number to support.
* @supported_hw: Array of version number to support.
* @supported_hw_count: Number of elements in supported_hw array.
* @supported_hw_count: Number of elements in supported_hw array.
* @prop_name: A name to postfix to many DT properties, while parsing them.
* @prop_name: A name to postfix to many DT properties, while parsing them.
...
@@ -142,6 +149,7 @@ enum opp_table_access {
...
@@ -142,6 +149,7 @@ enum opp_table_access {
* (uninitialized), 0 (no opp-microvolt property) or > 0 (has opp-microvolt
* (uninitialized), 0 (no opp-microvolt property) or > 0 (has opp-microvolt
* property).
* property).
* @genpd_performance_state: Device's power domain support performance state.
* @genpd_performance_state: Device's power domain support performance state.
* @is_genpd: Marks if the OPP table belongs to a genpd.
* @set_opp: Platform specific set_opp callback
* @set_opp: Platform specific set_opp callback
* @set_opp_data: Data to be passed to set_opp callback
* @set_opp_data: Data to be passed to set_opp callback
* @dentry: debugfs dentry pointer of the real device directory (not links).
* @dentry: debugfs dentry pointer of the real device directory (not links).
...
@@ -173,6 +181,11 @@ struct opp_table {
...
@@ -173,6 +181,11 @@ struct opp_table {
enum
opp_table_access
shared_opp
;
enum
opp_table_access
shared_opp
;
struct
dev_pm_opp
*
suspend_opp
;
struct
dev_pm_opp
*
suspend_opp
;
struct
mutex
genpd_virt_dev_lock
;
struct
device
**
genpd_virt_devs
;
struct
opp_table
**
required_opp_tables
;
unsigned
int
required_opp_count
;
unsigned
int
*
supported_hw
;
unsigned
int
*
supported_hw
;
unsigned
int
supported_hw_count
;
unsigned
int
supported_hw_count
;
const
char
*
prop_name
;
const
char
*
prop_name
;
...
@@ -180,6 +193,7 @@ struct opp_table {
...
@@ -180,6 +193,7 @@ struct opp_table {
struct
regulator
**
regulators
;
struct
regulator
**
regulators
;
int
regulator_count
;
int
regulator_count
;
bool
genpd_performance_state
;
bool
genpd_performance_state
;
bool
is_genpd
;
int
(
*
set_opp
)(
struct
dev_pm_set_opp_data
*
data
);
int
(
*
set_opp
)(
struct
dev_pm_set_opp_data
*
data
);
struct
dev_pm_set_opp_data
*
set_opp_data
;
struct
dev_pm_set_opp_data
*
set_opp_data
;
...
@@ -208,10 +222,16 @@ void _put_opp_list_kref(struct opp_table *opp_table);
...
@@ -208,10 +222,16 @@ void _put_opp_list_kref(struct opp_table *opp_table);
#ifdef CONFIG_OF
#ifdef CONFIG_OF
void
_of_init_opp_table
(
struct
opp_table
*
opp_table
,
struct
device
*
dev
,
int
index
);
void
_of_init_opp_table
(
struct
opp_table
*
opp_table
,
struct
device
*
dev
,
int
index
);
void
_of_clear_opp_table
(
struct
opp_table
*
opp_table
);
struct
opp_table
*
_managed_opp
(
struct
device
*
dev
,
int
index
);
struct
opp_table
*
_managed_opp
(
struct
device
*
dev
,
int
index
);
void
_of_opp_free_required_opps
(
struct
opp_table
*
opp_table
,
struct
dev_pm_opp
*
opp
);
#else
#else
static
inline
void
_of_init_opp_table
(
struct
opp_table
*
opp_table
,
struct
device
*
dev
,
int
index
)
{}
static
inline
void
_of_init_opp_table
(
struct
opp_table
*
opp_table
,
struct
device
*
dev
,
int
index
)
{}
static
inline
void
_of_clear_opp_table
(
struct
opp_table
*
opp_table
)
{}
static
inline
struct
opp_table
*
_managed_opp
(
struct
device
*
dev
,
int
index
)
{
return
NULL
;
}
static
inline
struct
opp_table
*
_managed_opp
(
struct
device
*
dev
,
int
index
)
{
return
NULL
;
}
static
inline
void
_of_opp_free_required_opps
(
struct
opp_table
*
opp_table
,
struct
dev_pm_opp
*
opp
)
{}
#endif
#endif
#ifdef CONFIG_DEBUG_FS
#ifdef CONFIG_DEBUG_FS
...
...
include/linux/pm_domain.h
View file @
ade0c949
...
@@ -73,6 +73,7 @@ struct genpd_power_state {
...
@@ -73,6 +73,7 @@ struct genpd_power_state {
struct
genpd_lock_ops
;
struct
genpd_lock_ops
;
struct
dev_pm_opp
;
struct
dev_pm_opp
;
struct
opp_table
;
struct
generic_pm_domain
{
struct
generic_pm_domain
{
struct
device
dev
;
struct
device
dev
;
...
@@ -94,6 +95,7 @@ struct generic_pm_domain {
...
@@ -94,6 +95,7 @@ struct generic_pm_domain {
unsigned
int
performance_state
;
/* Aggregated max performance state */
unsigned
int
performance_state
;
/* Aggregated max performance state */
int
(
*
power_off
)(
struct
generic_pm_domain
*
domain
);
int
(
*
power_off
)(
struct
generic_pm_domain
*
domain
);
int
(
*
power_on
)(
struct
generic_pm_domain
*
domain
);
int
(
*
power_on
)(
struct
generic_pm_domain
*
domain
);
struct
opp_table
*
opp_table
;
/* OPP table of the genpd */
unsigned
int
(
*
opp_to_performance_state
)(
struct
generic_pm_domain
*
genpd
,
unsigned
int
(
*
opp_to_performance_state
)(
struct
generic_pm_domain
*
genpd
,
struct
dev_pm_opp
*
opp
);
struct
dev_pm_opp
*
opp
);
int
(
*
set_performance_state
)(
struct
generic_pm_domain
*
genpd
,
int
(
*
set_performance_state
)(
struct
generic_pm_domain
*
genpd
,
...
@@ -134,6 +136,10 @@ struct gpd_link {
...
@@ -134,6 +136,10 @@ struct gpd_link {
struct
list_head
master_node
;
struct
list_head
master_node
;
struct
generic_pm_domain
*
slave
;
struct
generic_pm_domain
*
slave
;
struct
list_head
slave_node
;
struct
list_head
slave_node
;
/* Sub-domain's per-master domain performance state */
unsigned
int
performance_state
;
unsigned
int
prev_performance_state
;
};
};
struct
gpd_timing_data
{
struct
gpd_timing_data
{
...
@@ -258,8 +264,8 @@ int of_genpd_add_subdomain(struct of_phandle_args *parent,
...
@@ -258,8 +264,8 @@ int of_genpd_add_subdomain(struct of_phandle_args *parent,
struct
generic_pm_domain
*
of_genpd_remove_last
(
struct
device_node
*
np
);
struct
generic_pm_domain
*
of_genpd_remove_last
(
struct
device_node
*
np
);
int
of_genpd_parse_idle_states
(
struct
device_node
*
dn
,
int
of_genpd_parse_idle_states
(
struct
device_node
*
dn
,
struct
genpd_power_state
**
states
,
int
*
n
);
struct
genpd_power_state
**
states
,
int
*
n
);
unsigned
int
of_genpd_opp_to_performance_state
(
struct
device
*
dev
,
unsigned
int
pm_genpd_opp_to_performance_state
(
struct
device
*
genpd_
dev
,
struct
device_node
*
n
p
);
struct
dev_pm_opp
*
op
p
);
int
genpd_dev_pm_attach
(
struct
device
*
dev
);
int
genpd_dev_pm_attach
(
struct
device
*
dev
);
struct
device
*
genpd_dev_pm_attach_by_id
(
struct
device
*
dev
,
struct
device
*
genpd_dev_pm_attach_by_id
(
struct
device
*
dev
,
...
@@ -300,8 +306,8 @@ static inline int of_genpd_parse_idle_states(struct device_node *dn,
...
@@ -300,8 +306,8 @@ static inline int of_genpd_parse_idle_states(struct device_node *dn,
}
}
static
inline
unsigned
int
static
inline
unsigned
int
of_genpd_opp_to_performance_state
(
struct
device
*
dev
,
pm_genpd_opp_to_performance_state
(
struct
device
*
genpd_
dev
,
struct
dev
ice_node
*
n
p
)
struct
dev
_pm_opp
*
op
p
)
{
{
return
0
;
return
0
;
}
}
...
...
include/linux/pm_opp.h
View file @
ade0c949
...
@@ -126,6 +126,9 @@ struct opp_table *dev_pm_opp_set_clkname(struct device *dev, const char * name);
...
@@ -126,6 +126,9 @@ struct opp_table *dev_pm_opp_set_clkname(struct device *dev, const char * name);
void
dev_pm_opp_put_clkname
(
struct
opp_table
*
opp_table
);
void
dev_pm_opp_put_clkname
(
struct
opp_table
*
opp_table
);
struct
opp_table
*
dev_pm_opp_register_set_opp_helper
(
struct
device
*
dev
,
int
(
*
set_opp
)(
struct
dev_pm_set_opp_data
*
data
));
struct
opp_table
*
dev_pm_opp_register_set_opp_helper
(
struct
device
*
dev
,
int
(
*
set_opp
)(
struct
dev_pm_set_opp_data
*
data
));
void
dev_pm_opp_unregister_set_opp_helper
(
struct
opp_table
*
opp_table
);
void
dev_pm_opp_unregister_set_opp_helper
(
struct
opp_table
*
opp_table
);
struct
opp_table
*
dev_pm_opp_set_genpd_virt_dev
(
struct
device
*
dev
,
struct
device
*
virt_dev
,
int
index
);
void
dev_pm_opp_put_genpd_virt_dev
(
struct
opp_table
*
opp_table
,
struct
device
*
virt_dev
);
int
dev_pm_opp_xlate_performance_state
(
struct
opp_table
*
src_table
,
struct
opp_table
*
dst_table
,
unsigned
int
pstate
);
int
dev_pm_opp_set_rate
(
struct
device
*
dev
,
unsigned
long
target_freq
);
int
dev_pm_opp_set_rate
(
struct
device
*
dev
,
unsigned
long
target_freq
);
int
dev_pm_opp_set_sharing_cpus
(
struct
device
*
cpu_dev
,
const
struct
cpumask
*
cpumask
);
int
dev_pm_opp_set_sharing_cpus
(
struct
device
*
cpu_dev
,
const
struct
cpumask
*
cpumask
);
int
dev_pm_opp_get_sharing_cpus
(
struct
device
*
cpu_dev
,
struct
cpumask
*
cpumask
);
int
dev_pm_opp_get_sharing_cpus
(
struct
device
*
cpu_dev
,
struct
cpumask
*
cpumask
);
...
@@ -272,6 +275,18 @@ static inline struct opp_table *dev_pm_opp_set_clkname(struct device *dev, const
...
@@ -272,6 +275,18 @@ static inline struct opp_table *dev_pm_opp_set_clkname(struct device *dev, const
static
inline
void
dev_pm_opp_put_clkname
(
struct
opp_table
*
opp_table
)
{}
static
inline
void
dev_pm_opp_put_clkname
(
struct
opp_table
*
opp_table
)
{}
static
inline
struct
opp_table
*
dev_pm_opp_set_genpd_virt_dev
(
struct
device
*
dev
,
struct
device
*
virt_dev
,
int
index
)
{
return
ERR_PTR
(
-
ENOTSUPP
);
}
static
inline
void
dev_pm_opp_put_genpd_virt_dev
(
struct
opp_table
*
opp_table
,
struct
device
*
virt_dev
)
{}
static
inline
int
dev_pm_opp_xlate_performance_state
(
struct
opp_table
*
src_table
,
struct
opp_table
*
dst_table
,
unsigned
int
pstate
)
{
return
-
ENOTSUPP
;
}
static
inline
int
dev_pm_opp_set_rate
(
struct
device
*
dev
,
unsigned
long
target_freq
)
static
inline
int
dev_pm_opp_set_rate
(
struct
device
*
dev
,
unsigned
long
target_freq
)
{
{
return
-
ENOTSUPP
;
return
-
ENOTSUPP
;
...
@@ -305,8 +320,8 @@ int dev_pm_opp_of_cpumask_add_table(const struct cpumask *cpumask);
...
@@ -305,8 +320,8 @@ int dev_pm_opp_of_cpumask_add_table(const struct cpumask *cpumask);
void
dev_pm_opp_of_cpumask_remove_table
(
const
struct
cpumask
*
cpumask
);
void
dev_pm_opp_of_cpumask_remove_table
(
const
struct
cpumask
*
cpumask
);
int
dev_pm_opp_of_get_sharing_cpus
(
struct
device
*
cpu_dev
,
struct
cpumask
*
cpumask
);
int
dev_pm_opp_of_get_sharing_cpus
(
struct
device
*
cpu_dev
,
struct
cpumask
*
cpumask
);
struct
device_node
*
dev_pm_opp_of_get_opp_desc_node
(
struct
device
*
dev
);
struct
device_node
*
dev_pm_opp_of_get_opp_desc_node
(
struct
device
*
dev
);
struct
dev_pm_opp
*
of_dev_pm_opp_find_required_opp
(
struct
device
*
dev
,
struct
device_node
*
np
);
struct
device_node
*
dev_pm_opp_get_of_node
(
struct
dev_pm_opp
*
opp
);
struct
device_node
*
dev_pm_opp_get_of_node
(
struct
dev_pm_opp
*
opp
);
int
of_get_required_opp_performance_state
(
struct
device_node
*
np
,
int
index
);
#else
#else
static
inline
int
dev_pm_opp_of_add_table
(
struct
device
*
dev
)
static
inline
int
dev_pm_opp_of_add_table
(
struct
device
*
dev
)
{
{
...
@@ -341,13 +356,13 @@ static inline struct device_node *dev_pm_opp_of_get_opp_desc_node(struct device
...
@@ -341,13 +356,13 @@ static inline struct device_node *dev_pm_opp_of_get_opp_desc_node(struct device
return
NULL
;
return
NULL
;
}
}
static
inline
struct
dev
_pm_opp
*
of_dev_pm_opp_find_required_opp
(
struct
device
*
dev
,
struct
device_node
*
n
p
)
static
inline
struct
dev
ice_node
*
dev_pm_opp_get_of_node
(
struct
dev_pm_opp
*
op
p
)
{
{
return
NULL
;
return
NULL
;
}
}
static
inline
struct
device_node
*
dev_pm_opp_get_of_node
(
struct
dev_pm_opp
*
opp
)
static
inline
int
of_get_required_opp_performance_state
(
struct
device_node
*
np
,
int
index
)
{
{
return
NULL
;
return
-
ENOTSUPP
;
}
}
#endif
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment