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
c4578da5
Commit
c4578da5
authored
Apr 28, 2013
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'regulator/topic/max77686' into v3.9-rc8
parents
388128ff
3ecf198e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
11 deletions
+21
-11
drivers/regulator/max77686.c
drivers/regulator/max77686.c
+21
-11
No files found.
drivers/regulator/max77686.c
View file @
c4578da5
...
@@ -75,17 +75,20 @@ static int max77686_buck_set_suspend_disable(struct regulator_dev *rdev)
...
@@ -75,17 +75,20 @@ static int max77686_buck_set_suspend_disable(struct regulator_dev *rdev)
{
{
unsigned
int
val
;
unsigned
int
val
;
struct
max77686_data
*
max77686
=
rdev_get_drvdata
(
rdev
);
struct
max77686_data
*
max77686
=
rdev_get_drvdata
(
rdev
);
int
id
=
rdev_get_id
(
rdev
);
int
ret
,
id
=
rdev_get_id
(
rdev
);
if
(
id
==
MAX77686_BUCK1
)
if
(
id
==
MAX77686_BUCK1
)
val
=
0x1
;
val
=
0x1
;
else
else
val
=
0x1
<<
MAX77686_OPMODE_BUCK234_SHIFT
;
val
=
0x1
<<
MAX77686_OPMODE_BUCK234_SHIFT
;
ret
=
regmap_update_bits
(
rdev
->
regmap
,
rdev
->
desc
->
enable_reg
,
rdev
->
desc
->
enable_mask
,
val
);
if
(
ret
)
return
ret
;
max77686
->
opmode
[
id
]
=
val
;
max77686
->
opmode
[
id
]
=
val
;
return
regmap_update_bits
(
rdev
->
regmap
,
rdev
->
desc
->
enable_reg
,
return
0
;
rdev
->
desc
->
enable_mask
,
val
);
}
}
/* Some LDOs supports [LPM/Normal]ON mode during suspend state */
/* Some LDOs supports [LPM/Normal]ON mode during suspend state */
...
@@ -94,7 +97,7 @@ static int max77686_set_suspend_mode(struct regulator_dev *rdev,
...
@@ -94,7 +97,7 @@ static int max77686_set_suspend_mode(struct regulator_dev *rdev,
{
{
struct
max77686_data
*
max77686
=
rdev_get_drvdata
(
rdev
);
struct
max77686_data
*
max77686
=
rdev_get_drvdata
(
rdev
);
unsigned
int
val
;
unsigned
int
val
;
int
id
=
rdev_get_id
(
rdev
);
int
ret
,
id
=
rdev_get_id
(
rdev
);
/* BUCK[5-9] doesn't support this feature */
/* BUCK[5-9] doesn't support this feature */
if
(
id
>=
MAX77686_BUCK5
)
if
(
id
>=
MAX77686_BUCK5
)
...
@@ -113,10 +116,13 @@ static int max77686_set_suspend_mode(struct regulator_dev *rdev,
...
@@ -113,10 +116,13 @@ static int max77686_set_suspend_mode(struct regulator_dev *rdev,
return
-
EINVAL
;
return
-
EINVAL
;
}
}
ret
=
regmap_update_bits
(
rdev
->
regmap
,
rdev
->
desc
->
enable_reg
,
rdev
->
desc
->
enable_mask
,
val
);
if
(
ret
)
return
ret
;
max77686
->
opmode
[
id
]
=
val
;
max77686
->
opmode
[
id
]
=
val
;
return
regmap_update_bits
(
rdev
->
regmap
,
rdev
->
desc
->
enable_reg
,
return
0
;
rdev
->
desc
->
enable_mask
,
val
);
}
}
/* Some LDOs supports LPM-ON/OFF/Normal-ON mode during suspend state */
/* Some LDOs supports LPM-ON/OFF/Normal-ON mode during suspend state */
...
@@ -125,6 +131,7 @@ static int max77686_ldo_set_suspend_mode(struct regulator_dev *rdev,
...
@@ -125,6 +131,7 @@ static int max77686_ldo_set_suspend_mode(struct regulator_dev *rdev,
{
{
unsigned
int
val
;
unsigned
int
val
;
struct
max77686_data
*
max77686
=
rdev_get_drvdata
(
rdev
);
struct
max77686_data
*
max77686
=
rdev_get_drvdata
(
rdev
);
int
ret
;
switch
(
mode
)
{
switch
(
mode
)
{
case
REGULATOR_MODE_STANDBY
:
/* switch off */
case
REGULATOR_MODE_STANDBY
:
/* switch off */
...
@@ -142,10 +149,13 @@ static int max77686_ldo_set_suspend_mode(struct regulator_dev *rdev,
...
@@ -142,10 +149,13 @@ static int max77686_ldo_set_suspend_mode(struct regulator_dev *rdev,
return
-
EINVAL
;
return
-
EINVAL
;
}
}
ret
=
regmap_update_bits
(
rdev
->
regmap
,
rdev
->
desc
->
enable_reg
,
rdev
->
desc
->
enable_mask
,
val
);
if
(
ret
)
return
ret
;
max77686
->
opmode
[
rdev_get_id
(
rdev
)]
=
val
;
max77686
->
opmode
[
rdev_get_id
(
rdev
)]
=
val
;
return
regmap_update_bits
(
rdev
->
regmap
,
rdev
->
desc
->
enable_reg
,
return
0
;
rdev
->
desc
->
enable_mask
,
val
);
}
}
static
int
max77686_enable
(
struct
regulator_dev
*
rdev
)
static
int
max77686_enable
(
struct
regulator_dev
*
rdev
)
...
...
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