diff options
Diffstat (limited to 'drivers/i2c/busses/i2c-xiic.c')
-rw-r--r-- | drivers/i2c/busses/i2c-xiic.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index c80527816ad0..9a71e50d21f1 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -33,7 +33,7 @@ #include <linux/i2c.h> #include <linux/interrupt.h> #include <linux/wait.h> -#include <linux/i2c-xiic.h> +#include <linux/platform_data/i2c-xiic.h> #include <linux/io.h> #include <linux/slab.h> #include <linux/of.h> @@ -143,12 +143,6 @@ struct xiic_i2c { #define XIIC_TX_RX_INTERRUPTS (XIIC_INTR_RX_FULL_MASK | XIIC_TX_INTERRUPTS) -/* The following constants are used with the following macros to specify the - * operation, a read or write operation. - */ -#define XIIC_READ_OPERATION 1 -#define XIIC_WRITE_OPERATION 0 - /* * Tx Fifo upper bit masks. */ @@ -415,7 +409,7 @@ static irqreturn_t xiic_process(int irq, void *dev_id) clr |= XIIC_INTR_RX_FULL_MASK; if (!i2c->rx_msg) { dev_dbg(i2c->adap.dev.parent, - "%s unexpexted RX IRQ\n", __func__); + "%s unexpected RX IRQ\n", __func__); xiic_clear_rx_fifo(i2c); goto out; } @@ -470,7 +464,7 @@ static irqreturn_t xiic_process(int irq, void *dev_id) if (!i2c->tx_msg) { dev_dbg(i2c->adap.dev.parent, - "%s unexpexted TX IRQ\n", __func__); + "%s unexpected TX IRQ\n", __func__); goto out; } @@ -556,8 +550,7 @@ static void xiic_start_recv(struct xiic_i2c *i2c) if (!(msg->flags & I2C_M_NOSTART)) /* write the address */ xiic_setreg16(i2c, XIIC_DTR_REG_OFFSET, - (msg->addr << 1) | XIIC_READ_OPERATION | - XIIC_TX_DYN_START_MASK); + i2c_8bit_addr_from_msg(msg) | XIIC_TX_DYN_START_MASK); xiic_irq_clr_en(i2c, XIIC_INTR_BNB_MASK); @@ -585,7 +578,7 @@ static void xiic_start_send(struct xiic_i2c *i2c) if (!(msg->flags & I2C_M_NOSTART)) { /* write the address */ - u16 data = ((msg->addr << 1) & 0xfe) | XIIC_WRITE_OPERATION | + u16 data = i2c_8bit_addr_from_msg(msg) | XIIC_TX_DYN_START_MASK; if ((i2c->nmsgs == 1) && msg->len == 0) /* no data and last message -> add STOP */ |