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
Kirill Smelkov
linux
Commits
813dc1b0
Commit
813dc1b0
authored
Apr 28, 2013
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'regulator/topic/tps65023' into v3.9-rc8
parents
22a712b9
46bcb006
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
22 deletions
+9
-22
drivers/regulator/tps65023-regulator.c
drivers/regulator/tps65023-regulator.c
+9
-22
No files found.
drivers/regulator/tps65023-regulator.c
View file @
813dc1b0
...
...
@@ -149,20 +149,15 @@ struct tps_driver_data {
static
int
tps65023_dcdc_get_voltage_sel
(
struct
regulator_dev
*
dev
)
{
struct
tps_pmic
*
tps
=
rdev_get_drvdata
(
dev
);
int
ret
;
int
data
,
dcdc
=
rdev_get_id
(
dev
);
int
dcdc
=
rdev_get_id
(
dev
);
if
(
dcdc
<
TPS65023_DCDC_1
||
dcdc
>
TPS65023_DCDC_3
)
return
-
EINVAL
;
if
(
dcdc
==
tps
->
core_regulator
)
{
ret
=
regmap_read
(
tps
->
regmap
,
TPS65023_REG_DEF_CORE
,
&
data
);
if
(
ret
!=
0
)
return
ret
;
data
&=
(
tps
->
info
[
dcdc
]
->
table_len
-
1
);
return
data
;
}
else
if
(
dcdc
!=
tps
->
core_regulator
)
return
0
;
return
regulator_get_voltage_sel_regmap
(
dev
);
}
static
int
tps65023_dcdc_set_voltage_sel
(
struct
regulator_dev
*
dev
,
...
...
@@ -170,23 +165,11 @@ static int tps65023_dcdc_set_voltage_sel(struct regulator_dev *dev,
{
struct
tps_pmic
*
tps
=
rdev_get_drvdata
(
dev
);
int
dcdc
=
rdev_get_id
(
dev
);
int
ret
;
if
(
dcdc
!=
tps
->
core_regulator
)
return
-
EINVAL
;
ret
=
regmap_write
(
tps
->
regmap
,
TPS65023_REG_DEF_CORE
,
selector
);
if
(
ret
)
goto
out
;
/* Tell the chip that we have changed the value in DEFCORE
* and its time to update the core voltage
*/
ret
=
regmap_update_bits
(
tps
->
regmap
,
TPS65023_REG_CON_CTRL2
,
TPS65023_REG_CTRL2_GO
,
TPS65023_REG_CTRL2_GO
);
out:
return
ret
;
return
regulator_set_voltage_sel_regmap
(
dev
,
selector
);
}
/* Operations permitted on VDCDCx */
...
...
@@ -282,6 +265,10 @@ static int tps_65023_probe(struct i2c_client *client,
default:
/* DCDCx */
tps
->
desc
[
i
].
enable_mask
=
1
<<
(
TPS65023_NUM_REGULATOR
-
i
);
tps
->
desc
[
i
].
vsel_reg
=
TPS65023_REG_DEF_CORE
;
tps
->
desc
[
i
].
vsel_mask
=
info
->
table_len
-
1
;
tps
->
desc
[
i
].
apply_reg
=
TPS65023_REG_CON_CTRL2
;
tps
->
desc
[
i
].
apply_bit
=
TPS65023_REG_CTRL2_GO
;
}
config
.
dev
=
&
client
->
dev
;
...
...
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