Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1394332

[PATCH v7 4/9] i2c: rk3x: Move setting STATE_START and add STATE_SETUP

From David Wu <david.wu@rock-chips.com>
Newsgroups linux.kernel
Subject [PATCH v7 4/9] i2c: rk3x: Move setting STATE_START and add STATE_SETUP
Date 2016-05-04 16:20 +0200
Message-ID <rv5OG-5wR-23@gated-at.bofh.it> (permalink)
References <rv5OG-5wR-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Signed-off-by: David Wu <david.wu@rock-chips.com>
---
Change in v7:
- none

 drivers/i2c/busses/i2c-rk3x.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c
index 9eeb4e5..0838fcf 100644
--- a/drivers/i2c/busses/i2c-rk3x.c
+++ b/drivers/i2c/busses/i2c-rk3x.c
@@ -87,6 +87,7 @@ struct rk3x_i2c_calced_timings {
 
 enum rk3x_i2c_state {
 	STATE_IDLE,
+	STATE_SETUP,
 	STATE_START,
 	STATE_READ,
 	STATE_WRITE,
@@ -174,6 +175,7 @@ static void rk3x_i2c_start(struct rk3x_i2c *i2c)
 {
 	u32 val;
 
+	i2c->state = STATE_START;
 	i2c_writel(i2c, REG_INT_START, REG_IEN);
 
 	/* enable adapter with correct mode, send START condition */
@@ -451,6 +453,7 @@ static irqreturn_t rk3x_i2c_irq(int irqno, void *dev_id)
 		rk3x_i2c_handle_stop(i2c, ipd);
 		break;
 	case STATE_IDLE:
+	case STATE_SETUP:
 		break;
 	}
 
@@ -781,7 +784,7 @@ static int rk3x_i2c_setup(struct rk3x_i2c *i2c, struct i2c_msg *msgs, int num)
 
 	i2c->addr = msgs[0].addr;
 	i2c->busy = true;
-	i2c->state = STATE_START;
+	i2c->state = STATE_SETUP;
 	i2c->processed = 0;
 	i2c->error = 0;
 
-- 
1.9.1

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH v7 4/9] i2c: rk3x: Move setting STATE_START and add STATE_SETUP David Wu <david.wu@rock-chips.com> - 2016-05-04 16:20 +0200
  Re: [PATCH v7 4/9] i2c: rk3x: Move setting STATE_START and add STATE_SETUP Doug Anderson <dianders@chromium.org> - 2016-05-06 01:00 +0200
    Re: [PATCH v7 4/9] i2c: rk3x: Move setting STATE_START and add  STATE_SETUP "David.Wu" <david.wu@rock-chips.com> - 2016-05-06 05:30 +0200

csiph-web