]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
i2c: Re-order the interrupt enable sequence in the i2c send and raceive paths
authorNava kishore Manne <nava.manne@xilinx.com>
Fri, 7 Jul 2017 12:03:50 +0000 (17:33 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Mon, 10 Jul 2017 07:37:59 +0000 (09:37 +0200)
This patch Enable the required interrupts before trigger the i2c
operation in cdns_i2c_mrecv() and cdns_i2c_msend().

Signed-off-by: Nava kishore Manne <navam@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/i2c/busses/i2c-cadence.c

index 22cac769273561894c5ca45dc1e0824f14d81f58..cb956f651e723f5097c78370640387d1a688ce13 100644 (file)
@@ -657,9 +657,9 @@ static void cdns_i2c_mrecv(struct cdns_i2c *id)
                (id->recv_count <= CDNS_I2C_FIFO_DEPTH))
                        cdns_i2c_clear_bus_hold(id);
        /* Set the slave address in address register - triggers operation */
+       cdns_i2c_writereg(CDNS_I2C_ENABLED_INTR_MASK, CDNS_I2C_IER_OFFSET);
        cdns_i2c_writereg(id->p_msg->addr & CDNS_I2C_ADDR_MASK,
                                                CDNS_I2C_ADDR_OFFSET);
-       cdns_i2c_writereg(CDNS_I2C_ENABLED_INTR_MASK, CDNS_I2C_IER_OFFSET);
 }
 
 /**
@@ -719,10 +719,9 @@ static void cdns_i2c_msend(struct cdns_i2c *id)
        if (!id->bus_hold_flag && !id->send_count)
                cdns_i2c_clear_bus_hold(id);
        /* Set the slave address in address register - triggers operation. */
+       cdns_i2c_writereg(CDNS_I2C_ENABLED_INTR_MASK, CDNS_I2C_IER_OFFSET);
        cdns_i2c_writereg(id->p_msg->addr & CDNS_I2C_ADDR_MASK,
                                                CDNS_I2C_ADDR_OFFSET);
-
-       cdns_i2c_writereg(CDNS_I2C_ENABLED_INTR_MASK, CDNS_I2C_IER_OFFSET);
 }
 
 /**