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
67471b6a
Commit
67471b6a
authored
Oct 24, 2013
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'regulator/topic/s5m8767' into regulator-next
parents
22eb85ad
04f9f068
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
22 deletions
+40
-22
drivers/regulator/s5m8767.c
drivers/regulator/s5m8767.c
+40
-22
No files found.
drivers/regulator/s5m8767.c
View file @
67471b6a
...
...
@@ -522,7 +522,7 @@ static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev,
struct
device_node
*
pmic_np
,
*
regulators_np
,
*
reg_np
;
struct
sec_regulator_data
*
rdata
;
struct
sec_opmode_data
*
rmode
;
unsigned
int
i
,
dvs_voltage_nr
=
1
,
ret
;
unsigned
int
i
,
dvs_voltage_nr
=
8
,
ret
;
pmic_np
=
iodev
->
dev
->
of_node
;
if
(
!
pmic_np
)
{
...
...
@@ -586,15 +586,39 @@ static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev,
rmode
++
;
}
if
(
of_get_property
(
pmic_np
,
"s5m8767,pmic-buck2-uses-gpio-dvs"
,
NULL
))
if
(
of_get_property
(
pmic_np
,
"s5m8767,pmic-buck2-uses-gpio-dvs"
,
NULL
))
{
pdata
->
buck2_gpiodvs
=
true
;
if
(
of_get_property
(
pmic_np
,
"s5m8767,pmic-buck3-uses-gpio-dvs"
,
NULL
))
if
(
of_property_read_u32_array
(
pmic_np
,
"s5m8767,pmic-buck2-dvs-voltage"
,
pdata
->
buck2_voltage
,
dvs_voltage_nr
))
{
dev_err
(
iodev
->
dev
,
"buck2 voltages not specified
\n
"
);
return
-
EINVAL
;
}
}
if
(
of_get_property
(
pmic_np
,
"s5m8767,pmic-buck3-uses-gpio-dvs"
,
NULL
))
{
pdata
->
buck3_gpiodvs
=
true
;
if
(
of_get_property
(
pmic_np
,
"s5m8767,pmic-buck4-uses-gpio-dvs"
,
NULL
))
if
(
of_property_read_u32_array
(
pmic_np
,
"s5m8767,pmic-buck3-dvs-voltage"
,
pdata
->
buck3_voltage
,
dvs_voltage_nr
))
{
dev_err
(
iodev
->
dev
,
"buck3 voltages not specified
\n
"
);
return
-
EINVAL
;
}
}
if
(
of_get_property
(
pmic_np
,
"s5m8767,pmic-buck4-uses-gpio-dvs"
,
NULL
))
{
pdata
->
buck4_gpiodvs
=
true
;
if
(
of_property_read_u32_array
(
pmic_np
,
"s5m8767,pmic-buck4-dvs-voltage"
,
pdata
->
buck4_voltage
,
dvs_voltage_nr
))
{
dev_err
(
iodev
->
dev
,
"buck4 voltages not specified
\n
"
);
return
-
EINVAL
;
}
}
if
(
pdata
->
buck2_gpiodvs
||
pdata
->
buck3_gpiodvs
||
pdata
->
buck4_gpiodvs
)
{
ret
=
s5m8767_pmic_dt_parse_dvs_gpio
(
iodev
,
pdata
,
pmic_np
);
...
...
@@ -612,32 +636,26 @@ static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev,
"invalid value for default dvs index, use 0
\n
"
);
}
}
dvs_voltage_nr
=
8
;
}
ret
=
s5m8767_pmic_dt_parse_ds_gpio
(
iodev
,
pdata
,
pmic_np
);
if
(
ret
)
return
-
EINVAL
;
if
(
of_property_read_u32_array
(
pmic_np
,
"s5m8767,pmic-buck2-dvs-voltage"
,
pdata
->
buck2_voltage
,
dvs_voltage_nr
))
{
dev_err
(
iodev
->
dev
,
"buck2 voltages not specified
\n
"
);
return
-
EINVAL
;
}
if
(
of_get_property
(
pmic_np
,
"s5m8767,pmic-buck2-ramp-enable"
,
NULL
))
pdata
->
buck2_ramp_enable
=
true
;
if
(
of_property_read_u32_array
(
pmic_np
,
"s5m8767,pmic-buck3-dvs-voltage"
,
pdata
->
buck3_voltage
,
dvs_voltage_nr
))
{
dev_err
(
iodev
->
dev
,
"buck3 voltages not specified
\n
"
);
return
-
EINVAL
;
}
if
(
of_get_property
(
pmic_np
,
"s5m8767,pmic-buck3-ramp-enable"
,
NULL
))
pdata
->
buck3_ramp_enable
=
true
;
if
(
of_property_read_u32_array
(
pmic_np
,
"s5m8767,pmic-buck4-dvs-voltage"
,
pdata
->
buck4_voltage
,
dvs_voltage_nr
))
{
dev_err
(
iodev
->
dev
,
"buck4 voltages not specified
\n
"
);
return
-
EINVAL
;
if
(
of_get_property
(
pmic_np
,
"s5m8767,pmic-buck4-ramp-enable"
,
NULL
))
pdata
->
buck4_ramp_enable
=
true
;
if
(
pdata
->
buck2_ramp_enable
||
pdata
->
buck3_ramp_enable
||
pdata
->
buck4_ramp_enable
)
{
if
(
of_property_read_u32
(
pmic_np
,
"s5m8767,pmic-buck-ramp-delay"
,
&
pdata
->
buck_ramp_delay
))
pdata
->
buck_ramp_delay
=
0
;
}
return
0
;
...
...
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