Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
3886f91b
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看板
提交
3886f91b
编写于
11年前
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'regulator/fix/max8997' into tmp
上级
c48c43aa
b4895e2c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
19 addition
and
20 deletion
+19
-20
drivers/regulator/max8997.c
drivers/regulator/max8997.c
+19
-20
未找到文件。
drivers/regulator/max8997.c
浏览文件 @
3886f91b
...
...
@@ -934,7 +934,7 @@ static struct regulator_desc regulators[] = {
};
#ifdef CONFIG_OF
static
int
max8997_pmic_dt_parse_dvs_gpio
(
struct
max8997_dev
*
io
dev
,
static
int
max8997_pmic_dt_parse_dvs_gpio
(
struct
platform_device
*
p
dev
,
struct
max8997_platform_data
*
pdata
,
struct
device_node
*
pmic_np
)
{
...
...
@@ -944,7 +944,7 @@ static int max8997_pmic_dt_parse_dvs_gpio(struct max8997_dev *iodev,
gpio
=
of_get_named_gpio
(
pmic_np
,
"max8997,pmic-buck125-dvs-gpios"
,
i
);
if
(
!
gpio_is_valid
(
gpio
))
{
dev_err
(
io
dev
->
dev
,
"invalid gpio[%d]: %d
\n
"
,
i
,
gpio
);
dev_err
(
&
p
dev
->
dev
,
"invalid gpio[%d]: %d
\n
"
,
i
,
gpio
);
return
-
EINVAL
;
}
pdata
->
buck125_gpios
[
i
]
=
gpio
;
...
...
@@ -952,22 +952,23 @@ static int max8997_pmic_dt_parse_dvs_gpio(struct max8997_dev *iodev,
return
0
;
}
static
int
max8997_pmic_dt_parse_pdata
(
struct
max8997_dev
*
io
dev
,
static
int
max8997_pmic_dt_parse_pdata
(
struct
platform_device
*
p
dev
,
struct
max8997_platform_data
*
pdata
)
{
struct
max8997_dev
*
iodev
=
dev_get_drvdata
(
pdev
->
dev
.
parent
);
struct
device_node
*
pmic_np
,
*
regulators_np
,
*
reg_np
;
struct
max8997_regulator_data
*
rdata
;
unsigned
int
i
,
dvs_voltage_nr
=
1
,
ret
;
pmic_np
=
iodev
->
dev
->
of_node
;
if
(
!
pmic_np
)
{
dev_err
(
io
dev
->
dev
,
"could not find pmic sub-node
\n
"
);
dev_err
(
&
p
dev
->
dev
,
"could not find pmic sub-node
\n
"
);
return
-
ENODEV
;
}
regulators_np
=
of_find_node_by_name
(
pmic_np
,
"regulators"
);
if
(
!
regulators_np
)
{
dev_err
(
io
dev
->
dev
,
"could not find regulators sub-node
\n
"
);
dev_err
(
&
p
dev
->
dev
,
"could not find regulators sub-node
\n
"
);
return
-
EINVAL
;
}
...
...
@@ -976,11 +977,10 @@ static int max8997_pmic_dt_parse_pdata(struct max8997_dev *iodev,
for_each_child_of_node
(
regulators_np
,
reg_np
)
pdata
->
num_regulators
++
;
rdata
=
devm_kzalloc
(
io
dev
->
dev
,
sizeof
(
*
rdata
)
*
rdata
=
devm_kzalloc
(
&
p
dev
->
dev
,
sizeof
(
*
rdata
)
*
pdata
->
num_regulators
,
GFP_KERNEL
);
if
(
!
rdata
)
{
dev_err
(
iodev
->
dev
,
"could not allocate memory for "
"regulator data
\n
"
);
dev_err
(
&
pdev
->
dev
,
"could not allocate memory for regulator data
\n
"
);
return
-
ENOMEM
;
}
...
...
@@ -991,14 +991,14 @@ static int max8997_pmic_dt_parse_pdata(struct max8997_dev *iodev,
break
;
if
(
i
==
ARRAY_SIZE
(
regulators
))
{
dev_warn
(
iodev
->
dev
,
"don't know how to configure "
"regulator %s
\n
"
,
reg_np
->
name
);
dev_warn
(
&
pdev
->
dev
,
"don't know how to configure regulator %s
\n
"
,
reg_np
->
name
);
continue
;
}
rdata
->
id
=
i
;
rdata
->
initdata
=
of_get_regulator_init_data
(
iodev
->
dev
,
reg_np
);
rdata
->
initdata
=
of_get_regulator_init_data
(
&
pdev
->
dev
,
reg_np
);
rdata
->
reg_node
=
reg_np
;
rdata
++
;
}
...
...
@@ -1014,7 +1014,7 @@ static int max8997_pmic_dt_parse_pdata(struct max8997_dev *iodev,
if
(
pdata
->
buck1_gpiodvs
||
pdata
->
buck2_gpiodvs
||
pdata
->
buck5_gpiodvs
)
{
ret
=
max8997_pmic_dt_parse_dvs_gpio
(
io
dev
,
pdata
,
pmic_np
);
ret
=
max8997_pmic_dt_parse_dvs_gpio
(
p
dev
,
pdata
,
pmic_np
);
if
(
ret
)
return
-
EINVAL
;
...
...
@@ -1025,8 +1025,7 @@ static int max8997_pmic_dt_parse_pdata(struct max8997_dev *iodev,
}
else
{
if
(
pdata
->
buck125_default_idx
>=
8
)
{
pdata
->
buck125_default_idx
=
0
;
dev_info
(
iodev
->
dev
,
"invalid value for "
"default dvs index, using 0 instead
\n
"
);
dev_info
(
&
pdev
->
dev
,
"invalid value for default dvs index, using 0 instead
\n
"
);
}
}
...
...
@@ -1040,28 +1039,28 @@ static int max8997_pmic_dt_parse_pdata(struct max8997_dev *iodev,
if
(
of_property_read_u32_array
(
pmic_np
,
"max8997,pmic-buck1-dvs-voltage"
,
pdata
->
buck1_voltage
,
dvs_voltage_nr
))
{
dev_err
(
io
dev
->
dev
,
"buck1 voltages not specified
\n
"
);
dev_err
(
&
p
dev
->
dev
,
"buck1 voltages not specified
\n
"
);
return
-
EINVAL
;
}
if
(
of_property_read_u32_array
(
pmic_np
,
"max8997,pmic-buck2-dvs-voltage"
,
pdata
->
buck2_voltage
,
dvs_voltage_nr
))
{
dev_err
(
io
dev
->
dev
,
"buck2 voltages not specified
\n
"
);
dev_err
(
&
p
dev
->
dev
,
"buck2 voltages not specified
\n
"
);
return
-
EINVAL
;
}
if
(
of_property_read_u32_array
(
pmic_np
,
"max8997,pmic-buck5-dvs-voltage"
,
pdata
->
buck5_voltage
,
dvs_voltage_nr
))
{
dev_err
(
io
dev
->
dev
,
"buck5 voltages not specified
\n
"
);
dev_err
(
&
p
dev
->
dev
,
"buck5 voltages not specified
\n
"
);
return
-
EINVAL
;
}
return
0
;
}
#else
static
int
max8997_pmic_dt_parse_pdata
(
struct
max8997_dev
*
io
dev
,
static
int
max8997_pmic_dt_parse_pdata
(
struct
platform_device
*
p
dev
,
struct
max8997_platform_data
*
pdata
)
{
return
0
;
...
...
@@ -1085,7 +1084,7 @@ static int max8997_pmic_probe(struct platform_device *pdev)
}
if
(
iodev
->
dev
->
of_node
)
{
ret
=
max8997_pmic_dt_parse_pdata
(
io
dev
,
pdata
);
ret
=
max8997_pmic_dt_parse_pdata
(
p
dev
,
pdata
);
if
(
ret
)
return
ret
;
}
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
新手
引导
客服
返回
顶部