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
efc82802
Commit
efc82802
authored
Feb 19, 2013
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'regulator/topic/lp872x' into regulator-next
parents
5ce63c7e
2c129927
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
29 deletions
+7
-29
drivers/regulator/lp872x.c
drivers/regulator/lp872x.c
+7
-29
No files found.
drivers/regulator/lp872x.c
View file @
efc82802
...
...
@@ -181,20 +181,6 @@ static inline int lp872x_update_bits(struct lp872x *lp, u8 addr,
return
regmap_update_bits
(
lp
->
regmap
,
addr
,
mask
,
data
);
}
static
int
_rdev_to_offset
(
struct
regulator_dev
*
rdev
)
{
enum
lp872x_regulator_id
id
=
rdev_get_id
(
rdev
);
switch
(
id
)
{
case
LP8720_ID_LDO1
...
LP8720_ID_BUCK
:
return
id
;
case
LP8725_ID_LDO1
...
LP8725_ID_BUCK2
:
return
id
-
LP8725_ID_BASE
;
default:
return
-
EINVAL
;
}
}
static
int
lp872x_get_timestep_usec
(
struct
lp872x
*
lp
)
{
enum
lp872x_id
chip
=
lp
->
chipid
;
...
...
@@ -234,28 +220,20 @@ static int lp872x_get_timestep_usec(struct lp872x *lp)
static
int
lp872x_regulator_enable_time
(
struct
regulator_dev
*
rdev
)
{
struct
lp872x
*
lp
=
rdev_get_drvdata
(
rdev
);
enum
lp872x_regulator_id
r
egulator
=
rdev_get_id
(
rdev
);
enum
lp872x_regulator_id
r
id
=
rdev_get_id
(
rdev
);
int
time_step_us
=
lp872x_get_timestep_usec
(
lp
);
int
ret
,
offset
;
int
ret
;
u8
addr
,
val
;
if
(
time_step_us
<
0
)
return
-
EINVAL
;
switch
(
regulator
)
{
case
LP8720_ID_LDO1
...
LP8720_ID_LDO5
:
case
LP8725_ID_LDO1
...
LP8725_ID_LILO2
:
offset
=
_rdev_to_offset
(
rdev
);
if
(
offset
<
0
)
return
-
EINVAL
;
addr
=
LP872X_LDO1_VOUT
+
offset
;
break
;
case
LP8720_ID_BUCK
:
addr
=
LP8720_BUCK_VOUT1
;
switch
(
rid
)
{
case
LP8720_ID_LDO1
...
LP8720_ID_BUCK
:
addr
=
LP872X_LDO1_VOUT
+
rid
;
break
;
case
LP8725_ID_BUCK1
:
addr
=
LP872
5_BUCK1_VOUT1
;
case
LP8725_ID_
LDO1
...
LP8725_ID_
BUCK1
:
addr
=
LP872
X_LDO1_VOUT
+
rid
-
LP8725_ID_BASE
;
break
;
case
LP8725_ID_BUCK2
:
addr
=
LP8725_BUCK2_VOUT1
;
...
...
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