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
c3fda066
Commit
c3fda066
authored
Nov 24, 2013
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'regulator/fix/arizona' into regulator-linus
parents
6ce4eac1
d2e7491e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
2 deletions
+52
-2
drivers/regulator/arizona-micsupp.c
drivers/regulator/arizona-micsupp.c
+52
-2
No files found.
drivers/regulator/arizona-micsupp.c
View file @
c3fda066
...
@@ -174,6 +174,33 @@ static const struct regulator_desc arizona_micsupp = {
...
@@ -174,6 +174,33 @@ static const struct regulator_desc arizona_micsupp = {
.
owner
=
THIS_MODULE
,
.
owner
=
THIS_MODULE
,
};
};
static
const
struct
regulator_linear_range
arizona_micsupp_ext_ranges
[]
=
{
REGULATOR_LINEAR_RANGE
(
900000
,
0
,
0x14
,
25000
),
REGULATOR_LINEAR_RANGE
(
1500000
,
0x15
,
0x27
,
100000
),
};
static
const
struct
regulator_desc
arizona_micsupp_ext
=
{
.
name
=
"MICVDD"
,
.
supply_name
=
"CPVDD"
,
.
type
=
REGULATOR_VOLTAGE
,
.
n_voltages
=
40
,
.
ops
=
&
arizona_micsupp_ops
,
.
vsel_reg
=
ARIZONA_LDO2_CONTROL_1
,
.
vsel_mask
=
ARIZONA_LDO2_VSEL_MASK
,
.
enable_reg
=
ARIZONA_MIC_CHARGE_PUMP_1
,
.
enable_mask
=
ARIZONA_CPMIC_ENA
,
.
bypass_reg
=
ARIZONA_MIC_CHARGE_PUMP_1
,
.
bypass_mask
=
ARIZONA_CPMIC_BYPASS
,
.
linear_ranges
=
arizona_micsupp_ext_ranges
,
.
n_linear_ranges
=
ARRAY_SIZE
(
arizona_micsupp_ext_ranges
),
.
enable_time
=
3000
,
.
owner
=
THIS_MODULE
,
};
static
const
struct
regulator_init_data
arizona_micsupp_default
=
{
static
const
struct
regulator_init_data
arizona_micsupp_default
=
{
.
constraints
=
{
.
constraints
=
{
.
valid_ops_mask
=
REGULATOR_CHANGE_STATUS
|
.
valid_ops_mask
=
REGULATOR_CHANGE_STATUS
|
...
@@ -186,9 +213,22 @@ static const struct regulator_init_data arizona_micsupp_default = {
...
@@ -186,9 +213,22 @@ static const struct regulator_init_data arizona_micsupp_default = {
.
num_consumer_supplies
=
1
,
.
num_consumer_supplies
=
1
,
};
};
static
const
struct
regulator_init_data
arizona_micsupp_ext_default
=
{
.
constraints
=
{
.
valid_ops_mask
=
REGULATOR_CHANGE_STATUS
|
REGULATOR_CHANGE_VOLTAGE
|
REGULATOR_CHANGE_BYPASS
,
.
min_uV
=
900000
,
.
max_uV
=
3300000
,
},
.
num_consumer_supplies
=
1
,
};
static
int
arizona_micsupp_probe
(
struct
platform_device
*
pdev
)
static
int
arizona_micsupp_probe
(
struct
platform_device
*
pdev
)
{
{
struct
arizona
*
arizona
=
dev_get_drvdata
(
pdev
->
dev
.
parent
);
struct
arizona
*
arizona
=
dev_get_drvdata
(
pdev
->
dev
.
parent
);
const
struct
regulator_desc
*
desc
;
struct
regulator_config
config
=
{
};
struct
regulator_config
config
=
{
};
struct
arizona_micsupp
*
micsupp
;
struct
arizona_micsupp
*
micsupp
;
int
ret
;
int
ret
;
...
@@ -207,7 +247,17 @@ static int arizona_micsupp_probe(struct platform_device *pdev)
...
@@ -207,7 +247,17 @@ static int arizona_micsupp_probe(struct platform_device *pdev)
* default init_data for it. This will be overridden with
* default init_data for it. This will be overridden with
* platform data if provided.
* platform data if provided.
*/
*/
micsupp
->
init_data
=
arizona_micsupp_default
;
switch
(
arizona
->
type
)
{
case
WM5110
:
desc
=
&
arizona_micsupp_ext
;
micsupp
->
init_data
=
arizona_micsupp_ext_default
;
break
;
default:
desc
=
&
arizona_micsupp
;
micsupp
->
init_data
=
arizona_micsupp_default
;
break
;
}
micsupp
->
init_data
.
consumer_supplies
=
&
micsupp
->
supply
;
micsupp
->
init_data
.
consumer_supplies
=
&
micsupp
->
supply
;
micsupp
->
supply
.
supply
=
"MICVDD"
;
micsupp
->
supply
.
supply
=
"MICVDD"
;
micsupp
->
supply
.
dev_name
=
dev_name
(
arizona
->
dev
);
micsupp
->
supply
.
dev_name
=
dev_name
(
arizona
->
dev
);
...
@@ -226,7 +276,7 @@ static int arizona_micsupp_probe(struct platform_device *pdev)
...
@@ -226,7 +276,7 @@ static int arizona_micsupp_probe(struct platform_device *pdev)
ARIZONA_CPMIC_BYPASS
,
0
);
ARIZONA_CPMIC_BYPASS
,
0
);
micsupp
->
regulator
=
devm_regulator_register
(
&
pdev
->
dev
,
micsupp
->
regulator
=
devm_regulator_register
(
&
pdev
->
dev
,
&
arizona_micsupp
,
desc
,
&
config
);
&
config
);
if
(
IS_ERR
(
micsupp
->
regulator
))
{
if
(
IS_ERR
(
micsupp
->
regulator
))
{
ret
=
PTR_ERR
(
micsupp
->
regulator
);
ret
=
PTR_ERR
(
micsupp
->
regulator
);
...
...
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