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
a8afa92e
Commit
a8afa92e
authored
Aug 10, 2018
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'regulator-4.18' into regulator-linus
parents
1ffaddd0
a9191579
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
3 deletions
+24
-3
drivers/regulator/arizona-ldo1.c
drivers/regulator/arizona-ldo1.c
+24
-3
No files found.
drivers/regulator/arizona-ldo1.c
View file @
a8afa92e
...
...
@@ -36,6 +36,8 @@ struct arizona_ldo1 {
struct
regulator_consumer_supply
supply
;
struct
regulator_init_data
init_data
;
struct
gpio_desc
*
ena_gpiod
;
};
static
int
arizona_ldo1_hc_list_voltage
(
struct
regulator_dev
*
rdev
,
...
...
@@ -253,12 +255,17 @@ static int arizona_ldo1_common_init(struct platform_device *pdev,
}
}
/* We assume that high output = regulator off */
config
.
ena_gpiod
=
devm_gpiod_get_optional
(
&
pdev
->
dev
,
"wlf,ldoena"
,
GPIOD_OUT_HIGH
);
/* We assume that high output = regulator off
* Don't use devm, since we need to get against the parent device
* so clean up would happen at the wrong time
*/
config
.
ena_gpiod
=
gpiod_get_optional
(
parent_dev
,
"wlf,ldoena"
,
GPIOD_OUT_LOW
);
if
(
IS_ERR
(
config
.
ena_gpiod
))
return
PTR_ERR
(
config
.
ena_gpiod
);
ldo1
->
ena_gpiod
=
config
.
ena_gpiod
;
if
(
pdata
->
init_data
)
config
.
init_data
=
pdata
->
init_data
;
else
...
...
@@ -276,6 +283,9 @@ static int arizona_ldo1_common_init(struct platform_device *pdev,
of_node_put
(
config
.
of_node
);
if
(
IS_ERR
(
ldo1
->
regulator
))
{
if
(
config
.
ena_gpiod
)
gpiod_put
(
config
.
ena_gpiod
);
ret
=
PTR_ERR
(
ldo1
->
regulator
);
dev_err
(
&
pdev
->
dev
,
"Failed to register LDO1 supply: %d
\n
"
,
ret
);
...
...
@@ -334,8 +344,19 @@ static int arizona_ldo1_probe(struct platform_device *pdev)
return
ret
;
}
static
int
arizona_ldo1_remove
(
struct
platform_device
*
pdev
)
{
struct
arizona_ldo1
*
ldo1
=
platform_get_drvdata
(
pdev
);
if
(
ldo1
->
ena_gpiod
)
gpiod_put
(
ldo1
->
ena_gpiod
);
return
0
;
}
static
struct
platform_driver
arizona_ldo1_driver
=
{
.
probe
=
arizona_ldo1_probe
,
.
remove
=
arizona_ldo1_remove
,
.
driver
=
{
.
name
=
"arizona-ldo1"
,
},
...
...
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