Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
32e40be1
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
32e40be1
编写于
4月 28, 2013
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'regulator/topic/tps80031' into v3.9-rc8
上级
64dceea4
bc49c87e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
24 addition
and
21 deletion
+24
-21
drivers/regulator/tps80031-regulator.c
drivers/regulator/tps80031-regulator.c
+24
-21
未找到文件。
drivers/regulator/tps80031-regulator.c
浏览文件 @
32e40be1
...
...
@@ -238,12 +238,11 @@ static int tps80031_dcdc_get_voltage_sel(struct regulator_dev *rdev)
return
vsel
&
SMPS_VSEL_MASK
;
}
static
int
tps80031_ldo_
set_voltage_sel
(
struct
regulator_dev
*
rdev
,
unsigned
sel
)
static
int
tps80031_ldo_
list_voltage
(
struct
regulator_dev
*
rdev
,
unsigned
int
sel
)
{
struct
tps80031_regulator
*
ri
=
rdev_get_drvdata
(
rdev
);
struct
device
*
parent
=
to_tps80031_dev
(
rdev
);
int
ret
;
/* Check for valid setting for TPS80031 or TPS80032-ES1.0 */
if
((
ri
->
rinfo
->
desc
.
id
==
TPS80031_REGULATOR_LDO2
)
&&
...
...
@@ -260,28 +259,27 @@ static int tps80031_ldo_set_voltage_sel(struct regulator_dev *rdev,
}
}
ret
=
tps80031_write
(
parent
,
ri
->
rinfo
->
volt_id
,
ri
->
rinfo
->
volt_reg
,
sel
);
if
(
ret
<
0
)
dev_err
(
ri
->
dev
,
"Error in writing reg 0x%02x, e = %d
\n
"
,
ri
->
rinfo
->
volt_reg
,
ret
);
return
ret
;
return
regulator_list_voltage_linear
(
rdev
,
sel
);
}
static
int
tps80031_ldo_get_voltage_sel
(
struct
regulator_dev
*
rdev
)
static
int
tps80031_ldo_map_voltage
(
struct
regulator_dev
*
rdev
,
int
min_uV
,
int
max_uV
)
{
struct
tps80031_regulator
*
ri
=
rdev_get_drvdata
(
rdev
);
struct
device
*
parent
=
to_tps80031_dev
(
rdev
);
uint8_t
vsel
;
int
ret
;
ret
=
tps80031_read
(
parent
,
ri
->
rinfo
->
volt_id
,
ri
->
rinfo
->
volt_reg
,
&
vsel
);
if
(
ret
<
0
)
{
dev_err
(
ri
->
dev
,
"Error in writing the Voltage register
\n
"
);
return
ret
;
/* Check for valid setting for TPS80031 or TPS80032-ES1.0 */
if
((
ri
->
rinfo
->
desc
.
id
==
TPS80031_REGULATOR_LDO2
)
&&
(
ri
->
device_flags
&
TRACK_MODE_ENABLE
))
{
if
(((
tps80031_get_chip_info
(
parent
)
==
TPS80031
)
||
((
tps80031_get_chip_info
(
parent
)
==
TPS80032
)
&&
(
tps80031_get_pmu_version
(
parent
)
==
0x0
))))
{
return
regulator_map_voltage_iterate
(
rdev
,
min_uV
,
max_uV
);
}
}
return
vsel
&
rdev
->
desc
->
vsel_mask
;
return
regulator_map_voltage_linear
(
rdev
,
min_uV
,
max_uV
);
}
static
int
tps80031_vbus_is_enabled
(
struct
regulator_dev
*
rdev
)
...
...
@@ -390,9 +388,10 @@ static struct regulator_ops tps80031_dcdc_ops = {
};
static
struct
regulator_ops
tps80031_ldo_ops
=
{
.
list_voltage
=
regulator_list_voltage_linear
,
.
set_voltage_sel
=
tps80031_ldo_set_voltage_sel
,
.
get_voltage_sel
=
tps80031_ldo_get_voltage_sel
,
.
list_voltage
=
tps80031_ldo_list_voltage
,
.
map_voltage
=
tps80031_ldo_map_voltage
,
.
set_voltage_sel
=
regulator_set_voltage_sel_regmap
,
.
get_voltage_sel
=
regulator_get_voltage_sel_regmap
,
.
enable
=
tps80031_reg_enable
,
.
disable
=
tps80031_reg_disable
,
.
is_enabled
=
tps80031_reg_is_enabled
,
...
...
@@ -459,6 +458,7 @@ static struct regulator_ops tps80031_ext_reg_ops = {
.uV_step = 100000, \
.linear_min_sel = 1, \
.n_voltages = 25, \
.vsel_reg = TPS80031_##_id##_CFG_VOLTAGE, \
.vsel_mask = LDO_VSEL_MASK, \
.enable_time = 500, \
}, \
...
...
@@ -680,6 +680,7 @@ static int tps80031_regulator_probe(struct platform_device *pdev)
struct
tps80031_regulator
*
pmic
;
struct
regulator_dev
*
rdev
;
struct
regulator_config
config
=
{
};
struct
tps80031
*
tps80031_mfd
=
dev_get_drvdata
(
pdev
->
dev
.
parent
);
int
ret
;
int
num
;
...
...
@@ -707,6 +708,8 @@ static int tps80031_regulator_probe(struct platform_device *pdev)
config
.
dev
=
&
pdev
->
dev
;
config
.
init_data
=
NULL
;
config
.
driver_data
=
ri
;
config
.
regmap
=
tps80031_mfd
->
regmap
[
ri
->
rinfo
->
volt_id
];
if
(
tps_pdata
)
{
config
.
init_data
=
tps_pdata
->
reg_init_data
;
ri
->
config_flags
=
tps_pdata
->
config_flags
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录