Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
d2f4ec10
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 4 年多
通知
15
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
d2f4ec10
编写于
2月 08, 2013
作者:
G
Grant Likely
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'robherring/for-next' from
git://sources.calxeda.com/kernel/linux.git
Signed-off-by:
N
Grant Likely
<
grant.likely@secretlab.ca
>
上级
12514aa0
eb7ccb81
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
76 addition
and
22 deletion
+76
-22
Documentation/devicetree/bindings/vendor-prefixes.txt
Documentation/devicetree/bindings/vendor-prefixes.txt
+3
-0
drivers/of/base.c
drivers/of/base.c
+73
-22
未找到文件。
Documentation/devicetree/bindings/vendor-prefixes.txt
浏览文件 @
d2f4ec10
...
@@ -14,6 +14,7 @@ bosch Bosch Sensortec GmbH
...
@@ -14,6 +14,7 @@ bosch Bosch Sensortec GmbH
brcm Broadcom Corporation
brcm Broadcom Corporation
cavium Cavium, Inc.
cavium Cavium, Inc.
chrp Common Hardware Reference Platform
chrp Common Hardware Reference Platform
cirrus Cirrus Logic, Inc.
cortina Cortina Systems, Inc.
cortina Cortina Systems, Inc.
dallas Maxim Integrated Products (formerly Dallas Semiconductor)
dallas Maxim Integrated Products (formerly Dallas Semiconductor)
denx Denx Software Engineering
denx Denx Software Engineering
...
@@ -42,6 +43,7 @@ powervr PowerVR (deprecated, use img)
...
@@ -42,6 +43,7 @@ powervr PowerVR (deprecated, use img)
qcom Qualcomm, Inc.
qcom Qualcomm, Inc.
ramtron Ramtron International
ramtron Ramtron International
realtek Realtek Semiconductor Corp.
realtek Realtek Semiconductor Corp.
renesas Renesas Electronics Corporation
samsung Samsung Semiconductor
samsung Samsung Semiconductor
sbs Smart Battery System
sbs Smart Battery System
schindler Schindler
schindler Schindler
...
@@ -52,6 +54,7 @@ snps Synopsys, Inc.
...
@@ -52,6 +54,7 @@ snps Synopsys, Inc.
st STMicroelectronics
st STMicroelectronics
stericsson ST-Ericsson
stericsson ST-Ericsson
ti Texas Instruments
ti Texas Instruments
toshiba Toshiba Corporation
via VIA Technologies, Inc.
via VIA Technologies, Inc.
wlf Wolfson Microelectronics
wlf Wolfson Microelectronics
wm Wondermedia Technologies, Inc.
wm Wondermedia Technologies, Inc.
...
...
drivers/of/base.c
浏览文件 @
d2f4ec10
...
@@ -147,16 +147,14 @@ void of_node_put(struct device_node *node)
...
@@ -147,16 +147,14 @@ void of_node_put(struct device_node *node)
EXPORT_SYMBOL
(
of_node_put
);
EXPORT_SYMBOL
(
of_node_put
);
#endif
/* CONFIG_OF_DYNAMIC */
#endif
/* CONFIG_OF_DYNAMIC */
struct
property
*
of_find_property
(
const
struct
device_node
*
np
,
static
struct
property
*
__of_find_property
(
const
struct
device_node
*
np
,
const
char
*
name
,
const
char
*
name
,
int
*
lenp
)
int
*
lenp
)
{
{
struct
property
*
pp
;
struct
property
*
pp
;
if
(
!
np
)
if
(
!
np
)
return
NULL
;
return
NULL
;
read_lock
(
&
devtree_lock
);
for
(
pp
=
np
->
properties
;
pp
;
pp
=
pp
->
next
)
{
for
(
pp
=
np
->
properties
;
pp
;
pp
=
pp
->
next
)
{
if
(
of_prop_cmp
(
pp
->
name
,
name
)
==
0
)
{
if
(
of_prop_cmp
(
pp
->
name
,
name
)
==
0
)
{
if
(
lenp
)
if
(
lenp
)
...
@@ -164,6 +162,18 @@ struct property *of_find_property(const struct device_node *np,
...
@@ -164,6 +162,18 @@ struct property *of_find_property(const struct device_node *np,
break
;
break
;
}
}
}
}
return
pp
;
}
struct
property
*
of_find_property
(
const
struct
device_node
*
np
,
const
char
*
name
,
int
*
lenp
)
{
struct
property
*
pp
;
read_lock
(
&
devtree_lock
);
pp
=
__of_find_property
(
np
,
name
,
lenp
);
read_unlock
(
&
devtree_lock
);
read_unlock
(
&
devtree_lock
);
return
pp
;
return
pp
;
...
@@ -193,12 +203,24 @@ struct device_node *of_find_all_nodes(struct device_node *prev)
...
@@ -193,12 +203,24 @@ struct device_node *of_find_all_nodes(struct device_node *prev)
}
}
EXPORT_SYMBOL
(
of_find_all_nodes
);
EXPORT_SYMBOL
(
of_find_all_nodes
);
/*
* Find a property with a given name for a given node
* and return the value.
*/
static
const
void
*
__of_get_property
(
const
struct
device_node
*
np
,
const
char
*
name
,
int
*
lenp
)
{
struct
property
*
pp
=
__of_find_property
(
np
,
name
,
lenp
);
return
pp
?
pp
->
value
:
NULL
;
}
/*
/*
* Find a property with a given name for a given node
* Find a property with a given name for a given node
* and return the value.
* and return the value.
*/
*/
const
void
*
of_get_property
(
const
struct
device_node
*
np
,
const
char
*
name
,
const
void
*
of_get_property
(
const
struct
device_node
*
np
,
const
char
*
name
,
int
*
lenp
)
int
*
lenp
)
{
{
struct
property
*
pp
=
of_find_property
(
np
,
name
,
lenp
);
struct
property
*
pp
=
of_find_property
(
np
,
name
,
lenp
);
...
@@ -209,13 +231,13 @@ EXPORT_SYMBOL(of_get_property);
...
@@ -209,13 +231,13 @@ EXPORT_SYMBOL(of_get_property);
/** Checks if the given "compat" string matches one of the strings in
/** Checks if the given "compat" string matches one of the strings in
* the device's "compatible" property
* the device's "compatible" property
*/
*/
int
of_device_is_compatible
(
const
struct
device_node
*
device
,
static
int
__
of_device_is_compatible
(
const
struct
device_node
*
device
,
const
char
*
compat
)
const
char
*
compat
)
{
{
const
char
*
cp
;
const
char
*
cp
;
int
cplen
,
l
;
int
cplen
,
l
;
cp
=
of_get_property
(
device
,
"compatible"
,
&
cplen
);
cp
=
__
of_get_property
(
device
,
"compatible"
,
&
cplen
);
if
(
cp
==
NULL
)
if
(
cp
==
NULL
)
return
0
;
return
0
;
while
(
cplen
>
0
)
{
while
(
cplen
>
0
)
{
...
@@ -228,6 +250,20 @@ int of_device_is_compatible(const struct device_node *device,
...
@@ -228,6 +250,20 @@ int of_device_is_compatible(const struct device_node *device,
return
0
;
return
0
;
}
}
/** Checks if the given "compat" string matches one of the strings in
* the device's "compatible" property
*/
int
of_device_is_compatible
(
const
struct
device_node
*
device
,
const
char
*
compat
)
{
int
res
;
read_lock
(
&
devtree_lock
);
res
=
__of_device_is_compatible
(
device
,
compat
);
read_unlock
(
&
devtree_lock
);
return
res
;
}
EXPORT_SYMBOL
(
of_device_is_compatible
);
EXPORT_SYMBOL
(
of_device_is_compatible
);
/**
/**
...
@@ -501,7 +537,8 @@ struct device_node *of_find_compatible_node(struct device_node *from,
...
@@ -501,7 +537,8 @@ struct device_node *of_find_compatible_node(struct device_node *from,
if
(
type
if
(
type
&&
!
(
np
->
type
&&
(
of_node_cmp
(
np
->
type
,
type
)
==
0
)))
&&
!
(
np
->
type
&&
(
of_node_cmp
(
np
->
type
,
type
)
==
0
)))
continue
;
continue
;
if
(
of_device_is_compatible
(
np
,
compatible
)
&&
of_node_get
(
np
))
if
(
__of_device_is_compatible
(
np
,
compatible
)
&&
of_node_get
(
np
))
break
;
break
;
}
}
of_node_put
(
from
);
of_node_put
(
from
);
...
@@ -545,15 +582,9 @@ struct device_node *of_find_node_with_property(struct device_node *from,
...
@@ -545,15 +582,9 @@ struct device_node *of_find_node_with_property(struct device_node *from,
}
}
EXPORT_SYMBOL
(
of_find_node_with_property
);
EXPORT_SYMBOL
(
of_find_node_with_property
);
/**
static
* of_match_node - Tell if an device_node has a matching of_match structure
const
struct
of_device_id
*
__of_match_node
(
const
struct
of_device_id
*
matches
,
* @matches: array of of device match structures to search in
const
struct
device_node
*
node
)
* @node: the of device structure to match against
*
* Low level utility function used by device matching.
*/
const
struct
of_device_id
*
of_match_node
(
const
struct
of_device_id
*
matches
,
const
struct
device_node
*
node
)
{
{
if
(
!
matches
)
if
(
!
matches
)
return
NULL
;
return
NULL
;
...
@@ -567,14 +598,32 @@ const struct of_device_id *of_match_node(const struct of_device_id *matches,
...
@@ -567,14 +598,32 @@ const struct of_device_id *of_match_node(const struct of_device_id *matches,
match
&=
node
->
type
match
&=
node
->
type
&&
!
strcmp
(
matches
->
type
,
node
->
type
);
&&
!
strcmp
(
matches
->
type
,
node
->
type
);
if
(
matches
->
compatible
[
0
])
if
(
matches
->
compatible
[
0
])
match
&=
of_device_is_compatible
(
node
,
match
&=
__
of_device_is_compatible
(
node
,
matches
->
compatible
);
matches
->
compatible
);
if
(
match
)
if
(
match
)
return
matches
;
return
matches
;
matches
++
;
matches
++
;
}
}
return
NULL
;
return
NULL
;
}
}
/**
* of_match_node - Tell if an device_node has a matching of_match structure
* @matches: array of of device match structures to search in
* @node: the of device structure to match against
*
* Low level utility function used by device matching.
*/
const
struct
of_device_id
*
of_match_node
(
const
struct
of_device_id
*
matches
,
const
struct
device_node
*
node
)
{
const
struct
of_device_id
*
match
;
read_lock
(
&
devtree_lock
);
match
=
__of_match_node
(
matches
,
node
);
read_unlock
(
&
devtree_lock
);
return
match
;
}
EXPORT_SYMBOL
(
of_match_node
);
EXPORT_SYMBOL
(
of_match_node
);
/**
/**
...
@@ -595,6 +644,7 @@ struct device_node *of_find_matching_node_and_match(struct device_node *from,
...
@@ -595,6 +644,7 @@ struct device_node *of_find_matching_node_and_match(struct device_node *from,
const
struct
of_device_id
**
match
)
const
struct
of_device_id
**
match
)
{
{
struct
device_node
*
np
;
struct
device_node
*
np
;
const
struct
of_device_id
*
m
;
if
(
match
)
if
(
match
)
*
match
=
NULL
;
*
match
=
NULL
;
...
@@ -602,9 +652,10 @@ struct device_node *of_find_matching_node_and_match(struct device_node *from,
...
@@ -602,9 +652,10 @@ struct device_node *of_find_matching_node_and_match(struct device_node *from,
read_lock
(
&
devtree_lock
);
read_lock
(
&
devtree_lock
);
np
=
from
?
from
->
allnext
:
of_allnodes
;
np
=
from
?
from
->
allnext
:
of_allnodes
;
for
(;
np
;
np
=
np
->
allnext
)
{
for
(;
np
;
np
=
np
->
allnext
)
{
if
(
of_match_node
(
matches
,
np
)
&&
of_node_get
(
np
))
{
m
=
__of_match_node
(
matches
,
np
);
if
(
m
&&
of_node_get
(
np
))
{
if
(
match
)
if
(
match
)
*
match
=
m
atches
;
*
match
=
m
;
break
;
break
;
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录