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
nexedi
linux
Commits
dc49f3d5
Commit
dc49f3d5
authored
Jun 02, 2014
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'regulator/topic/constraints' into regulator-next
parents
277b1be9
064d5cd1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
10 deletions
+23
-10
drivers/regulator/core.c
drivers/regulator/core.c
+23
-10
No files found.
drivers/regulator/core.c
View file @
dc49f3d5
...
@@ -844,15 +844,24 @@ static int machine_constraints_voltage(struct regulator_dev *rdev,
...
@@ -844,15 +844,24 @@ static int machine_constraints_voltage(struct regulator_dev *rdev,
/* do we need to apply the constraint voltage */
/* do we need to apply the constraint voltage */
if
(
rdev
->
constraints
->
apply_uV
&&
if
(
rdev
->
constraints
->
apply_uV
&&
rdev
->
constraints
->
min_uV
==
rdev
->
constraints
->
max_uV
)
{
rdev
->
constraints
->
min_uV
==
rdev
->
constraints
->
max_uV
)
{
ret
=
_regulator_do_set_voltage
(
rdev
,
int
current_uV
=
_regulator_get_voltage
(
rdev
);
rdev
->
constraints
->
min_uV
,
if
(
current_uV
<
0
)
{
rdev_err
(
rdev
,
"failed to get the current voltage
\n
"
);
return
current_uV
;
}
if
(
current_uV
<
rdev
->
constraints
->
min_uV
||
current_uV
>
rdev
->
constraints
->
max_uV
)
{
ret
=
_regulator_do_set_voltage
(
rdev
,
rdev
->
constraints
->
min_uV
,
rdev
->
constraints
->
max_uV
);
rdev
->
constraints
->
max_uV
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
rdev_err
(
rdev
,
"failed to apply %duV constraint
\n
"
,
rdev_err
(
rdev
,
"failed to apply %duV constraint
\n
"
,
rdev
->
constraints
->
min_uV
);
rdev
->
constraints
->
min_uV
);
return
ret
;
return
ret
;
}
}
}
}
}
/* constrain machine-level voltage specs to fit
/* constrain machine-level voltage specs to fit
* the actual range supported by this regulator.
* the actual range supported by this regulator.
...
@@ -3819,8 +3828,9 @@ static int __init regulator_init_complete(void)
...
@@ -3819,8 +3828,9 @@ static int __init regulator_init_complete(void)
mutex_lock
(
&
regulator_list_mutex
);
mutex_lock
(
&
regulator_list_mutex
);
/* If we have a full configuration then disable any regulators
/* If we have a full configuration then disable any regulators
* which are not in use or always_on. This will become the
* we have permission to change the status for and which are
* default behaviour in the future.
* not in use or always_on. This is effectively the default
* for DT and ACPI as they have full constraints.
*/
*/
list_for_each_entry
(
rdev
,
&
regulator_list
,
list
)
{
list_for_each_entry
(
rdev
,
&
regulator_list
,
list
)
{
ops
=
rdev
->
desc
->
ops
;
ops
=
rdev
->
desc
->
ops
;
...
@@ -3829,6 +3839,9 @@ static int __init regulator_init_complete(void)
...
@@ -3829,6 +3839,9 @@ static int __init regulator_init_complete(void)
if
(
c
&&
c
->
always_on
)
if
(
c
&&
c
->
always_on
)
continue
;
continue
;
if
(
c
&&
!
(
c
->
valid_ops_mask
&
REGULATOR_CHANGE_STATUS
))
continue
;
mutex_lock
(
&
rdev
->
mutex
);
mutex_lock
(
&
rdev
->
mutex
);
if
(
rdev
->
use_count
)
if
(
rdev
->
use_count
)
...
@@ -3867,4 +3880,4 @@ static int __init regulator_init_complete(void)
...
@@ -3867,4 +3880,4 @@ static int __init regulator_init_complete(void)
return
0
;
return
0
;
}
}
late_initcall
(
regulator_init_complete
);
late_initcall
_sync
(
regulator_init_complete
);
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