From: minyard@acm.org (Corey Minyard)
To: Greg KH <greg@kroah.com>, lkml <linux-kernel@vger.kernel.org>,
Sensors <sensors@stimpy.netroedge.com>
Subject: [PATCH] Add a non-blocking interface to the I2C code, part 6
Date: Thu, 19 May 2005 06:25:40 +0000 [thread overview]
Message-ID: <42261C39.30000@acm.org> (raw)
In-Reply-To: <42261AFB.40001@acm.org>
See part 1 for details on what this does...
-------------- next part --------------
This adds back in the i2c_smbus_read_block_data() function
which is needed by the IPMI SMB driver (coming soon).
Signed-off-by: Corey Minyard <minyard@acm.org>
Index: linux-2.6.11-rc5-mm1/drivers/i2c/i2c-core.c
=================================--- linux-2.6.11-rc5-mm1.orig/drivers/i2c/i2c-core.c
+++ linux-2.6.11-rc5-mm1/drivers/i2c/i2c-core.c
@@ -1250,6 +1250,23 @@
}
/* Returns the number of read bytes */
+s32 i2c_smbus_read_block_data(struct i2c_client *client, u8 command,
+ u8 *values)
+{
+ union i2c_smbus_data data;
+ int i;
+ if (i2c_smbus_xfer(client->adapter,client->addr,client->flags,
+ I2C_SMBUS_READ,command,
+ I2C_SMBUS_BLOCK_DATA,&data))
+ return -1;
+ else {
+ for (i = 1; i <= data.block[0]; i++)
+ values[i-1] = data.block[i];
+ return data.block[0];
+ }
+}
+
+/* Returns the number of read bytes */
s32 i2c_smbus_read_i2c_block_data(struct i2c_client *client, u8 command, u8 *values)
{
union i2c_smbus_data data;
@@ -1731,6 +1748,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_block_data);
EXPORT_SYMBOL(i2c_smbus_read_i2c_block_data);
EXPORT_SYMBOL(i2c_non_blocking_capable);
Index: linux-2.6.11-rc5-mm1/include/linux/i2c.h
=================================--- linux-2.6.11-rc5-mm1.orig/include/linux/i2c.h
+++ linux-2.6.11-rc5-mm1/include/linux/i2c.h
@@ -99,6 +99,8 @@
extern s32 i2c_smbus_write_block_data(struct i2c_client * client,
u8 command, u8 length,
u8 *values);
+extern s32 i2c_smbus_read_block_data(struct i2c_client * client,
+ u8 command, u8 *values);
extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client,
u8 command, u8 *values);
WARNING: multiple messages have this Message-ID (diff)
From: Corey Minyard <minyard@acm.org>
To: Greg KH <greg@kroah.com>, lkml <linux-kernel@vger.kernel.org>,
Sensors <sensors@stimpy.netroedge.com>
Subject: [PATCH] Add a non-blocking interface to the I2C code, part 6
Date: Wed, 02 Mar 2005 14:04:09 -0600 [thread overview]
Message-ID: <42261C39.30000@acm.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 45 bytes --]
See part 1 for details on what this does...
[-- Attachment #2: i2c_add_read_block.diff --]
[-- Type: text/plain, Size: 1881 bytes --]
This adds back in the i2c_smbus_read_block_data() function
which is needed by the IPMI SMB driver (coming soon).
Signed-off-by: Corey Minyard <minyard@acm.org>
Index: linux-2.6.11-rc5-mm1/drivers/i2c/i2c-core.c
===================================================================
--- linux-2.6.11-rc5-mm1.orig/drivers/i2c/i2c-core.c
+++ linux-2.6.11-rc5-mm1/drivers/i2c/i2c-core.c
@@ -1250,6 +1250,23 @@
}
/* Returns the number of read bytes */
+s32 i2c_smbus_read_block_data(struct i2c_client *client, u8 command,
+ u8 *values)
+{
+ union i2c_smbus_data data;
+ int i;
+ if (i2c_smbus_xfer(client->adapter,client->addr,client->flags,
+ I2C_SMBUS_READ,command,
+ I2C_SMBUS_BLOCK_DATA,&data))
+ return -1;
+ else {
+ for (i = 1; i <= data.block[0]; i++)
+ values[i-1] = data.block[i];
+ return data.block[0];
+ }
+}
+
+/* Returns the number of read bytes */
s32 i2c_smbus_read_i2c_block_data(struct i2c_client *client, u8 command, u8 *values)
{
union i2c_smbus_data data;
@@ -1731,6 +1748,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_block_data);
EXPORT_SYMBOL(i2c_smbus_read_i2c_block_data);
EXPORT_SYMBOL(i2c_non_blocking_capable);
Index: linux-2.6.11-rc5-mm1/include/linux/i2c.h
===================================================================
--- linux-2.6.11-rc5-mm1.orig/include/linux/i2c.h
+++ linux-2.6.11-rc5-mm1/include/linux/i2c.h
@@ -99,6 +99,8 @@
extern s32 i2c_smbus_write_block_data(struct i2c_client * client,
u8 command, u8 length,
u8 *values);
+extern s32 i2c_smbus_read_block_data(struct i2c_client * client,
+ u8 command, u8 *values);
extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client,
u8 command, u8 *values);
next parent reply other threads:[~2005-05-19 6:25 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-02 20:04 Corey Minyard [this message]
2005-05-19 6:25 ` [PATCH] Add a non-blocking interface to the I2C code, part 6 Corey Minyard
-- strict thread matches above, loose matches on Subject: below --
2005-03-02 20:04 [PATCH] Add a non-blocking interface to the I2C code, part 7 Corey Minyard
2005-05-19 6:25 ` Corey Minyard
2005-03-02 20:02 [PATCH] Add a non-blocking interface to the I2C code, part 5 Corey Minyard
2005-05-19 6:25 ` Corey Minyard
2005-03-02 20:02 [PATCH] Add a non-blocking interface to the I2C code, part 4 Corey Minyard
2005-05-19 6:25 ` Corey Minyard
2005-03-02 20:01 [PATCH] Add a non-blocking interface to the I2C code, part3 Corey Minyard
2005-05-19 6:25 ` Corey Minyard
2005-03-02 20:00 [PATCH] Add a non-blocking interface to the I2C code, part 2 Corey Minyard
2005-05-19 6:25 ` Corey Minyard
2005-03-02 19:58 [PATCH] Add a non-blocking interface to the I2C code, part 1 Corey Minyard
2005-05-19 6:25 ` Corey Minyard
2005-03-17 7:09 ` Greg KH
2005-05-19 6:25 ` Greg KH
2005-03-18 16:13 ` Corey Minyard
2005-05-19 6:25 ` Corey Minyard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=42261C39.30000@acm.org \
--to=minyard@acm.org \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sensors@stimpy.netroedge.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.