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
724d0544
Commit
724d0544
authored
Sep 01, 2013
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'regulator/topic/helpers' into regulator-next
parents
446b4665
d295f767
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
458 additions
and
463 deletions
+458
-463
drivers/regulator/Makefile
drivers/regulator/Makefile
+1
-1
drivers/regulator/core.c
drivers/regulator/core.c
+0
-427
drivers/regulator/da903x.c
drivers/regulator/da903x.c
+10
-35
drivers/regulator/helpers.c
drivers/regulator/helpers.c
+447
-0
No files found.
drivers/regulator/Makefile
View file @
724d0544
...
...
@@ -3,7 +3,7 @@
#
obj-$(CONFIG_REGULATOR)
+=
core.o dummy.o fixed-helper.o
obj-$(CONFIG_REGULATOR)
+=
core.o dummy.o fixed-helper.o
helpers.o
obj-$(CONFIG_OF)
+=
of_regulator.o
obj-$(CONFIG_REGULATOR_FIXED_VOLTAGE)
+=
fixed.o
obj-$(CONFIG_REGULATOR_VIRTUAL_CONSUMER)
+=
virtual.o
...
...
drivers/regulator/core.c
View file @
724d0544
This diff is collapsed.
Click to expand it.
drivers/regulator/da903x.c
View file @
724d0544
...
...
@@ -252,39 +252,12 @@ static int da9034_set_dvc_voltage_sel(struct regulator_dev *rdev,
return
ret
;
}
static
int
da9034_map_ldo12_voltage
(
struct
regulator_dev
*
rdev
,
int
min_uV
,
int
max_uV
)
{
struct
da903x_regulator_info
*
info
=
rdev_get_drvdata
(
rdev
);
int
sel
;
if
(
check_range
(
info
,
min_uV
,
max_uV
))
{
pr_err
(
"invalid voltage range (%d, %d) uV
\n
"
,
min_uV
,
max_uV
);
return
-
EINVAL
;
}
sel
=
DIV_ROUND_UP
(
min_uV
-
info
->
desc
.
min_uV
,
info
->
desc
.
uV_step
);
sel
=
(
sel
>=
20
)
?
sel
-
12
:
((
sel
>
7
)
?
8
:
sel
);
return
sel
;
}
static
int
da9034_list_ldo12_voltage
(
struct
regulator_dev
*
rdev
,
unsigned
selector
)
{
struct
da903x_regulator_info
*
info
=
rdev_get_drvdata
(
rdev
);
int
volt
;
if
(
selector
>=
8
)
volt
=
2700000
+
rdev
->
desc
->
uV_step
*
(
selector
-
8
);
else
volt
=
rdev
->
desc
->
min_uV
+
rdev
->
desc
->
uV_step
*
selector
;
if
(
volt
>
info
->
max_uV
)
return
-
EINVAL
;
return
volt
;
}
static
const
struct
regulator_linear_range
da9034_ldo12_ranges
[]
=
{
{
.
min_uV
=
1700000
,
.
max_uV
=
2050000
,
.
min_sel
=
0
,
.
max_sel
=
7
,
.
uV_step
=
50000
},
{
.
min_uV
=
2700000
,
.
max_uV
=
3050000
,
.
min_sel
=
8
,
.
max_sel
=
15
,
.
uV_step
=
50000
},
};
static
struct
regulator_ops
da903x_regulator_ldo_ops
=
{
.
set_voltage_sel
=
da903x_set_voltage_sel
,
...
...
@@ -332,8 +305,8 @@ static struct regulator_ops da9034_regulator_dvc_ops = {
static
struct
regulator_ops
da9034_regulator_ldo12_ops
=
{
.
set_voltage_sel
=
da903x_set_voltage_sel
,
.
get_voltage_sel
=
da903x_get_voltage_sel
,
.
list_voltage
=
da9034_list_ldo12_volta
ge
,
.
map_voltage
=
da9034_map_ldo12_volta
ge
,
.
list_voltage
=
regulator_list_voltage_linear_ran
ge
,
.
map_voltage
=
regulator_map_voltage_linear_ran
ge
,
.
enable
=
da903x_enable
,
.
disable
=
da903x_disable
,
.
is_enabled
=
da903x_is_enabled
,
...
...
@@ -476,6 +449,8 @@ static int da903x_regulator_probe(struct platform_device *pdev)
if
(
ri
->
desc
.
id
==
DA9034_ID_LDO12
)
{
ri
->
desc
.
ops
=
&
da9034_regulator_ldo12_ops
;
ri
->
desc
.
n_voltages
=
16
;
ri
->
desc
.
linear_ranges
=
da9034_ldo12_ranges
;
ri
->
desc
.
n_linear_ranges
=
ARRAY_SIZE
(
da9034_ldo12_ranges
);
}
if
(
ri
->
desc
.
id
==
DA9030_ID_LDO14
)
...
...
drivers/regulator/helpers.c
0 → 100644
View file @
724d0544
This diff is collapsed.
Click to expand it.
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