Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
c6318467
K
Kernel
项目概览
openeuler
/
Kernel
12 个月 前同步成功
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c6318467
编写于
1月 15, 2013
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'regulator/fix/max8997' into tmp
上级
a1ed63f4
bc3b7756
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
17 addition
and
19 deletion
+17
-19
drivers/regulator/max8997.c
drivers/regulator/max8997.c
+17
-19
未找到文件。
drivers/regulator/max8997.c
浏览文件 @
c6318467
...
...
@@ -71,26 +71,26 @@ struct voltage_map_desc {
int
step
;
};
/* Voltage maps in
m
V */
/* Voltage maps in
u
V */
static
const
struct
voltage_map_desc
ldo_voltage_map_desc
=
{
.
min
=
800
,
.
max
=
3950
,
.
step
=
5
0
,
.
min
=
800
000
,
.
max
=
3950000
,
.
step
=
5000
0
,
};
/* LDO1 ~ 18, 21 all */
static
const
struct
voltage_map_desc
buck1245_voltage_map_desc
=
{
.
min
=
650
,
.
max
=
2225
,
.
step
=
25
,
.
min
=
650
000
,
.
max
=
2225000
,
.
step
=
25000
,
};
/* Buck1, 2, 4, 5 */
static
const
struct
voltage_map_desc
buck37_voltage_map_desc
=
{
.
min
=
750
,
.
max
=
3900
,
.
step
=
5
0
,
.
min
=
750
000
,
.
max
=
3900000
,
.
step
=
5000
0
,
};
/* Buck3, 7 */
/* current map in
m
A */
/* current map in
u
A */
static
const
struct
voltage_map_desc
charger_current_map_desc
=
{
.
min
=
200
,
.
max
=
950
,
.
step
=
5
0
,
.
min
=
200
000
,
.
max
=
950000
,
.
step
=
5000
0
,
};
static
const
struct
voltage_map_desc
topoff_current_map_desc
=
{
.
min
=
50
,
.
max
=
200
,
.
step
=
1
0
,
.
min
=
50
000
,
.
max
=
200000
,
.
step
=
1000
0
,
};
static
const
struct
voltage_map_desc
*
reg_voltage_map
[]
=
{
...
...
@@ -194,7 +194,7 @@ static int max8997_list_voltage(struct regulator_dev *rdev,
if
(
val
>
desc
->
max
)
return
-
EINVAL
;
return
val
*
1000
;
return
val
;
}
static
int
max8997_get_enable_register
(
struct
regulator_dev
*
rdev
,
...
...
@@ -485,7 +485,6 @@ static int max8997_set_voltage_ldobuck(struct regulator_dev *rdev,
{
struct
max8997_data
*
max8997
=
rdev_get_drvdata
(
rdev
);
struct
i2c_client
*
i2c
=
max8997
->
iodev
->
i2c
;
int
min_vol
=
min_uV
/
1000
,
max_vol
=
max_uV
/
1000
;
const
struct
voltage_map_desc
*
desc
;
int
rid
=
rdev_get_id
(
rdev
);
int
i
,
reg
,
shift
,
mask
,
ret
;
...
...
@@ -509,7 +508,7 @@ static int max8997_set_voltage_ldobuck(struct regulator_dev *rdev,
desc
=
reg_voltage_map
[
rid
];
i
=
max8997_get_voltage_proper_val
(
desc
,
min_
vol
,
max_vol
);
i
=
max8997_get_voltage_proper_val
(
desc
,
min_
uV
,
max_uV
);
if
(
i
<
0
)
return
i
;
...
...
@@ -557,7 +556,7 @@ static int max8997_set_voltage_ldobuck_time_sel(struct regulator_dev *rdev,
case
MAX8997_BUCK4
:
case
MAX8997_BUCK5
:
return
DIV_ROUND_UP
(
desc
->
step
*
(
new_selector
-
old_selector
),
max8997
->
ramp_delay
);
max8997
->
ramp_delay
*
1000
);
}
return
0
;
...
...
@@ -656,7 +655,6 @@ static int max8997_set_voltage_buck(struct regulator_dev *rdev,
const
struct
voltage_map_desc
*
desc
;
int
new_val
,
new_idx
,
damage
,
tmp_val
,
tmp_idx
,
tmp_dmg
;
bool
gpio_dvs_mode
=
false
;
int
min_vol
=
min_uV
/
1000
,
max_vol
=
max_uV
/
1000
;
if
(
rid
<
MAX8997_BUCK1
||
rid
>
MAX8997_BUCK7
)
return
-
EINVAL
;
...
...
@@ -681,7 +679,7 @@ static int max8997_set_voltage_buck(struct regulator_dev *rdev,
selector
);
desc
=
reg_voltage_map
[
rid
];
new_val
=
max8997_get_voltage_proper_val
(
desc
,
min_
vol
,
max_vol
);
new_val
=
max8997_get_voltage_proper_val
(
desc
,
min_
uV
,
max_uV
);
if
(
new_val
<
0
)
return
new_val
;
...
...
@@ -1123,8 +1121,8 @@ static int max8997_pmic_probe(struct platform_device *pdev)
max8997
->
buck1_vol
[
i
]
=
ret
=
max8997_get_voltage_proper_val
(
&
buck1245_voltage_map_desc
,
pdata
->
buck1_voltage
[
i
]
/
1000
,
pdata
->
buck1_voltage
[
i
]
/
1000
+
pdata
->
buck1_voltage
[
i
],
pdata
->
buck1_voltage
[
i
]
+
buck1245_voltage_map_desc
.
step
);
if
(
ret
<
0
)
goto
err_out
;
...
...
@@ -1132,8 +1130,8 @@ static int max8997_pmic_probe(struct platform_device *pdev)
max8997
->
buck2_vol
[
i
]
=
ret
=
max8997_get_voltage_proper_val
(
&
buck1245_voltage_map_desc
,
pdata
->
buck2_voltage
[
i
]
/
1000
,
pdata
->
buck2_voltage
[
i
]
/
1000
+
pdata
->
buck2_voltage
[
i
],
pdata
->
buck2_voltage
[
i
]
+
buck1245_voltage_map_desc
.
step
);
if
(
ret
<
0
)
goto
err_out
;
...
...
@@ -1141,8 +1139,8 @@ static int max8997_pmic_probe(struct platform_device *pdev)
max8997
->
buck5_vol
[
i
]
=
ret
=
max8997_get_voltage_proper_val
(
&
buck1245_voltage_map_desc
,
pdata
->
buck5_voltage
[
i
]
/
1000
,
pdata
->
buck5_voltage
[
i
]
/
1000
+
pdata
->
buck5_voltage
[
i
],
pdata
->
buck5_voltage
[
i
]
+
buck1245_voltage_map_desc
.
step
);
if
(
ret
<
0
)
goto
err_out
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录