Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
28893126
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
161
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看板
未验证
提交
28893126
编写于
3月 12, 2018
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branches 'regmap/topic/debugfs' and 'regmap/topic/mmio-clk' into regmap-next
上级
493ea0c8
59dd2a85
31895662
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
47 addition
and
2 deletion
+47
-2
drivers/base/regmap/regmap-debugfs.c
drivers/base/regmap/regmap-debugfs.c
+18
-2
drivers/base/regmap/regmap-mmio.c
drivers/base/regmap/regmap-mmio.c
+24
-0
drivers/base/regmap/regmap.c
drivers/base/regmap/regmap.c
+2
-0
include/linux/regmap.h
include/linux/regmap.h
+3
-0
未找到文件。
drivers/base/regmap/regmap-debugfs.c
浏览文件 @
28893126
...
...
@@ -25,6 +25,7 @@ struct regmap_debugfs_node {
struct
list_head
link
;
};
static
unsigned
int
dummy_index
;
static
struct
dentry
*
regmap_debugfs_root
;
static
LIST_HEAD
(
regmap_debugfs_early_list
);
static
DEFINE_MUTEX
(
regmap_debugfs_early_lock
);
...
...
@@ -40,6 +41,7 @@ static ssize_t regmap_name_read_file(struct file *file,
loff_t
*
ppos
)
{
struct
regmap
*
map
=
file
->
private_data
;
const
char
*
name
=
"nodev"
;
int
ret
;
char
*
buf
;
...
...
@@ -47,7 +49,10 @@ static ssize_t regmap_name_read_file(struct file *file,
if
(
!
buf
)
return
-
ENOMEM
;
ret
=
snprintf
(
buf
,
PAGE_SIZE
,
"%s
\n
"
,
map
->
dev
->
driver
->
name
);
if
(
map
->
dev
&&
map
->
dev
->
driver
)
name
=
map
->
dev
->
driver
->
name
;
ret
=
snprintf
(
buf
,
PAGE_SIZE
,
"%s
\n
"
,
name
);
if
(
ret
<
0
)
{
kfree
(
buf
);
return
ret
;
...
...
@@ -569,9 +574,20 @@ void regmap_debugfs_init(struct regmap *map, const char *name)
name
=
devname
;
}
if
(
!
strcmp
(
name
,
"dummy"
))
{
map
->
debugfs_name
=
kasprintf
(
GFP_KERNEL
,
"dummy%d"
,
dummy_index
);
name
=
map
->
debugfs_name
;
dummy_index
++
;
}
map
->
debugfs
=
debugfs_create_dir
(
name
,
regmap_debugfs_root
);
if
(
!
map
->
debugfs
)
{
dev_warn
(
map
->
dev
,
"Failed to create debugfs directory
\n
"
);
dev_warn
(
map
->
dev
,
"Failed to create %s debugfs directory
\n
"
,
name
);
kfree
(
map
->
debugfs_name
);
map
->
debugfs_name
=
NULL
;
return
;
}
...
...
drivers/base/regmap/regmap-mmio.c
浏览文件 @
28893126
...
...
@@ -28,6 +28,8 @@
struct
regmap_mmio_context
{
void
__iomem
*
regs
;
unsigned
val_bytes
;
bool
attached_clk
;
struct
clk
*
clk
;
void
(
*
reg_write
)(
struct
regmap_mmio_context
*
ctx
,
...
...
@@ -363,4 +365,26 @@ struct regmap *__devm_regmap_init_mmio_clk(struct device *dev,
}
EXPORT_SYMBOL_GPL
(
__devm_regmap_init_mmio_clk
);
int
regmap_mmio_attach_clk
(
struct
regmap
*
map
,
struct
clk
*
clk
)
{
struct
regmap_mmio_context
*
ctx
=
map
->
bus_context
;
ctx
->
clk
=
clk
;
ctx
->
attached_clk
=
true
;
return
clk_prepare
(
ctx
->
clk
);
}
EXPORT_SYMBOL_GPL
(
regmap_mmio_attach_clk
);
void
regmap_mmio_detach_clk
(
struct
regmap
*
map
)
{
struct
regmap_mmio_context
*
ctx
=
map
->
bus_context
;
clk_unprepare
(
ctx
->
clk
);
ctx
->
attached_clk
=
false
;
ctx
->
clk
=
NULL
;
}
EXPORT_SYMBOL_GPL
(
regmap_mmio_detach_clk
);
MODULE_LICENSE
(
"GPL v2"
);
drivers/base/regmap/regmap.c
浏览文件 @
28893126
...
...
@@ -1116,6 +1116,8 @@ struct regmap *__regmap_init(struct device *dev,
ret
=
regmap_attach_dev
(
dev
,
map
,
config
);
if
(
ret
!=
0
)
goto
err_regcache
;
}
else
{
regmap_debugfs_init
(
map
,
config
->
name
);
}
return
map
;
...
...
include/linux/regmap.h
浏览文件 @
28893126
...
...
@@ -21,6 +21,7 @@
#include <linux/lockdep.h>
struct
module
;
struct
clk
;
struct
device
;
struct
i2c_client
;
struct
irq_domain
;
...
...
@@ -905,6 +906,8 @@ bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg);
__regmap_lockdep_wrapper(__devm_regmap_init_sdw, #config, \
sdw, config)
int
regmap_mmio_attach_clk
(
struct
regmap
*
map
,
struct
clk
*
clk
);
void
regmap_mmio_detach_clk
(
struct
regmap
*
map
);
void
regmap_exit
(
struct
regmap
*
map
);
int
regmap_reinit_cache
(
struct
regmap
*
map
,
const
struct
regmap_config
*
config
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录