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
a89f5c75
Commit
a89f5c75
authored
Sep 01, 2013
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'regulator/topic/ramp' into regulator-next
parents
09f2dd88
5b175952
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
6 deletions
+16
-6
Documentation/devicetree/bindings/regulator/regulator.txt
Documentation/devicetree/bindings/regulator/regulator.txt
+2
-0
drivers/regulator/core.c
drivers/regulator/core.c
+4
-3
drivers/regulator/of_regulator.c
drivers/regulator/of_regulator.c
+9
-3
include/linux/regulator/machine.h
include/linux/regulator/machine.h
+1
-0
No files found.
Documentation/devicetree/bindings/regulator/regulator.txt
View file @
a89f5c75
...
@@ -12,6 +12,8 @@ Optional properties:
...
@@ -12,6 +12,8 @@ Optional properties:
- regulator-allow-bypass: allow the regulator to go into bypass mode
- regulator-allow-bypass: allow the regulator to go into bypass mode
- <name>-supply: phandle to the parent supply/regulator node
- <name>-supply: phandle to the parent supply/regulator node
- regulator-ramp-delay: ramp delay for regulator(in uV/uS)
- regulator-ramp-delay: ramp delay for regulator(in uV/uS)
For hardwares which support disabling ramp rate, it should be explicitly
intialised to zero (regulator-ramp-delay = <0>) for disabling ramp delay.
Deprecated properties:
Deprecated properties:
- regulator-compatible: If a regulator chip contains multiple
- regulator-compatible: If a regulator chip contains multiple
...
...
drivers/regulator/core.c
View file @
a89f5c75
...
@@ -988,7 +988,8 @@ static int set_machine_constraints(struct regulator_dev *rdev,
...
@@ -988,7 +988,8 @@ static int set_machine_constraints(struct regulator_dev *rdev,
}
}
}
}
if
(
rdev
->
constraints
->
ramp_delay
&&
ops
->
set_ramp_delay
)
{
if
((
rdev
->
constraints
->
ramp_delay
||
rdev
->
constraints
->
ramp_disable
)
&&
ops
->
set_ramp_delay
)
{
ret
=
ops
->
set_ramp_delay
(
rdev
,
rdev
->
constraints
->
ramp_delay
);
ret
=
ops
->
set_ramp_delay
(
rdev
,
rdev
->
constraints
->
ramp_delay
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
rdev_err
(
rdev
,
"failed to set ramp_delay
\n
"
);
rdev_err
(
rdev
,
"failed to set ramp_delay
\n
"
);
...
@@ -2241,8 +2242,8 @@ static int _regulator_do_set_voltage(struct regulator_dev *rdev,
...
@@ -2241,8 +2242,8 @@ static int _regulator_do_set_voltage(struct regulator_dev *rdev,
}
}
/* Call set_voltage_time_sel if successfully obtained old_selector */
/* Call set_voltage_time_sel if successfully obtained old_selector */
if
(
ret
==
0
&&
_regulator_is_enabled
(
rdev
)
&&
old_selector
>=
0
&&
if
(
ret
==
0
&&
!
rdev
->
constraints
->
ramp_disable
&&
old_selector
>=
0
old_selector
!=
selector
&&
rdev
->
desc
->
ops
->
set_voltage_time_sel
)
{
&&
old_selector
!=
selector
)
{
delay
=
rdev
->
desc
->
ops
->
set_voltage_time_sel
(
rdev
,
delay
=
rdev
->
desc
->
ops
->
set_voltage_time_sel
(
rdev
,
old_selector
,
selector
);
old_selector
,
selector
);
...
...
drivers/regulator/of_regulator.c
View file @
a89f5c75
...
@@ -21,6 +21,7 @@ static void of_get_regulation_constraints(struct device_node *np,
...
@@ -21,6 +21,7 @@ static void of_get_regulation_constraints(struct device_node *np,
{
{
const
__be32
*
min_uV
,
*
max_uV
,
*
uV_offset
;
const
__be32
*
min_uV
,
*
max_uV
,
*
uV_offset
;
const
__be32
*
min_uA
,
*
max_uA
,
*
ramp_delay
;
const
__be32
*
min_uA
,
*
max_uA
,
*
ramp_delay
;
struct
property
*
prop
;
struct
regulation_constraints
*
constraints
=
&
(
*
init_data
)
->
constraints
;
struct
regulation_constraints
*
constraints
=
&
(
*
init_data
)
->
constraints
;
constraints
->
name
=
of_get_property
(
np
,
"regulator-name"
,
NULL
);
constraints
->
name
=
of_get_property
(
np
,
"regulator-name"
,
NULL
);
...
@@ -64,9 +65,14 @@ static void of_get_regulation_constraints(struct device_node *np,
...
@@ -64,9 +65,14 @@ static void of_get_regulation_constraints(struct device_node *np,
if
(
of_property_read_bool
(
np
,
"regulator-allow-bypass"
))
if
(
of_property_read_bool
(
np
,
"regulator-allow-bypass"
))
constraints
->
valid_ops_mask
|=
REGULATOR_CHANGE_BYPASS
;
constraints
->
valid_ops_mask
|=
REGULATOR_CHANGE_BYPASS
;
ramp_delay
=
of_get_property
(
np
,
"regulator-ramp-delay"
,
NULL
);
prop
=
of_find_property
(
np
,
"regulator-ramp-delay"
,
NULL
);
if
(
ramp_delay
)
if
(
prop
&&
prop
->
value
)
{
ramp_delay
=
prop
->
value
;
if
(
*
ramp_delay
)
constraints
->
ramp_delay
=
be32_to_cpu
(
*
ramp_delay
);
constraints
->
ramp_delay
=
be32_to_cpu
(
*
ramp_delay
);
else
constraints
->
ramp_disable
=
true
;
}
}
}
/**
/**
...
...
include/linux/regulator/machine.h
View file @
a89f5c75
...
@@ -134,6 +134,7 @@ struct regulation_constraints {
...
@@ -134,6 +134,7 @@ struct regulation_constraints {
unsigned
always_on
:
1
;
/* regulator never off when system is on */
unsigned
always_on
:
1
;
/* regulator never off when system is on */
unsigned
boot_on
:
1
;
/* bootloader/firmware enabled regulator */
unsigned
boot_on
:
1
;
/* bootloader/firmware enabled regulator */
unsigned
apply_uV
:
1
;
/* apply uV constraint if min == max */
unsigned
apply_uV
:
1
;
/* apply uV constraint if min == max */
unsigned
ramp_disable
:
1
;
/* disable ramp delay */
};
};
/**
/**
...
...
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