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
3ab91da2
Commit
3ab91da2
authored
Jan 15, 2013
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'regulator/fix/max8998' into tmp
parents
c6318467
81d0a6ae
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
22 deletions
+22
-22
drivers/regulator/max8998.c
drivers/regulator/max8998.c
+22
-22
No files found.
drivers/regulator/max8998.c
View file @
3ab91da2
...
@@ -51,39 +51,39 @@ struct voltage_map_desc {
...
@@ -51,39 +51,39 @@ struct voltage_map_desc {
int
step
;
int
step
;
};
};
/* Voltage maps */
/* Voltage maps
in uV
*/
static
const
struct
voltage_map_desc
ldo23_voltage_map_desc
=
{
static
const
struct
voltage_map_desc
ldo23_voltage_map_desc
=
{
.
min
=
800
,
.
step
=
50
,
.
max
=
13
00
,
.
min
=
800
000
,
.
step
=
50000
,
.
max
=
13000
00
,
};
};
static
const
struct
voltage_map_desc
ldo456711_voltage_map_desc
=
{
static
const
struct
voltage_map_desc
ldo456711_voltage_map_desc
=
{
.
min
=
1600
,
.
step
=
100
,
.
max
=
36
00
,
.
min
=
1600
000
,
.
step
=
100000
,
.
max
=
36000
00
,
};
};
static
const
struct
voltage_map_desc
ldo8_voltage_map_desc
=
{
static
const
struct
voltage_map_desc
ldo8_voltage_map_desc
=
{
.
min
=
3000
,
.
step
=
100
,
.
max
=
36
00
,
.
min
=
3000
000
,
.
step
=
100000
,
.
max
=
36000
00
,
};
};
static
const
struct
voltage_map_desc
ldo9_voltage_map_desc
=
{
static
const
struct
voltage_map_desc
ldo9_voltage_map_desc
=
{
.
min
=
2800
,
.
step
=
100
,
.
max
=
31
00
,
.
min
=
2800
000
,
.
step
=
100000
,
.
max
=
31000
00
,
};
};
static
const
struct
voltage_map_desc
ldo10_voltage_map_desc
=
{
static
const
struct
voltage_map_desc
ldo10_voltage_map_desc
=
{
.
min
=
950
,
.
step
=
50
,
.
max
=
13
00
,
.
min
=
950
00
,
.
step
=
50000
,
.
max
=
13000
00
,
};
};
static
const
struct
voltage_map_desc
ldo1213_voltage_map_desc
=
{
static
const
struct
voltage_map_desc
ldo1213_voltage_map_desc
=
{
.
min
=
800
,
.
step
=
100
,
.
max
=
33
00
,
.
min
=
800
000
,
.
step
=
100000
,
.
max
=
33000
00
,
};
};
static
const
struct
voltage_map_desc
ldo1415_voltage_map_desc
=
{
static
const
struct
voltage_map_desc
ldo1415_voltage_map_desc
=
{
.
min
=
1200
,
.
step
=
100
,
.
max
=
33
00
,
.
min
=
1200
000
,
.
step
=
100000
,
.
max
=
33000
00
,
};
};
static
const
struct
voltage_map_desc
ldo1617_voltage_map_desc
=
{
static
const
struct
voltage_map_desc
ldo1617_voltage_map_desc
=
{
.
min
=
1600
,
.
step
=
100
,
.
max
=
36
00
,
.
min
=
1600
000
,
.
step
=
100000
,
.
max
=
36000
00
,
};
};
static
const
struct
voltage_map_desc
buck12_voltage_map_desc
=
{
static
const
struct
voltage_map_desc
buck12_voltage_map_desc
=
{
.
min
=
750
,
.
step
=
25
,
.
max
=
1525
,
.
min
=
750
000
,
.
step
=
25000
,
.
max
=
1525000
,
};
};
static
const
struct
voltage_map_desc
buck3_voltage_map_desc
=
{
static
const
struct
voltage_map_desc
buck3_voltage_map_desc
=
{
.
min
=
1600
,
.
step
=
100
,
.
max
=
36
00
,
.
min
=
1600
000
,
.
step
=
100000
,
.
max
=
36000
00
,
};
};
static
const
struct
voltage_map_desc
buck4_voltage_map_desc
=
{
static
const
struct
voltage_map_desc
buck4_voltage_map_desc
=
{
.
min
=
800
,
.
step
=
100
,
.
max
=
23
00
,
.
min
=
800
000
,
.
step
=
100000
,
.
max
=
23000
00
,
};
};
static
const
struct
voltage_map_desc
*
ldo_voltage_map
[]
=
{
static
const
struct
voltage_map_desc
*
ldo_voltage_map
[]
=
{
...
@@ -445,9 +445,9 @@ static int max8998_set_voltage_buck_time_sel(struct regulator_dev *rdev,
...
@@ -445,9 +445,9 @@ static int max8998_set_voltage_buck_time_sel(struct regulator_dev *rdev,
if
(
max8998
->
iodev
->
type
==
TYPE_MAX8998
&&
!
(
val
&
MAX8998_ENRAMP
))
if
(
max8998
->
iodev
->
type
==
TYPE_MAX8998
&&
!
(
val
&
MAX8998_ENRAMP
))
return
0
;
return
0
;
difference
=
(
new_selector
-
old_selector
)
*
desc
->
step
;
difference
=
(
new_selector
-
old_selector
)
*
desc
->
step
/
1000
;
if
(
difference
>
0
)
if
(
difference
>
0
)
return
difference
/
(
(
val
&
0x0f
)
+
1
);
return
DIV_ROUND_UP
(
difference
,
(
val
&
0x0f
)
+
1
);
return
0
;
return
0
;
}
}
...
@@ -702,7 +702,7 @@ static int max8998_pmic_probe(struct platform_device *pdev)
...
@@ -702,7 +702,7 @@ static int max8998_pmic_probe(struct platform_device *pdev)
i
=
0
;
i
=
0
;
while
(
buck12_voltage_map_desc
.
min
+
while
(
buck12_voltage_map_desc
.
min
+
buck12_voltage_map_desc
.
step
*
i
buck12_voltage_map_desc
.
step
*
i
<
(
pdata
->
buck1_voltage1
/
1000
)
)
<
pdata
->
buck1_voltage1
)
i
++
;
i
++
;
max8998
->
buck1_vol
[
0
]
=
i
;
max8998
->
buck1_vol
[
0
]
=
i
;
ret
=
max8998_write_reg
(
i2c
,
MAX8998_REG_BUCK1_VOLTAGE1
,
i
);
ret
=
max8998_write_reg
(
i2c
,
MAX8998_REG_BUCK1_VOLTAGE1
,
i
);
...
@@ -713,7 +713,7 @@ static int max8998_pmic_probe(struct platform_device *pdev)
...
@@ -713,7 +713,7 @@ static int max8998_pmic_probe(struct platform_device *pdev)
i
=
0
;
i
=
0
;
while
(
buck12_voltage_map_desc
.
min
+
while
(
buck12_voltage_map_desc
.
min
+
buck12_voltage_map_desc
.
step
*
i
buck12_voltage_map_desc
.
step
*
i
<
(
pdata
->
buck1_voltage2
/
1000
)
)
<
pdata
->
buck1_voltage2
)
i
++
;
i
++
;
max8998
->
buck1_vol
[
1
]
=
i
;
max8998
->
buck1_vol
[
1
]
=
i
;
...
@@ -725,7 +725,7 @@ static int max8998_pmic_probe(struct platform_device *pdev)
...
@@ -725,7 +725,7 @@ static int max8998_pmic_probe(struct platform_device *pdev)
i
=
0
;
i
=
0
;
while
(
buck12_voltage_map_desc
.
min
+
while
(
buck12_voltage_map_desc
.
min
+
buck12_voltage_map_desc
.
step
*
i
buck12_voltage_map_desc
.
step
*
i
<
(
pdata
->
buck1_voltage3
/
1000
)
)
<
pdata
->
buck1_voltage3
)
i
++
;
i
++
;
max8998
->
buck1_vol
[
2
]
=
i
;
max8998
->
buck1_vol
[
2
]
=
i
;
...
@@ -737,7 +737,7 @@ static int max8998_pmic_probe(struct platform_device *pdev)
...
@@ -737,7 +737,7 @@ static int max8998_pmic_probe(struct platform_device *pdev)
i
=
0
;
i
=
0
;
while
(
buck12_voltage_map_desc
.
min
+
while
(
buck12_voltage_map_desc
.
min
+
buck12_voltage_map_desc
.
step
*
i
buck12_voltage_map_desc
.
step
*
i
<
(
pdata
->
buck1_voltage4
/
1000
)
)
<
pdata
->
buck1_voltage4
)
i
++
;
i
++
;
max8998
->
buck1_vol
[
3
]
=
i
;
max8998
->
buck1_vol
[
3
]
=
i
;
...
@@ -763,7 +763,7 @@ static int max8998_pmic_probe(struct platform_device *pdev)
...
@@ -763,7 +763,7 @@ static int max8998_pmic_probe(struct platform_device *pdev)
i
=
0
;
i
=
0
;
while
(
buck12_voltage_map_desc
.
min
+
while
(
buck12_voltage_map_desc
.
min
+
buck12_voltage_map_desc
.
step
*
i
buck12_voltage_map_desc
.
step
*
i
<
(
pdata
->
buck2_voltage1
/
1000
)
)
<
pdata
->
buck2_voltage1
)
i
++
;
i
++
;
max8998
->
buck2_vol
[
0
]
=
i
;
max8998
->
buck2_vol
[
0
]
=
i
;
ret
=
max8998_write_reg
(
i2c
,
MAX8998_REG_BUCK2_VOLTAGE1
,
i
);
ret
=
max8998_write_reg
(
i2c
,
MAX8998_REG_BUCK2_VOLTAGE1
,
i
);
...
@@ -774,7 +774,7 @@ static int max8998_pmic_probe(struct platform_device *pdev)
...
@@ -774,7 +774,7 @@ static int max8998_pmic_probe(struct platform_device *pdev)
i
=
0
;
i
=
0
;
while
(
buck12_voltage_map_desc
.
min
+
while
(
buck12_voltage_map_desc
.
min
+
buck12_voltage_map_desc
.
step
*
i
buck12_voltage_map_desc
.
step
*
i
<
(
pdata
->
buck2_voltage2
/
1000
)
)
<
pdata
->
buck2_voltage2
)
i
++
;
i
++
;
max8998
->
buck2_vol
[
1
]
=
i
;
max8998
->
buck2_vol
[
1
]
=
i
;
ret
=
max8998_write_reg
(
i2c
,
MAX8998_REG_BUCK2_VOLTAGE2
,
i
);
ret
=
max8998_write_reg
(
i2c
,
MAX8998_REG_BUCK2_VOLTAGE2
,
i
);
...
@@ -792,8 +792,8 @@ static int max8998_pmic_probe(struct platform_device *pdev)
...
@@ -792,8 +792,8 @@ static int max8998_pmic_probe(struct platform_device *pdev)
int
count
=
(
desc
->
max
-
desc
->
min
)
/
desc
->
step
+
1
;
int
count
=
(
desc
->
max
-
desc
->
min
)
/
desc
->
step
+
1
;
regulators
[
index
].
n_voltages
=
count
;
regulators
[
index
].
n_voltages
=
count
;
regulators
[
index
].
min_uV
=
desc
->
min
*
1000
;
regulators
[
index
].
min_uV
=
desc
->
min
;
regulators
[
index
].
uV_step
=
desc
->
step
*
1000
;
regulators
[
index
].
uV_step
=
desc
->
step
;
}
}
config
.
dev
=
max8998
->
dev
;
config
.
dev
=
max8998
->
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