Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
bee54658
K
Kernel
项目概览
openeuler
/
Kernel
接近 2 年 前同步成功
通知
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看板
提交
bee54658
编写于
4月 28, 2013
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'regulator/topic/wm8994' into v3.9-rc8
上级
bcd5d1d9
3ea93896
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
42 addition
and
19 deletion
+42
-19
drivers/regulator/wm8994-regulator.c
drivers/regulator/wm8994-regulator.c
+42
-19
未找到文件。
drivers/regulator/wm8994-regulator.c
浏览文件 @
bee54658
...
...
@@ -18,6 +18,7 @@
#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>
#include <linux/gpio.h>
#include <linux/slab.h>
...
...
@@ -28,6 +29,8 @@
struct
wm8994_ldo
{
struct
regulator_dev
*
regulator
;
struct
wm8994
*
wm8994
;
struct
regulator_consumer_supply
supply
;
struct
regulator_init_data
init_data
;
};
#define WM8994_LDO1_MAX_SELECTOR 0x7
...
...
@@ -99,6 +102,26 @@ static const struct regulator_desc wm8994_ldo_desc[] = {
},
};
static
const
struct
regulator_consumer_supply
wm8994_ldo_consumer
[]
=
{
{
.
supply
=
"AVDD1"
},
{
.
supply
=
"DCVDD"
},
};
static
const
struct
regulator_init_data
wm8994_ldo_default
[]
=
{
{
.
constraints
=
{
.
valid_ops_mask
=
REGULATOR_CHANGE_STATUS
,
},
.
num_consumer_supplies
=
1
,
},
{
.
constraints
=
{
.
valid_ops_mask
=
REGULATOR_CHANGE_STATUS
,
},
.
num_consumer_supplies
=
1
,
},
};
static
int
wm8994_ldo_probe
(
struct
platform_device
*
pdev
)
{
struct
wm8994
*
wm8994
=
dev_get_drvdata
(
pdev
->
dev
.
parent
);
...
...
@@ -117,13 +140,29 @@ static int wm8994_ldo_probe(struct platform_device *pdev)
}
ldo
->
wm8994
=
wm8994
;
ldo
->
supply
=
wm8994_ldo_consumer
[
id
];
ldo
->
supply
.
dev_name
=
dev_name
(
wm8994
->
dev
);
config
.
dev
=
wm8994
->
dev
;
config
.
driver_data
=
ldo
;
config
.
regmap
=
wm8994
->
regmap
;
if
(
pdata
)
{
config
.
init_data
=
pdata
->
ldo
[
id
].
init_data
;
config
.
init_data
=
&
ldo
->
init_data
;
if
(
pdata
)
config
.
ena_gpio
=
pdata
->
ldo
[
id
].
enable
;
else
if
(
wm8994
->
dev
->
of_node
)
config
.
ena_gpio
=
wm8994
->
pdata
.
ldo
[
id
].
enable
;
/* Use default constraints if none set up */
if
(
!
pdata
||
!
pdata
->
ldo
[
id
].
init_data
||
wm8994
->
dev
->
of_node
)
{
dev_dbg
(
wm8994
->
dev
,
"Using default init data, supply %s %s
\n
"
,
ldo
->
supply
.
dev_name
,
ldo
->
supply
.
supply
);
ldo
->
init_data
=
wm8994_ldo_default
[
id
];
ldo
->
init_data
.
consumer_supplies
=
&
ldo
->
supply
;
if
(
!
config
.
ena_gpio
)
ldo
->
init_data
.
constraints
.
valid_ops_mask
=
0
;
}
else
{
ldo
->
init_data
=
*
pdata
->
ldo
[
id
].
init_data
;
}
ldo
->
regulator
=
regulator_register
(
&
wm8994_ldo_desc
[
id
],
&
config
);
...
...
@@ -162,23 +201,7 @@ static struct platform_driver wm8994_ldo_driver = {
},
};
static
int
__init
wm8994_ldo_init
(
void
)
{
int
ret
;
ret
=
platform_driver_register
(
&
wm8994_ldo_driver
);
if
(
ret
!=
0
)
pr_err
(
"Failed to register Wm8994 GP LDO driver: %d
\n
"
,
ret
);
return
ret
;
}
subsys_initcall
(
wm8994_ldo_init
);
static
void
__exit
wm8994_ldo_exit
(
void
)
{
platform_driver_unregister
(
&
wm8994_ldo_driver
);
}
module_exit
(
wm8994_ldo_exit
);
module_platform_driver
(
wm8994_ldo_driver
);
/* Module information */
MODULE_AUTHOR
(
"Mark Brown <broonie@opensource.wolfsonmicro.com>"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录