Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
a540f682
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
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看板
提交
a540f682
编写于
4月 30, 2012
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
regulator: wm8350: Convert to core regmap-based enable operations
Signed-off-by:
N
Mark Brown
<
broonie@opensource.wolfsonmicro.com
>
上级
b4ec87ae
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
29 addition
and
92 deletion
+29
-92
drivers/regulator/wm8350-regulator.c
drivers/regulator/wm8350-regulator.c
+29
-92
未找到文件。
drivers/regulator/wm8350-regulator.c
浏览文件 @
a540f682
...
...
@@ -905,63 +905,6 @@ int wm8350_dcdc25_set_mode(struct wm8350 *wm8350, int dcdc, u16 mode,
}
EXPORT_SYMBOL_GPL
(
wm8350_dcdc25_set_mode
);
static
int
wm8350_dcdc_enable
(
struct
regulator_dev
*
rdev
)
{
struct
wm8350
*
wm8350
=
rdev_get_drvdata
(
rdev
);
int
dcdc
=
rdev_get_id
(
rdev
);
u16
shift
;
if
(
dcdc
<
WM8350_DCDC_1
||
dcdc
>
WM8350_DCDC_6
)
return
-
EINVAL
;
shift
=
dcdc
-
WM8350_DCDC_1
;
wm8350_set_bits
(
wm8350
,
WM8350_DCDC_LDO_REQUESTED
,
1
<<
shift
);
return
0
;
}
static
int
wm8350_dcdc_disable
(
struct
regulator_dev
*
rdev
)
{
struct
wm8350
*
wm8350
=
rdev_get_drvdata
(
rdev
);
int
dcdc
=
rdev_get_id
(
rdev
);
u16
shift
;
if
(
dcdc
<
WM8350_DCDC_1
||
dcdc
>
WM8350_DCDC_6
)
return
-
EINVAL
;
shift
=
dcdc
-
WM8350_DCDC_1
;
wm8350_clear_bits
(
wm8350
,
WM8350_DCDC_LDO_REQUESTED
,
1
<<
shift
);
return
0
;
}
static
int
wm8350_ldo_enable
(
struct
regulator_dev
*
rdev
)
{
struct
wm8350
*
wm8350
=
rdev_get_drvdata
(
rdev
);
int
ldo
=
rdev_get_id
(
rdev
);
u16
shift
;
if
(
ldo
<
WM8350_LDO_1
||
ldo
>
WM8350_LDO_4
)
return
-
EINVAL
;
shift
=
(
ldo
-
WM8350_LDO_1
)
+
8
;
wm8350_set_bits
(
wm8350
,
WM8350_DCDC_LDO_REQUESTED
,
1
<<
shift
);
return
0
;
}
static
int
wm8350_ldo_disable
(
struct
regulator_dev
*
rdev
)
{
struct
wm8350
*
wm8350
=
rdev_get_drvdata
(
rdev
);
int
ldo
=
rdev_get_id
(
rdev
);
u16
shift
;
if
(
ldo
<
WM8350_LDO_1
||
ldo
>
WM8350_LDO_4
)
return
-
EINVAL
;
shift
=
(
ldo
-
WM8350_LDO_1
)
+
8
;
wm8350_clear_bits
(
wm8350
,
WM8350_DCDC_LDO_REQUESTED
,
1
<<
shift
);
return
0
;
}
static
int
force_continuous_enable
(
struct
wm8350
*
wm8350
,
int
dcdc
,
int
enable
)
{
int
reg
=
0
,
ret
;
...
...
@@ -1143,42 +1086,16 @@ static unsigned int wm8350_dcdc_get_optimum_mode(struct regulator_dev *rdev,
return
mode
;
}
static
int
wm8350_dcdc_is_enabled
(
struct
regulator_dev
*
rdev
)
{
struct
wm8350
*
wm8350
=
rdev_get_drvdata
(
rdev
);
int
dcdc
=
rdev_get_id
(
rdev
),
shift
;
if
(
dcdc
<
WM8350_DCDC_1
||
dcdc
>
WM8350_DCDC_6
)
return
-
EINVAL
;
shift
=
dcdc
-
WM8350_DCDC_1
;
return
wm8350_reg_read
(
wm8350
,
WM8350_DCDC_LDO_REQUESTED
)
&
(
1
<<
shift
);
}
static
int
wm8350_ldo_is_enabled
(
struct
regulator_dev
*
rdev
)
{
struct
wm8350
*
wm8350
=
rdev_get_drvdata
(
rdev
);
int
ldo
=
rdev_get_id
(
rdev
),
shift
;
if
(
ldo
<
WM8350_LDO_1
||
ldo
>
WM8350_LDO_4
)
return
-
EINVAL
;
shift
=
(
ldo
-
WM8350_LDO_1
)
+
8
;
return
wm8350_reg_read
(
wm8350
,
WM8350_DCDC_LDO_REQUESTED
)
&
(
1
<<
shift
);
}
static
struct
regulator_ops
wm8350_dcdc_ops
=
{
.
set_voltage
=
wm8350_dcdc_set_voltage
,
.
get_voltage_sel
=
regulator_get_voltage_sel_regmap
,
.
list_voltage
=
wm8350_dcdc_list_voltage
,
.
enable
=
wm8350_dcdc_enable
,
.
disable
=
wm8350_dcdc_disable
,
.
enable
=
regulator_enable_regmap
,
.
disable
=
regulator_disable_regmap
,
.
is_enabled
=
regulator_is_enabled_regmap
,
.
get_mode
=
wm8350_dcdc_get_mode
,
.
set_mode
=
wm8350_dcdc_set_mode
,
.
get_optimum_mode
=
wm8350_dcdc_get_optimum_mode
,
.
is_enabled
=
wm8350_dcdc_is_enabled
,
.
set_suspend_voltage
=
wm8350_dcdc_set_suspend_voltage
,
.
set_suspend_enable
=
wm8350_dcdc_set_suspend_enable
,
.
set_suspend_disable
=
wm8350_dcdc_set_suspend_disable
,
...
...
@@ -1186,9 +1103,9 @@ static struct regulator_ops wm8350_dcdc_ops = {
};
static
struct
regulator_ops
wm8350_dcdc2_5_ops
=
{
.
enable
=
wm8350_dcdc_enable
,
.
disable
=
wm8350_dcdc_disable
,
.
is_enabled
=
wm8350_dcdc_is_enabled
,
.
enable
=
regulator_enable_regmap
,
.
disable
=
regulator_disable_regmap
,
.
is_enabled
=
regulator_is_enabled_regmap
,
.
set_suspend_enable
=
wm8350_dcdc25_set_suspend_enable
,
.
set_suspend_disable
=
wm8350_dcdc25_set_suspend_disable
,
};
...
...
@@ -1197,9 +1114,9 @@ static struct regulator_ops wm8350_ldo_ops = {
.
set_voltage
=
wm8350_ldo_set_voltage
,
.
get_voltage_sel
=
regulator_get_voltage_sel_regmap
,
.
list_voltage
=
wm8350_ldo_list_voltage
,
.
enable
=
wm8350_ldo_enable
,
.
disable
=
wm8350_ldo_disable
,
.
is_enabled
=
wm8350_ldo_is_enabled
,
.
enable
=
regulator_enable_regmap
,
.
disable
=
regulator_disable_regmap
,
.
is_enabled
=
regulator_is_enabled_regmap
,
.
get_mode
=
wm8350_ldo_get_mode
,
.
set_suspend_voltage
=
wm8350_ldo_set_suspend_voltage
,
.
set_suspend_enable
=
wm8350_ldo_set_suspend_enable
,
...
...
@@ -1225,6 +1142,8 @@ static const struct regulator_desc wm8350_reg[NUM_WM8350_REGULATORS] = {
.
n_voltages
=
WM8350_DCDC_MAX_VSEL
+
1
,
.
vsel_reg
=
WM8350_DCDC1_CONTROL
,
.
vsel_mask
=
WM8350_DC1_VSEL_MASK
,
.
enable_reg
=
WM8350_DCDC_LDO_REQUESTED
,
.
enable_mask
=
WM8350_DC1_ENA
,
.
owner
=
THIS_MODULE
,
},
{
...
...
@@ -1233,6 +1152,8 @@ static const struct regulator_desc wm8350_reg[NUM_WM8350_REGULATORS] = {
.
ops
=
&
wm8350_dcdc2_5_ops
,
.
irq
=
WM8350_IRQ_UV_DC2
,
.
type
=
REGULATOR_VOLTAGE
,
.
enable_reg
=
WM8350_DCDC_LDO_REQUESTED
,
.
enable_mask
=
WM8350_DC2_ENA
,
.
owner
=
THIS_MODULE
,
},
{
...
...
@@ -1244,6 +1165,8 @@ static const struct regulator_desc wm8350_reg[NUM_WM8350_REGULATORS] = {
.
n_voltages
=
WM8350_DCDC_MAX_VSEL
+
1
,
.
vsel_reg
=
WM8350_DCDC3_CONTROL
,
.
vsel_mask
=
WM8350_DC3_VSEL_MASK
,
.
enable_reg
=
WM8350_DCDC_LDO_REQUESTED
,
.
enable_mask
=
WM8350_DC3_ENA
,
.
owner
=
THIS_MODULE
,
},
{
...
...
@@ -1255,6 +1178,8 @@ static const struct regulator_desc wm8350_reg[NUM_WM8350_REGULATORS] = {
.
n_voltages
=
WM8350_DCDC_MAX_VSEL
+
1
,
.
vsel_reg
=
WM8350_DCDC4_CONTROL
,
.
vsel_mask
=
WM8350_DC4_VSEL_MASK
,
.
enable_reg
=
WM8350_DCDC_LDO_REQUESTED
,
.
enable_mask
=
WM8350_DC4_ENA
,
.
owner
=
THIS_MODULE
,
},
{
...
...
@@ -1263,6 +1188,8 @@ static const struct regulator_desc wm8350_reg[NUM_WM8350_REGULATORS] = {
.
ops
=
&
wm8350_dcdc2_5_ops
,
.
irq
=
WM8350_IRQ_UV_DC5
,
.
type
=
REGULATOR_VOLTAGE
,
.
enable_reg
=
WM8350_DCDC_LDO_REQUESTED
,
.
enable_mask
=
WM8350_DC5_ENA
,
.
owner
=
THIS_MODULE
,
},
{
...
...
@@ -1274,6 +1201,8 @@ static const struct regulator_desc wm8350_reg[NUM_WM8350_REGULATORS] = {
.
n_voltages
=
WM8350_DCDC_MAX_VSEL
+
1
,
.
vsel_reg
=
WM8350_DCDC6_CONTROL
,
.
vsel_mask
=
WM8350_DC6_VSEL_MASK
,
.
enable_reg
=
WM8350_DCDC_LDO_REQUESTED
,
.
enable_mask
=
WM8350_DC6_ENA
,
.
owner
=
THIS_MODULE
,
},
{
...
...
@@ -1285,6 +1214,8 @@ static const struct regulator_desc wm8350_reg[NUM_WM8350_REGULATORS] = {
.
n_voltages
=
WM8350_LDO1_VSEL_MASK
+
1
,
.
vsel_reg
=
WM8350_LDO1_CONTROL
,
.
vsel_mask
=
WM8350_LDO1_VSEL_MASK
,
.
enable_reg
=
WM8350_DCDC_LDO_REQUESTED
,
.
enable_mask
=
WM8350_LDO1_ENA
,
.
owner
=
THIS_MODULE
,
},
{
...
...
@@ -1296,6 +1227,8 @@ static const struct regulator_desc wm8350_reg[NUM_WM8350_REGULATORS] = {
.
n_voltages
=
WM8350_LDO2_VSEL_MASK
+
1
,
.
vsel_reg
=
WM8350_LDO2_CONTROL
,
.
vsel_mask
=
WM8350_LDO2_VSEL_MASK
,
.
enable_reg
=
WM8350_DCDC_LDO_REQUESTED
,
.
enable_mask
=
WM8350_LDO2_ENA
,
.
owner
=
THIS_MODULE
,
},
{
...
...
@@ -1307,6 +1240,8 @@ static const struct regulator_desc wm8350_reg[NUM_WM8350_REGULATORS] = {
.
n_voltages
=
WM8350_LDO3_VSEL_MASK
+
1
,
.
vsel_reg
=
WM8350_LDO3_CONTROL
,
.
vsel_mask
=
WM8350_LDO3_VSEL_MASK
,
.
enable_reg
=
WM8350_DCDC_LDO_REQUESTED
,
.
enable_mask
=
WM8350_LDO3_ENA
,
.
owner
=
THIS_MODULE
,
},
{
...
...
@@ -1318,6 +1253,8 @@ static const struct regulator_desc wm8350_reg[NUM_WM8350_REGULATORS] = {
.
n_voltages
=
WM8350_LDO4_VSEL_MASK
+
1
,
.
vsel_reg
=
WM8350_LDO4_CONTROL
,
.
vsel_mask
=
WM8350_LDO4_VSEL_MASK
,
.
enable_reg
=
WM8350_DCDC_LDO_REQUESTED
,
.
enable_mask
=
WM8350_LDO4_ENA
,
.
owner
=
THIS_MODULE
,
},
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录