From: Russell King <rmk+kernel@arm.linux.org.uk>
To: linux-arm-kernel@lists.infradead.org
Cc: Jason Cooper <jason@lakedaemon.net>,
Wolfram Sang <wsa@the-dreams.de>,
"Mark A. Greer" <mgreer@animalcreek.com>,
linux-i2c@vger.kernel.org,
"Ben Dooks (embedded platforms)" <ben-linux@fluff.org>,
Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Subject: [PATCH 8/9] I2C: mv64xxx: move mv64xxx_i2c_prepare_for_io()
Date: Thu, 16 May 2013 21:38:11 +0100 [thread overview]
Message-ID: <E1Ud4wF-0004K5-U1@rmk-PC.arm.linux.org.uk> (raw)
In-Reply-To: <20130516202921.GW18614@n2100.arm.linux.org.uk>
Move mv64xxx_i2c_prepare_for_io() higher up in the driver to avoid a
future forward declaration for this function.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
drivers/i2c/busses/i2c-mv64xxx.c | 52 +++++++++++++++++++-------------------
1 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
index d160f8c..7457ef5 100644
--- a/drivers/i2c/busses/i2c-mv64xxx.c
+++ b/drivers/i2c/busses/i2c-mv64xxx.c
@@ -110,6 +110,32 @@ struct mv64xxx_i2c_data {
struct i2c_adapter adapter;
};
+static void
+mv64xxx_i2c_prepare_for_io(struct mv64xxx_i2c_data *drv_data,
+ struct i2c_msg *msg)
+{
+ u32 dir = 0;
+
+ drv_data->msg = msg;
+ drv_data->byte_posn = 0;
+ drv_data->bytes_left = msg->len;
+ drv_data->aborting = 0;
+ drv_data->rc = 0;
+ drv_data->cntl_bits = MV64XXX_I2C_REG_CONTROL_ACK |
+ MV64XXX_I2C_REG_CONTROL_INTEN | MV64XXX_I2C_REG_CONTROL_TWSIEN;
+
+ if (msg->flags & I2C_M_RD)
+ dir = 1;
+
+ if (msg->flags & I2C_M_TEN) {
+ drv_data->addr1 = 0xf0 | (((u32)msg->addr & 0x300) >> 7) | dir;
+ drv_data->addr2 = (u32)msg->addr & 0xff;
+ } else {
+ drv_data->addr1 = ((u32)msg->addr & 0x7f) << 1 | dir;
+ drv_data->addr2 = 0;
+ }
+}
+
/*
*****************************************************************************
*
@@ -347,32 +373,6 @@ mv64xxx_i2c_intr(int irq, void *dev_id)
*****************************************************************************
*/
static void
-mv64xxx_i2c_prepare_for_io(struct mv64xxx_i2c_data *drv_data,
- struct i2c_msg *msg)
-{
- u32 dir = 0;
-
- drv_data->msg = msg;
- drv_data->byte_posn = 0;
- drv_data->bytes_left = msg->len;
- drv_data->aborting = 0;
- drv_data->rc = 0;
- drv_data->cntl_bits = MV64XXX_I2C_REG_CONTROL_ACK |
- MV64XXX_I2C_REG_CONTROL_INTEN | MV64XXX_I2C_REG_CONTROL_TWSIEN;
-
- if (msg->flags & I2C_M_RD)
- dir = 1;
-
- if (msg->flags & I2C_M_TEN) {
- drv_data->addr1 = 0xf0 | (((u32)msg->addr & 0x300) >> 7) | dir;
- drv_data->addr2 = (u32)msg->addr & 0xff;
- } else {
- drv_data->addr1 = ((u32)msg->addr & 0x7f) << 1 | dir;
- drv_data->addr2 = 0;
- }
-}
-
-static void
mv64xxx_i2c_wait_for_completion(struct mv64xxx_i2c_data *drv_data)
{
long time_left;
--
1.7.4.4
next prev parent reply other threads:[~2013-05-16 20:38 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-16 20:29 [PATCH 0/9] Fix Marvell mv63xxx I2C driver Russell King - ARM Linux
2013-05-16 20:30 ` [PATCH 1/9] I2C: mv64xxx: work around signals causing I2C transactions to be aborted Russell King
[not found] ` <E1Ud4pH-0004JQ-Jq-eh5Bv4kxaXIANfyc6IWni62ZND6+EDdj@public.gmane.org>
2013-05-17 6:37 ` Jean-Francois Moine
2013-05-17 8:31 ` Russell King - ARM Linux
2013-05-17 12:17 ` Wolfram Sang
2013-05-17 17:06 ` Mark A. Greer
2013-05-16 20:32 ` [PATCH 2/9] I2C: mv64xxx: use return value from mv64xxx_i2c_map_regs() Russell King
2013-05-16 20:33 ` [PATCH 3/9] I2C: mv64xxx: use devm_ioremap_resource() Russell King
[not found] ` <E1Ud4rN-0004Jc-CL-eh5Bv4kxaXIANfyc6IWni62ZND6+EDdj@public.gmane.org>
2013-05-17 9:23 ` Jean-Francois Moine
2013-05-17 9:34 ` Russell King - ARM Linux
2013-05-16 20:34 ` [PATCH 4/9] I2C: mv64xxx: use devm_clk_get() to avoid missing clk_put() Russell King
2013-05-16 20:35 ` [PATCH 5/9] I2C: mv64xxx: use devm_kzalloc() Russell King
2013-05-16 20:36 ` [PATCH 6/9] I2C: mv64xxx: fix error handling for request_irq() Russell King
2013-05-16 20:37 ` [PATCH 7/9] I2C: mv64xxx: remove I2C_M_NOSTART code Russell King
[not found] ` <E1Ud4vH-0004Jz-F6-eh5Bv4kxaXIANfyc6IWni62ZND6+EDdj@public.gmane.org>
2013-05-22 19:05 ` Mark Brown
2013-05-16 20:38 ` Russell King [this message]
2013-05-16 20:39 ` [PATCH 9/9] I2C: mv64xxx: fix race between FSM/interrupt and process context Russell King
[not found] ` <E1Ud4xE-0004KB-2T-eh5Bv4kxaXIANfyc6IWni62ZND6+EDdj@public.gmane.org>
2013-05-17 9:51 ` Wolfram Sang
2013-05-17 10:00 ` Russell King - ARM Linux
[not found] ` <20130517100016.GB18614-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-05-17 12:15 ` Wolfram Sang
[not found] ` <20130516202921.GW18614-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-06-05 21:48 ` [PATCH 0/9] Fix Marvell mv63xxx I2C driver Wolfram Sang
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=E1Ud4wF-0004K5-U1@rmk-PC.arm.linux.org.uk \
--to=rmk+kernel@arm.linux.org.uk \
--cc=ben-linux@fluff.org \
--cc=jason@lakedaemon.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=mgreer@animalcreek.com \
--cc=sebastian.hesselbarth@gmail.com \
--cc=wsa@the-dreams.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).