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
4ffc45c3
Commit
4ffc45c3
authored
Dec 11, 2012
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'regulator/topic/sm8767' into regulator-next
parents
f3cd19c3
76c854d1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
14 deletions
+26
-14
drivers/regulator/s5m8767.c
drivers/regulator/s5m8767.c
+26
-14
No files found.
drivers/regulator/s5m8767.c
View file @
4ffc45c3
...
...
@@ -168,7 +168,7 @@ static unsigned int s5m8767_opmode_reg[][4] = {
static
int
s5m8767_get_register
(
struct
regulator_dev
*
rdev
,
int
*
reg
,
int
*
enable_ctrl
)
{
int
reg_id
=
rdev_get_id
(
rdev
);
int
i
,
reg_id
=
rdev_get_id
(
rdev
);
unsigned
int
mode
;
struct
s5m8767_info
*
s5m8767
=
rdev_get_drvdata
(
rdev
);
...
...
@@ -195,8 +195,17 @@ static int s5m8767_get_register(struct regulator_dev *rdev, int *reg,
return
-
EINVAL
;
}
mode
=
s5m8767
->
opmode
[
reg_id
].
mode
;
*
enable_ctrl
=
s5m8767_opmode_reg
[
reg_id
][
mode
]
<<
S5M8767_ENCTRL_SHIFT
;
for
(
i
=
0
;
i
<
s5m8767
->
num_regulators
;
i
++
)
{
if
(
s5m8767
->
opmode
[
i
].
id
==
reg_id
)
{
mode
=
s5m8767
->
opmode
[
i
].
mode
;
break
;
}
}
if
(
i
<
s5m8767
->
num_regulators
)
*
enable_ctrl
=
s5m8767_opmode_reg
[
reg_id
][
mode
]
<<
S5M8767_ENCTRL_SHIFT
;
return
0
;
}
...
...
@@ -263,17 +272,17 @@ static int s5m8767_get_voltage_register(struct regulator_dev *rdev, int *_reg)
reg
=
S5M8767_REG_BUCK1CTRL2
;
break
;
case
S5M8767_BUCK2
:
reg
=
S5M8767_REG_BUCK2DVS
2
;
reg
=
S5M8767_REG_BUCK2DVS
1
;
if
(
s5m8767
->
buck2_gpiodvs
)
reg
+=
s5m8767
->
buck_gpioindex
;
break
;
case
S5M8767_BUCK3
:
reg
=
S5M8767_REG_BUCK3DVS
2
;
reg
=
S5M8767_REG_BUCK3DVS
1
;
if
(
s5m8767
->
buck3_gpiodvs
)
reg
+=
s5m8767
->
buck_gpioindex
;
break
;
case
S5M8767_BUCK4
:
reg
=
S5M8767_REG_BUCK4DVS
2
;
reg
=
S5M8767_REG_BUCK4DVS
1
;
if
(
s5m8767
->
buck4_gpiodvs
)
reg
+=
s5m8767
->
buck_gpioindex
;
break
;
...
...
@@ -547,7 +556,7 @@ static int s5m8767_pmic_probe(struct platform_device *pdev)
rdev
=
s5m8767
->
rdev
;
s5m8767
->
dev
=
&
pdev
->
dev
;
s5m8767
->
iodev
=
iodev
;
s5m8767
->
num_regulators
=
S5M8767_REG_MAX
-
2
;
s5m8767
->
num_regulators
=
pdata
->
num_regulators
;
platform_set_drvdata
(
pdev
,
s5m8767
);
s5m8767
->
buck_gpioindex
=
pdata
->
buck_default_idx
;
...
...
@@ -617,9 +626,16 @@ static int s5m8767_pmic_probe(struct platform_device *pdev)
}
}
if
(
gpio_is_valid
(
pdata
->
buck_gpios
[
0
])
&&
gpio_is_valid
(
pdata
->
buck_gpios
[
1
])
&&
gpio_is_valid
(
pdata
->
buck_gpios
[
2
]))
{
if
(
pdata
->
buck2_gpiodvs
||
pdata
->
buck3_gpiodvs
||
pdata
->
buck4_gpiodvs
)
{
if
(
!
gpio_is_valid
(
pdata
->
buck_gpios
[
0
])
||
!
gpio_is_valid
(
pdata
->
buck_gpios
[
1
])
||
!
gpio_is_valid
(
pdata
->
buck_gpios
[
2
]))
{
dev_err
(
&
pdev
->
dev
,
"GPIO NOT VALID
\n
"
);
return
-
EINVAL
;
}
ret
=
devm_gpio_request
(
&
pdev
->
dev
,
pdata
->
buck_gpios
[
0
],
"S5M8767 SET1"
);
if
(
ret
)
...
...
@@ -644,10 +660,6 @@ static int s5m8767_pmic_probe(struct platform_device *pdev)
/* SET3 GPIO */
gpio_direction_output
(
pdata
->
buck_gpios
[
2
],
(
s5m8767
->
buck_gpioindex
>>
0
)
&
0x1
);
}
else
{
dev_err
(
&
pdev
->
dev
,
"GPIO NOT VALID
\n
"
);
ret
=
-
EINVAL
;
return
ret
;
}
ret
=
devm_gpio_request
(
&
pdev
->
dev
,
pdata
->
buck_ds
[
0
],
"S5M8767 DS2"
);
...
...
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