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
75c8ac22
Commit
75c8ac22
authored
Jan 04, 2010
by
Mark Brown
Committed by
Liam Girdwood
Mar 03, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regulator: Implement enable_time() for WM835x ISINKs
Signed-off-by:
Mark Brown
<
broonie@opensource.wolfsonmicro.com
>
parent
31aae2be
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
+46
-0
drivers/regulator/wm8350-regulator.c
drivers/regulator/wm8350-regulator.c
+46
-0
No files found.
drivers/regulator/wm8350-regulator.c
View file @
75c8ac22
...
...
@@ -290,6 +290,51 @@ static int wm8350_isink_is_enabled(struct regulator_dev *rdev)
return
-
EINVAL
;
}
static
int
wm8350_isink_enable_time
(
struct
regulator_dev
*
rdev
)
{
struct
wm8350
*
wm8350
=
rdev_get_drvdata
(
rdev
);
int
isink
=
rdev_get_id
(
rdev
);
int
reg
;
switch
(
isink
)
{
case
WM8350_ISINK_A
:
reg
=
wm8350_reg_read
(
wm8350
,
WM8350_CSA_FLASH_CONTROL
);
break
;
case
WM8350_ISINK_B
:
reg
=
wm8350_reg_read
(
wm8350
,
WM8350_CSB_FLASH_CONTROL
);
break
;
default:
return
-
EINVAL
;
}
if
(
reg
&
WM8350_CS1_FLASH_MODE
)
{
switch
(
reg
&
WM8350_CS1_ON_RAMP_MASK
)
{
case
0
:
return
0
;
case
1
:
return
1950
;
case
2
:
return
3910
;
case
3
:
return
7800
;
}
}
else
{
switch
(
reg
&
WM8350_CS1_ON_RAMP_MASK
)
{
case
0
:
return
0
;
case
1
:
return
250000
;
case
2
:
return
500000
;
case
3
:
return
1000000
;
}
}
return
-
EINVAL
;
}
int
wm8350_isink_set_flash
(
struct
wm8350
*
wm8350
,
int
isink
,
u16
mode
,
u16
trigger
,
u16
duration
,
u16
on_ramp
,
u16
off_ramp
,
u16
drive
)
...
...
@@ -1221,6 +1266,7 @@ static struct regulator_ops wm8350_isink_ops = {
.
enable
=
wm8350_isink_enable
,
.
disable
=
wm8350_isink_disable
,
.
is_enabled
=
wm8350_isink_is_enabled
,
.
enable_time
=
wm8350_isink_enable_time
,
};
static
struct
regulator_desc
wm8350_reg
[
NUM_WM8350_REGULATORS
]
=
{
...
...
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