Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
21bbd691
Commit
21bbd691
authored
Jan 09, 2006
by
Jean Delvare
Committed by
Greg Kroah-Hartman
Feb 06, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] I2C: Resurrect i2c_smbus_write_i2c_block_data.
Signed-off-by:
Jean Delvare
<
khali@linux-fr.org
>
parent
8254fc4a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
drivers/i2c/i2c-core.c
drivers/i2c/i2c-core.c
+15
-0
include/linux/i2c.h
include/linux/i2c.h
+3
-0
No files found.
drivers/i2c/i2c-core.c
View file @
21bbd691
...
...
@@ -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
No checking of parameters is done! */
static
s32
i2c_smbus_xfer_emulated
(
struct
i2c_adapter
*
adapter
,
u16
addr
,
...
...
@@ -1150,6 +1164,7 @@ EXPORT_SYMBOL(i2c_smbus_read_word_data);
EXPORT_SYMBOL
(
i2c_smbus_write_word_data
);
EXPORT_SYMBOL
(
i2c_smbus_write_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_DESCRIPTION
(
"I2C-Bus main module"
);
...
...
include/linux/i2c.h
View file @
21bbd691
...
...
@@ -100,6 +100,9 @@ extern s32 i2c_smbus_write_block_data(struct i2c_client * client,
/* Returns the number of read bytes */
extern
s32
i2c_smbus_read_i2c_block_data
(
struct
i2c_client
*
client
,
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment