imx_i2c.c (d1f8764099022bc1173f2413331b26d4ff609a0c) imx_i2c.c (cb8d4c8f54b8271f642f02382eec29d468bb1c77)
1/*
2 * i.MX I2C Bus Serial Interface Emulation
3 *
4 * Copyright (C) 2013 Jean-Christophe Dubois. <jcd@tribudubois.net>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or

--- 233 unchanged lines hidden (view full) ---

242
243 s->i2dr_write = value & I2DR_MASK;
244
245 if (imx_i2c_is_master(s)) {
246 /* If this is the first write cycle then it is the slave addr */
247 if (s->address == ADDR_RESET) {
248 if (i2c_start_transfer(s->bus, extract32(s->i2dr_write, 1, 7),
249 extract32(s->i2dr_write, 0, 1))) {
1/*
2 * i.MX I2C Bus Serial Interface Emulation
3 *
4 * Copyright (C) 2013 Jean-Christophe Dubois. <jcd@tribudubois.net>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or

--- 233 unchanged lines hidden (view full) ---

242
243 s->i2dr_write = value & I2DR_MASK;
244
245 if (imx_i2c_is_master(s)) {
246 /* If this is the first write cycle then it is the slave addr */
247 if (s->address == ADDR_RESET) {
248 if (i2c_start_transfer(s->bus, extract32(s->i2dr_write, 1, 7),
249 extract32(s->i2dr_write, 0, 1))) {
250 /* if non zero is returned, the adress is not valid */
250 /* if non zero is returned, the address is not valid */
251 s->i2sr |= I2SR_RXAK;
252 } else {
253 s->address = s->i2dr_write;
254 s->i2sr &= ~I2SR_RXAK;
255 imx_i2c_raise_interrupt(s);
256 }
257 } else { /* This is a normal data write */
258 if (i2c_send(s->bus, s->i2dr_write)) {

--- 79 unchanged lines hidden ---
251 s->i2sr |= I2SR_RXAK;
252 } else {
253 s->address = s->i2dr_write;
254 s->i2sr &= ~I2SR_RXAK;
255 imx_i2c_raise_interrupt(s);
256 }
257 } else { /* This is a normal data write */
258 if (i2c_send(s->bus, s->i2dr_write)) {

--- 79 unchanged lines hidden ---