Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
28c426c7
cloud-kernel
项目概览
openanolis
/
cloud-kernel
12 个月 前同步成功
通知
152
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,发现更多精彩内容 >>
未验证
提交
28c426c7
编写于
11月 10, 2017
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'regulator/topic/axp20x' into regulator-next
上级
46294d66
ad92ceaf
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
91 addition
and
4 deletion
+91
-4
drivers/regulator/axp20x-regulator.c
drivers/regulator/axp20x-regulator.c
+88
-4
include/linux/mfd/axp20x.h
include/linux/mfd/axp20x.h
+3
-0
未找到文件。
drivers/regulator/axp20x-regulator.c
浏览文件 @
28c426c7
...
...
@@ -244,6 +244,7 @@ static const struct regulator_desc axp22x_drivevbus_regulator = {
.
ops
=
&
axp20x_ops_sw
,
};
/* DCDC ranges shared with AXP813 */
static
const
struct
regulator_linear_range
axp803_dcdc234_ranges
[]
=
{
REGULATOR_LINEAR_RANGE
(
500000
,
0x0
,
0x46
,
10000
),
REGULATOR_LINEAR_RANGE
(
1220000
,
0x47
,
0x4b
,
20000
),
...
...
@@ -426,6 +427,69 @@ static const struct regulator_desc axp809_regulators[] = {
AXP_DESC_SW
(
AXP809
,
SW
,
"sw"
,
"swin"
,
AXP22X_PWR_OUT_CTRL2
,
BIT
(
6
)),
};
static
const
struct
regulator_desc
axp813_regulators
[]
=
{
AXP_DESC
(
AXP813
,
DCDC1
,
"dcdc1"
,
"vin1"
,
1600
,
3400
,
100
,
AXP803_DCDC1_V_OUT
,
0x1f
,
AXP22X_PWR_OUT_CTRL1
,
BIT
(
0
)),
AXP_DESC_RANGES
(
AXP813
,
DCDC2
,
"dcdc2"
,
"vin2"
,
axp803_dcdc234_ranges
,
76
,
AXP803_DCDC2_V_OUT
,
0x7f
,
AXP22X_PWR_OUT_CTRL1
,
BIT
(
1
)),
AXP_DESC_RANGES
(
AXP813
,
DCDC3
,
"dcdc3"
,
"vin3"
,
axp803_dcdc234_ranges
,
76
,
AXP803_DCDC3_V_OUT
,
0x7f
,
AXP22X_PWR_OUT_CTRL1
,
BIT
(
2
)),
AXP_DESC_RANGES
(
AXP813
,
DCDC4
,
"dcdc4"
,
"vin4"
,
axp803_dcdc234_ranges
,
76
,
AXP803_DCDC4_V_OUT
,
0x7f
,
AXP22X_PWR_OUT_CTRL1
,
BIT
(
3
)),
AXP_DESC_RANGES
(
AXP813
,
DCDC5
,
"dcdc5"
,
"vin5"
,
axp803_dcdc5_ranges
,
68
,
AXP803_DCDC5_V_OUT
,
0x7f
,
AXP22X_PWR_OUT_CTRL1
,
BIT
(
4
)),
AXP_DESC_RANGES
(
AXP813
,
DCDC6
,
"dcdc6"
,
"vin6"
,
axp803_dcdc6_ranges
,
72
,
AXP803_DCDC6_V_OUT
,
0x7f
,
AXP22X_PWR_OUT_CTRL1
,
BIT
(
5
)),
AXP_DESC_RANGES
(
AXP813
,
DCDC7
,
"dcdc7"
,
"vin7"
,
axp803_dcdc6_ranges
,
72
,
AXP813_DCDC7_V_OUT
,
0x7f
,
AXP22X_PWR_OUT_CTRL1
,
BIT
(
6
)),
AXP_DESC
(
AXP813
,
ALDO1
,
"aldo1"
,
"aldoin"
,
700
,
3300
,
100
,
AXP22X_ALDO1_V_OUT
,
0x1f
,
AXP22X_PWR_OUT_CTRL3
,
BIT
(
5
)),
AXP_DESC
(
AXP813
,
ALDO2
,
"aldo2"
,
"aldoin"
,
700
,
3300
,
100
,
AXP22X_ALDO2_V_OUT
,
0x1f
,
AXP22X_PWR_OUT_CTRL3
,
BIT
(
6
)),
AXP_DESC
(
AXP813
,
ALDO3
,
"aldo3"
,
"aldoin"
,
700
,
3300
,
100
,
AXP22X_ALDO3_V_OUT
,
0x1f
,
AXP22X_PWR_OUT_CTRL3
,
BIT
(
7
)),
AXP_DESC
(
AXP813
,
DLDO1
,
"dldo1"
,
"dldoin"
,
700
,
3300
,
100
,
AXP22X_DLDO1_V_OUT
,
0x1f
,
AXP22X_PWR_OUT_CTRL2
,
BIT
(
3
)),
AXP_DESC_RANGES
(
AXP813
,
DLDO2
,
"dldo2"
,
"dldoin"
,
axp803_dldo2_ranges
,
32
,
AXP22X_DLDO2_V_OUT
,
0x1f
,
AXP22X_PWR_OUT_CTRL2
,
BIT
(
4
)),
AXP_DESC
(
AXP813
,
DLDO3
,
"dldo3"
,
"dldoin"
,
700
,
3300
,
100
,
AXP22X_DLDO3_V_OUT
,
0x1f
,
AXP22X_PWR_OUT_CTRL2
,
BIT
(
5
)),
AXP_DESC
(
AXP813
,
DLDO4
,
"dldo4"
,
"dldoin"
,
700
,
3300
,
100
,
AXP22X_DLDO4_V_OUT
,
0x1f
,
AXP22X_PWR_OUT_CTRL2
,
BIT
(
6
)),
AXP_DESC
(
AXP813
,
ELDO1
,
"eldo1"
,
"eldoin"
,
700
,
1900
,
50
,
AXP22X_ELDO1_V_OUT
,
0x1f
,
AXP22X_PWR_OUT_CTRL2
,
BIT
(
0
)),
AXP_DESC
(
AXP813
,
ELDO2
,
"eldo2"
,
"eldoin"
,
700
,
1900
,
50
,
AXP22X_ELDO2_V_OUT
,
0x1f
,
AXP22X_PWR_OUT_CTRL2
,
BIT
(
1
)),
AXP_DESC
(
AXP813
,
ELDO3
,
"eldo3"
,
"eldoin"
,
700
,
1900
,
50
,
AXP22X_ELDO3_V_OUT
,
0x1f
,
AXP22X_PWR_OUT_CTRL2
,
BIT
(
2
)),
/* to do / check ... */
AXP_DESC
(
AXP813
,
FLDO1
,
"fldo1"
,
"fldoin"
,
700
,
1450
,
50
,
AXP803_FLDO1_V_OUT
,
0x0f
,
AXP22X_PWR_OUT_CTRL3
,
BIT
(
2
)),
AXP_DESC
(
AXP813
,
FLDO2
,
"fldo2"
,
"fldoin"
,
700
,
1450
,
50
,
AXP803_FLDO2_V_OUT
,
0x0f
,
AXP22X_PWR_OUT_CTRL3
,
BIT
(
3
)),
/*
* TODO: FLDO3 = {DCDC5, FLDOIN} / 2
*
* This means FLDO3 effectively switches supplies at runtime,
* something the regulator subsystem does not support.
*/
AXP_DESC_FIXED
(
AXP813
,
RTC_LDO
,
"rtc-ldo"
,
"ips"
,
1800
),
AXP_DESC_IO
(
AXP813
,
LDO_IO0
,
"ldo-io0"
,
"ips"
,
700
,
3300
,
100
,
AXP22X_LDO_IO0_V_OUT
,
0x1f
,
AXP20X_GPIO0_CTRL
,
0x07
,
AXP22X_IO_ENABLED
,
AXP22X_IO_DISABLED
),
AXP_DESC_IO
(
AXP813
,
LDO_IO1
,
"ldo-io1"
,
"ips"
,
700
,
3300
,
100
,
AXP22X_LDO_IO1_V_OUT
,
0x1f
,
AXP20X_GPIO1_CTRL
,
0x07
,
AXP22X_IO_ENABLED
,
AXP22X_IO_DISABLED
),
AXP_DESC_SW
(
AXP813
,
SW
,
"sw"
,
"swin"
,
AXP22X_PWR_OUT_CTRL2
,
BIT
(
7
)),
};
static
int
axp20x_set_dcdc_freq
(
struct
platform_device
*
pdev
,
u32
dcdcfreq
)
{
struct
axp20x_dev
*
axp20x
=
dev_get_drvdata
(
pdev
->
dev
.
parent
);
...
...
@@ -441,9 +505,10 @@ static int axp20x_set_dcdc_freq(struct platform_device *pdev, u32 dcdcfreq)
step
=
75
;
break
;
case
AXP803_ID
:
case
AXP813_ID
:
/*
* AXP803
DCDC work frequency setting has the same range and
* step as AXP22X, but at a different register.
* AXP803
/AXP813 DCDC work frequency setting has the same
*
range and
step as AXP22X, but at a different register.
* Fall through to the check below.
* (See include/linux/mfd/axp20x.h)
*/
...
...
@@ -561,6 +626,14 @@ static int axp20x_set_dcdc_workmode(struct regulator_dev *rdev, int id, u32 work
workmode
<<=
id
-
AXP803_DCDC1
;
break
;
case
AXP813_ID
:
if
(
id
<
AXP813_DCDC1
||
id
>
AXP813_DCDC7
)
return
-
EINVAL
;
mask
=
AXP22X_WORKMODE_DCDCX_MASK
(
id
-
AXP813_DCDC1
);
workmode
<<=
id
-
AXP813_DCDC1
;
break
;
default:
/* should not happen */
WARN_ON
(
1
);
...
...
@@ -579,11 +652,12 @@ static bool axp20x_is_polyphase_slave(struct axp20x_dev *axp20x, int id)
u32
reg
=
0
;
/*
* Currently in our supported AXP variants, only AXP803
and AXP806
* have polyphase regulators.
* Currently in our supported AXP variants, only AXP803
, AXP806,
*
and AXP813
have polyphase regulators.
*/
switch
(
axp20x
->
variant
)
{
case
AXP803_ID
:
case
AXP813_ID
:
regmap_read
(
axp20x
->
regmap
,
AXP803_POLYPHASE_CTRL
,
&
reg
);
switch
(
id
)
{
...
...
@@ -656,6 +730,12 @@ static int axp20x_regulator_probe(struct platform_device *pdev)
regulators
=
axp809_regulators
;
nregulators
=
AXP809_REG_ID_MAX
;
break
;
case
AXP813_ID
:
regulators
=
axp813_regulators
;
nregulators
=
AXP813_REG_ID_MAX
;
drivevbus
=
of_property_read_bool
(
pdev
->
dev
.
parent
->
of_node
,
"x-powers,drive-vbus-en"
);
break
;
default:
dev_err
(
&
pdev
->
dev
,
"Unsupported AXP variant: %ld
\n
"
,
axp20x
->
variant
);
...
...
@@ -677,6 +757,10 @@ static int axp20x_regulator_probe(struct platform_device *pdev)
if
(
axp20x_is_polyphase_slave
(
axp20x
,
i
))
continue
;
/* Support for AXP813's FLDO3 is not implemented */
if
(
axp20x
->
variant
==
AXP813_ID
&&
i
==
AXP813_FLDO3
)
continue
;
/*
* Regulators DC1SW and DC5LDO are connected internally,
* so we have to handle their supply names separately.
...
...
include/linux/mfd/axp20x.h
浏览文件 @
28c426c7
...
...
@@ -131,6 +131,9 @@ enum axp20x_variants {
#define AXP803_DCDC6_V_OUT 0x25
#define AXP803_DCDC_FREQ_CTRL 0x3b
/* Other DCDC regulator control registers are the same as AXP803 */
#define AXP813_DCDC7_V_OUT 0x26
/* Interrupt */
#define AXP152_IRQ1_EN 0x40
#define AXP152_IRQ2_EN 0x41
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录