Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
6a244cad
K
Kernel
项目概览
openeuler
/
Kernel
大约 1 年 前同步成功
通知
6
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,发现更多精彩内容 >>
提交
6a244cad
编写于
2月 19, 2013
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'regulator/topic/max8997' into regulator-next
上级
1fe23017
b79ca051
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
20 addition
and
61 deletion
+20
-61
drivers/regulator/max8997.c
drivers/regulator/max8997.c
+20
-61
未找到文件。
drivers/regulator/max8997.c
浏览文件 @
6a244cad
...
...
@@ -54,6 +54,13 @@ struct max8997_data {
u8
saved_states
[
MAX8997_REG_MAX
];
};
static
const
unsigned
int
safeoutvolt
[]
=
{
4850000
,
4900000
,
4950000
,
3300000
,
};
static
inline
void
max8997_set_gpio
(
struct
max8997_data
*
max8997
)
{
int
set3
=
(
max8997
->
buck125_gpioindex
)
&
0x1
;
...
...
@@ -130,29 +137,6 @@ static const struct voltage_map_desc *reg_voltage_map[] = {
[
MAX8997_CHARGER_TOPOFF
]
=
&
topoff_current_map_desc
,
};
static
int
max8997_list_voltage_safeout
(
struct
regulator_dev
*
rdev
,
unsigned
int
selector
)
{
int
rid
=
rdev_get_id
(
rdev
);
if
(
rid
==
MAX8997_ESAFEOUT1
||
rid
==
MAX8997_ESAFEOUT2
)
{
switch
(
selector
)
{
case
0
:
return
4850000
;
case
1
:
return
4900000
;
case
2
:
return
4950000
;
case
3
:
return
3300000
;
default:
return
-
EINVAL
;
}
}
return
-
EINVAL
;
}
static
int
max8997_list_voltage_charger_cv
(
struct
regulator_dev
*
rdev
,
unsigned
int
selector
)
{
...
...
@@ -522,7 +506,7 @@ static int max8997_set_voltage_ldobuck(struct regulator_dev *rdev,
return
ret
;
}
static
int
max8997_set_voltage_
ldo
buck_time_sel
(
struct
regulator_dev
*
rdev
,
static
int
max8997_set_voltage_buck_time_sel
(
struct
regulator_dev
*
rdev
,
unsigned
int
old_selector
,
unsigned
int
new_selector
)
{
...
...
@@ -720,49 +704,23 @@ static int max8997_set_voltage_buck(struct regulator_dev *rdev,
return
0
;
}
static
const
int
safeoutvolt
[]
=
{
3300000
,
4850000
,
4900000
,
4950000
,
};
/* For SAFEOUT1 and SAFEOUT2 */
static
int
max8997_set_voltage_safeout
(
struct
regulator_dev
*
rdev
,
int
min_uV
,
int
max_uV
,
unsigned
*
selector
)
static
int
max8997_set_voltage_safeout
_sel
(
struct
regulator_dev
*
rdev
,
unsigned
selector
)
{
struct
max8997_data
*
max8997
=
rdev_get_drvdata
(
rdev
);
struct
i2c_client
*
i2c
=
max8997
->
iodev
->
i2c
;
int
rid
=
rdev_get_id
(
rdev
);
int
reg
,
shift
=
0
,
mask
,
ret
;
int
i
=
0
;
u8
val
;
if
(
rid
!=
MAX8997_ESAFEOUT1
&&
rid
!=
MAX8997_ESAFEOUT2
)
return
-
EINVAL
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
safeoutvolt
);
i
++
)
{
if
(
min_uV
<=
safeoutvolt
[
i
]
&&
max_uV
>=
safeoutvolt
[
i
])
break
;
}
if
(
i
>=
ARRAY_SIZE
(
safeoutvolt
))
return
-
EINVAL
;
if
(
i
==
0
)
val
=
0x3
;
else
val
=
i
-
1
;
ret
=
max8997_get_voltage_register
(
rdev
,
&
reg
,
&
shift
,
&
mask
);
if
(
ret
)
return
ret
;
ret
=
max8997_update_reg
(
i2c
,
reg
,
val
<<
shift
,
mask
<<
shift
);
*
selector
=
val
;
return
ret
;
return
max8997_update_reg
(
i2c
,
reg
,
selector
<<
shift
,
mask
<<
shift
);
}
static
int
max8997_reg_disable_suspend
(
struct
regulator_dev
*
rdev
)
...
...
@@ -799,7 +757,6 @@ static struct regulator_ops max8997_ldo_ops = {
.
disable
=
max8997_reg_disable
,
.
get_voltage_sel
=
max8997_get_voltage_sel
,
.
set_voltage
=
max8997_set_voltage_ldobuck
,
.
set_voltage_time_sel
=
max8997_set_voltage_ldobuck_time_sel
,
.
set_suspend_disable
=
max8997_reg_disable_suspend
,
};
...
...
@@ -810,7 +767,7 @@ static struct regulator_ops max8997_buck_ops = {
.
disable
=
max8997_reg_disable
,
.
get_voltage_sel
=
max8997_get_voltage_sel
,
.
set_voltage
=
max8997_set_voltage_buck
,
.
set_voltage_time_sel
=
max8997_set_voltage_
ldo
buck_time_sel
,
.
set_voltage_time_sel
=
max8997_set_voltage_buck_time_sel
,
.
set_suspend_disable
=
max8997_reg_disable_suspend
,
};
...
...
@@ -823,12 +780,12 @@ static struct regulator_ops max8997_fixedvolt_ops = {
};
static
struct
regulator_ops
max8997_safeout_ops
=
{
.
list_voltage
=
max8997_list_voltage_safeout
,
.
list_voltage
=
regulator_list_voltage_table
,
.
is_enabled
=
max8997_reg_is_enabled
,
.
enable
=
max8997_reg_enable
,
.
disable
=
max8997_reg_disable
,
.
get_voltage_sel
=
max8997_get_voltage_sel
,
.
set_voltage
=
max8997_set_voltage_safeout
,
.
set_voltage
_sel
=
max8997_set_voltage_safeout_sel
,
.
set_suspend_disable
=
max8997_reg_disable_suspend
,
};
...
...
@@ -1233,13 +1190,15 @@ static int max8997_pmic_probe(struct platform_device *pdev)
int
id
=
pdata
->
regulators
[
i
].
id
;
desc
=
reg_voltage_map
[
id
];
if
(
desc
)
if
(
desc
)
{
regulators
[
id
].
n_voltages
=
(
desc
->
max
-
desc
->
min
)
/
desc
->
step
+
1
;
else
if
(
id
==
MAX8997_ESAFEOUT1
||
id
==
MAX8997_ESAFEOUT2
)
regulators
[
id
].
n_voltages
=
4
;
else
if
(
id
==
MAX8997_CHARGER_CV
)
}
else
if
(
id
==
MAX8997_ESAFEOUT1
||
id
==
MAX8997_ESAFEOUT2
)
{
regulators
[
id
].
volt_table
=
safeoutvolt
;
regulators
[
id
].
n_voltages
=
ARRAY_SIZE
(
safeoutvolt
);
}
else
if
(
id
==
MAX8997_CHARGER_CV
)
{
regulators
[
id
].
n_voltages
=
16
;
}
config
.
dev
=
max8997
->
dev
;
config
.
init_data
=
pdata
->
regulators
[
i
].
initdata
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录