Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
27556467
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
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看板
未验证
提交
27556467
编写于
1月 26, 2018
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'regulator/topic/qcom_spmi' into regulator-next
上级
73d80037
9d485332
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
31 addition
and
53 deletion
+31
-53
drivers/regulator/qcom_spmi-regulator.c
drivers/regulator/qcom_spmi-regulator.c
+31
-53
未找到文件。
drivers/regulator/qcom_spmi-regulator.c
浏览文件 @
27556467
...
...
@@ -486,24 +486,6 @@ static int spmi_vreg_update_bits(struct spmi_regulator *vreg, u16 addr, u8 val,
return
regmap_update_bits
(
vreg
->
regmap
,
vreg
->
base
+
addr
,
mask
,
val
);
}
static
int
spmi_regulator_common_is_enabled
(
struct
regulator_dev
*
rdev
)
{
struct
spmi_regulator
*
vreg
=
rdev_get_drvdata
(
rdev
);
u8
reg
;
spmi_vreg_read
(
vreg
,
SPMI_COMMON_REG_ENABLE
,
&
reg
,
1
);
return
(
reg
&
SPMI_COMMON_ENABLE_MASK
)
==
SPMI_COMMON_ENABLE
;
}
static
int
spmi_regulator_common_enable
(
struct
regulator_dev
*
rdev
)
{
struct
spmi_regulator
*
vreg
=
rdev_get_drvdata
(
rdev
);
return
spmi_vreg_update_bits
(
vreg
,
SPMI_COMMON_REG_ENABLE
,
SPMI_COMMON_ENABLE
,
SPMI_COMMON_ENABLE_MASK
);
}
static
int
spmi_regulator_vs_enable
(
struct
regulator_dev
*
rdev
)
{
struct
spmi_regulator
*
vreg
=
rdev_get_drvdata
(
rdev
);
...
...
@@ -513,7 +495,7 @@ static int spmi_regulator_vs_enable(struct regulator_dev *rdev)
vreg
->
vs_enable_time
=
ktime_get
();
}
return
spmi_regulator_common_enable
(
rdev
);
return
regulator_enable_regmap
(
rdev
);
}
static
int
spmi_regulator_vs_ocp
(
struct
regulator_dev
*
rdev
)
...
...
@@ -524,14 +506,6 @@ static int spmi_regulator_vs_ocp(struct regulator_dev *rdev)
return
spmi_vreg_write
(
vreg
,
SPMI_VS_REG_OCP
,
&
reg
,
1
);
}
static
int
spmi_regulator_common_disable
(
struct
regulator_dev
*
rdev
)
{
struct
spmi_regulator
*
vreg
=
rdev_get_drvdata
(
rdev
);
return
spmi_vreg_update_bits
(
vreg
,
SPMI_COMMON_REG_ENABLE
,
SPMI_COMMON_DISABLE
,
SPMI_COMMON_ENABLE_MASK
);
}
static
int
spmi_regulator_select_voltage
(
struct
spmi_regulator
*
vreg
,
int
min_uV
,
int
max_uV
)
{
...
...
@@ -1062,9 +1036,9 @@ static irqreturn_t spmi_regulator_vs_ocp_isr(int irq, void *data)
}
static
struct
regulator_ops
spmi_smps_ops
=
{
.
enable
=
spmi_regulator_common_enable
,
.
disable
=
spmi_regulator_common_disable
,
.
is_enabled
=
spmi_regulator_common_is_enabled
,
.
enable
=
regulator_enable_regmap
,
.
disable
=
regulator_disable_regmap
,
.
is_enabled
=
regulator_is_enabled_regmap
,
.
set_voltage_sel
=
spmi_regulator_common_set_voltage
,
.
set_voltage_time_sel
=
spmi_regulator_set_voltage_time_sel
,
.
get_voltage_sel
=
spmi_regulator_common_get_voltage
,
...
...
@@ -1077,9 +1051,9 @@ static struct regulator_ops spmi_smps_ops = {
};
static
struct
regulator_ops
spmi_ldo_ops
=
{
.
enable
=
spmi_regulator_common_enable
,
.
disable
=
spmi_regulator_common_disable
,
.
is_enabled
=
spmi_regulator_common_is_enabled
,
.
enable
=
regulator_enable_regmap
,
.
disable
=
regulator_disable_regmap
,
.
is_enabled
=
regulator_is_enabled_regmap
,
.
set_voltage_sel
=
spmi_regulator_common_set_voltage
,
.
get_voltage_sel
=
spmi_regulator_common_get_voltage
,
.
map_voltage
=
spmi_regulator_common_map_voltage
,
...
...
@@ -1094,9 +1068,9 @@ static struct regulator_ops spmi_ldo_ops = {
};
static
struct
regulator_ops
spmi_ln_ldo_ops
=
{
.
enable
=
spmi_regulator_common_enable
,
.
disable
=
spmi_regulator_common_disable
,
.
is_enabled
=
spmi_regulator_common_is_enabled
,
.
enable
=
regulator_enable_regmap
,
.
disable
=
regulator_disable_regmap
,
.
is_enabled
=
regulator_is_enabled_regmap
,
.
set_voltage_sel
=
spmi_regulator_common_set_voltage
,
.
get_voltage_sel
=
spmi_regulator_common_get_voltage
,
.
map_voltage
=
spmi_regulator_common_map_voltage
,
...
...
@@ -1107,8 +1081,8 @@ static struct regulator_ops spmi_ln_ldo_ops = {
static
struct
regulator_ops
spmi_vs_ops
=
{
.
enable
=
spmi_regulator_vs_enable
,
.
disable
=
spmi_regulator_common_disable
,
.
is_enabled
=
spmi_regulator_common_is_enabled
,
.
disable
=
regulator_disable_regmap
,
.
is_enabled
=
regulator_is_enabled_regmap
,
.
set_pull_down
=
spmi_regulator_common_set_pull_down
,
.
set_soft_start
=
spmi_regulator_common_set_soft_start
,
.
set_over_current_protection
=
spmi_regulator_vs_ocp
,
...
...
@@ -1117,9 +1091,9 @@ static struct regulator_ops spmi_vs_ops = {
};
static
struct
regulator_ops
spmi_boost_ops
=
{
.
enable
=
spmi_regulator_common_enable
,
.
disable
=
spmi_regulator_common_disable
,
.
is_enabled
=
spmi_regulator_common_is_enabled
,
.
enable
=
regulator_enable_regmap
,
.
disable
=
regulator_disable_regmap
,
.
is_enabled
=
regulator_is_enabled_regmap
,
.
set_voltage_sel
=
spmi_regulator_single_range_set_voltage
,
.
get_voltage_sel
=
spmi_regulator_single_range_get_voltage
,
.
map_voltage
=
spmi_regulator_single_map_voltage
,
...
...
@@ -1128,9 +1102,9 @@ static struct regulator_ops spmi_boost_ops = {
};
static
struct
regulator_ops
spmi_ftsmps_ops
=
{
.
enable
=
spmi_regulator_common_enable
,
.
disable
=
spmi_regulator_common_disable
,
.
is_enabled
=
spmi_regulator_common_is_enabled
,
.
enable
=
regulator_enable_regmap
,
.
disable
=
regulator_disable_regmap
,
.
is_enabled
=
regulator_is_enabled_regmap
,
.
set_voltage_sel
=
spmi_regulator_common_set_voltage
,
.
set_voltage_time_sel
=
spmi_regulator_set_voltage_time_sel
,
.
get_voltage_sel
=
spmi_regulator_common_get_voltage
,
...
...
@@ -1143,9 +1117,9 @@ static struct regulator_ops spmi_ftsmps_ops = {
};
static
struct
regulator_ops
spmi_ult_lo_smps_ops
=
{
.
enable
=
spmi_regulator_common_enable
,
.
disable
=
spmi_regulator_common_disable
,
.
is_enabled
=
spmi_regulator_common_is_enabled
,
.
enable
=
regulator_enable_regmap
,
.
disable
=
regulator_disable_regmap
,
.
is_enabled
=
regulator_is_enabled_regmap
,
.
set_voltage_sel
=
spmi_regulator_ult_lo_smps_set_voltage
,
.
set_voltage_time_sel
=
spmi_regulator_set_voltage_time_sel
,
.
get_voltage_sel
=
spmi_regulator_ult_lo_smps_get_voltage
,
...
...
@@ -1157,9 +1131,9 @@ static struct regulator_ops spmi_ult_lo_smps_ops = {
};
static
struct
regulator_ops
spmi_ult_ho_smps_ops
=
{
.
enable
=
spmi_regulator_common_enable
,
.
disable
=
spmi_regulator_common_disable
,
.
is_enabled
=
spmi_regulator_common_is_enabled
,
.
enable
=
regulator_enable_regmap
,
.
disable
=
regulator_disable_regmap
,
.
is_enabled
=
regulator_is_enabled_regmap
,
.
set_voltage_sel
=
spmi_regulator_single_range_set_voltage
,
.
set_voltage_time_sel
=
spmi_regulator_set_voltage_time_sel
,
.
get_voltage_sel
=
spmi_regulator_single_range_get_voltage
,
...
...
@@ -1172,9 +1146,9 @@ static struct regulator_ops spmi_ult_ho_smps_ops = {
};
static
struct
regulator_ops
spmi_ult_ldo_ops
=
{
.
enable
=
spmi_regulator_common_enable
,
.
disable
=
spmi_regulator_common_disable
,
.
is_enabled
=
spmi_regulator_common_is_enabled
,
.
enable
=
regulator_enable_regmap
,
.
disable
=
regulator_disable_regmap
,
.
is_enabled
=
regulator_is_enabled_regmap
,
.
set_voltage_sel
=
spmi_regulator_single_range_set_voltage
,
.
get_voltage_sel
=
spmi_regulator_single_range_get_voltage
,
.
map_voltage
=
spmi_regulator_single_map_voltage
,
...
...
@@ -1711,6 +1685,9 @@ static int qcom_spmi_regulator_probe(struct platform_device *pdev)
vreg
->
desc
.
id
=
-
1
;
vreg
->
desc
.
owner
=
THIS_MODULE
;
vreg
->
desc
.
type
=
REGULATOR_VOLTAGE
;
vreg
->
desc
.
enable_reg
=
reg
->
base
+
SPMI_COMMON_REG_ENABLE
;
vreg
->
desc
.
enable_mask
=
SPMI_COMMON_ENABLE_MASK
;
vreg
->
desc
.
enable_val
=
SPMI_COMMON_ENABLE
;
vreg
->
desc
.
name
=
name
=
reg
->
name
;
vreg
->
desc
.
supply_name
=
reg
->
supply
;
vreg
->
desc
.
of_match
=
reg
->
name
;
...
...
@@ -1723,6 +1700,7 @@ static int qcom_spmi_regulator_probe(struct platform_device *pdev)
config
.
dev
=
dev
;
config
.
driver_data
=
vreg
;
config
.
regmap
=
regmap
;
rdev
=
devm_regulator_register
(
dev
,
&
vreg
->
desc
,
&
config
);
if
(
IS_ERR
(
rdev
))
{
dev_err
(
dev
,
"failed to register %s
\n
"
,
name
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录