Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gsplhtlxg
clone-Linux
提交
21bbd691
C
clone-Linux
项目概览
gsplhtlxg
/
clone-Linux
通知
2
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
clone-Linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
21bbd691
编写于
1月 09, 2006
作者:
J
Jean Delvare
提交者:
Greg Kroah-Hartman
2月 06, 2006
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[PATCH] I2C: Resurrect i2c_smbus_write_i2c_block_data.
Signed-off-by:
N
Jean Delvare
<
khali@linux-fr.org
>
上级
8254fc4a
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
18 addition
and
0 deletion
+18
-0
drivers/i2c/i2c-core.c
drivers/i2c/i2c-core.c
+15
-0
include/linux/i2c.h
include/linux/i2c.h
+3
-0
未找到文件。
drivers/i2c/i2c-core.c
浏览文件 @
21bbd691
...
@@ -946,6 +946,20 @@ s32 i2c_smbus_read_i2c_block_data(struct i2c_client *client, u8 command, u8 *val
...
@@ -946,6 +946,20 @@ s32 i2c_smbus_read_i2c_block_data(struct i2c_client *client, u8 command, u8 *val
}
}
}
}
s32
i2c_smbus_write_i2c_block_data
(
struct
i2c_client
*
client
,
u8
command
,
u8
length
,
u8
*
values
)
{
union
i2c_smbus_data
data
;
if
(
length
>
I2C_SMBUS_BLOCK_MAX
)
length
=
I2C_SMBUS_BLOCK_MAX
;
data
.
block
[
0
]
=
length
;
memcpy
(
data
.
block
+
1
,
values
,
length
);
return
i2c_smbus_xfer
(
client
->
adapter
,
client
->
addr
,
client
->
flags
,
I2C_SMBUS_WRITE
,
command
,
I2C_SMBUS_I2C_BLOCK_DATA
,
&
data
);
}
/* Simulate a SMBus command using the i2c protocol
/* Simulate a SMBus command using the i2c protocol
No checking of parameters is done! */
No checking of parameters is done! */
static
s32
i2c_smbus_xfer_emulated
(
struct
i2c_adapter
*
adapter
,
u16
addr
,
static
s32
i2c_smbus_xfer_emulated
(
struct
i2c_adapter
*
adapter
,
u16
addr
,
...
@@ -1150,6 +1164,7 @@ EXPORT_SYMBOL(i2c_smbus_read_word_data);
...
@@ -1150,6 +1164,7 @@ EXPORT_SYMBOL(i2c_smbus_read_word_data);
EXPORT_SYMBOL
(
i2c_smbus_write_word_data
);
EXPORT_SYMBOL
(
i2c_smbus_write_word_data
);
EXPORT_SYMBOL
(
i2c_smbus_write_block_data
);
EXPORT_SYMBOL
(
i2c_smbus_write_block_data
);
EXPORT_SYMBOL
(
i2c_smbus_read_i2c_block_data
);
EXPORT_SYMBOL
(
i2c_smbus_read_i2c_block_data
);
EXPORT_SYMBOL
(
i2c_smbus_write_i2c_block_data
);
MODULE_AUTHOR
(
"Simon G. Vogl <simon@tk.uni-linz.ac.at>"
);
MODULE_AUTHOR
(
"Simon G. Vogl <simon@tk.uni-linz.ac.at>"
);
MODULE_DESCRIPTION
(
"I2C-Bus main module"
);
MODULE_DESCRIPTION
(
"I2C-Bus main module"
);
...
...
include/linux/i2c.h
浏览文件 @
21bbd691
...
@@ -100,6 +100,9 @@ extern s32 i2c_smbus_write_block_data(struct i2c_client * client,
...
@@ -100,6 +100,9 @@ extern s32 i2c_smbus_write_block_data(struct i2c_client * client,
/* Returns the number of read bytes */
/* Returns the number of read bytes */
extern
s32
i2c_smbus_read_i2c_block_data
(
struct
i2c_client
*
client
,
extern
s32
i2c_smbus_read_i2c_block_data
(
struct
i2c_client
*
client
,
u8
command
,
u8
*
values
);
u8
command
,
u8
*
values
);
extern
s32
i2c_smbus_write_i2c_block_data
(
struct
i2c_client
*
client
,
u8
command
,
u8
length
,
u8
*
values
);
/*
/*
* A driver is capable of handling one or more physical devices present on
* A driver is capable of handling one or more physical devices present on
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录