Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
555fedac
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
555fedac
编写于
8月 08, 2011
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge branches 'regmap-linus' and 'regmap-interface' into regmap-next
上级
2547e201
40c5cc26
18694886
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
33 addition
and
1 deletion
+33
-1
drivers/base/regmap/regmap.c
drivers/base/regmap/regmap.c
+10
-1
include/linux/regmap.h
include/linux/regmap.h
+23
-0
未找到文件。
drivers/base/regmap/regmap.c
浏览文件 @
555fedac
...
...
@@ -37,6 +37,11 @@ struct regmap {
void
*
work_buf
;
/* Scratch buffer used to format I/O */
struct
regmap_format
format
;
/* Buffer format */
const
struct
regmap_bus
*
bus
;
unsigned
int
max_register
;
bool
(
*
writeable_reg
)(
struct
device
*
dev
,
unsigned
int
reg
);
bool
(
*
readable_reg
)(
struct
device
*
dev
,
unsigned
int
reg
);
bool
(
*
volatile_reg
)(
struct
device
*
dev
,
unsigned
int
reg
);
};
static
void
regmap_format_4_12_write
(
struct
regmap
*
map
,
...
...
@@ -116,6 +121,10 @@ struct regmap *regmap_init(struct device *dev,
map
->
format
.
val_bytes
=
config
->
val_bits
/
8
;
map
->
dev
=
dev
;
map
->
bus
=
bus
;
map
->
max_register
=
config
->
max_register
;
map
->
writeable_reg
=
config
->
writeable_reg
;
map
->
readable_reg
=
config
->
readable_reg
;
map
->
volatile_reg
=
config
->
volatile_reg
;
switch
(
config
->
reg_bits
)
{
case
4
:
...
...
@@ -323,7 +332,7 @@ static int _regmap_raw_read(struct regmap *map, unsigned int reg, void *val,
u8
[
0
]
|=
map
->
bus
->
read_flag_mask
;
ret
=
map
->
bus
->
read
(
map
->
dev
,
map
->
work_buf
,
map
->
format
.
reg_bytes
,
val
,
map
->
format
.
val_bytes
);
val
,
val_len
);
if
(
ret
!=
0
)
return
ret
;
...
...
include/linux/regmap.h
浏览文件 @
555fedac
...
...
@@ -20,9 +20,32 @@
struct
i2c_client
;
struct
spi_device
;
/**
* Configuration for the register map of a device.
*
* @reg_bits: Number of bits in a register address, mandatory.
* @val_bits: Number of bits in a register value, mandatory.
*
* @max_register: Optional, specifies the maximum valid register index.
* @writeable_register: Optional callback returning true if the register
* can be written to.
* @readable_register: Optional callback returning true if the register
* can be read from.
* @volatile_register: Optional callback returning true if the register
* value can't be cached.
* @precious_register: Optional callback returning true if the rgister
* should not be read outside of a call from the driver
* (eg, a clear on read interrupt status register).
*/
struct
regmap_config
{
int
reg_bits
;
int
val_bits
;
unsigned
int
max_register
;
bool
(
*
writeable_reg
)(
struct
device
*
dev
,
unsigned
int
reg
);
bool
(
*
readable_reg
)(
struct
device
*
dev
,
unsigned
int
reg
);
bool
(
*
volatile_reg
)(
struct
device
*
dev
,
unsigned
int
reg
);
bool
(
*
precious_reg
)(
struct
device
*
dev
,
unsigned
int
reg
);
};
typedef
int
(
*
regmap_hw_write
)(
struct
device
*
dev
,
const
void
*
data
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录