Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f328ddc1 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6

* 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6:
  i2c-algo-pca: Let PCA9564 recover from unacked data byte (state 0x30)
  i2c-algo-bit: Fix timeout test
  i2c: Timeouts off by 1
parents 80445de5 2196d1cf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -104,7 +104,7 @@ static int sclhi(struct i2c_algo_bit_data *adap)
		 * chips may hold it low ("clock stretching") while they
		 * are processing data internally.
		 */
		if (time_after_eq(jiffies, start + adap->timeout))
		if (time_after(jiffies, start + adap->timeout))
			return -ETIMEDOUT;
		cond_resched();
	}
+11 −0
Original line number Diff line number Diff line
@@ -287,10 +287,21 @@ static int pca_xfer(struct i2c_adapter *i2c_adap,

		case 0x30: /* Data byte in I2CDAT has been transmitted; NOT ACK has been received */
			DEB2("NOT ACK received after data byte\n");
			pca_stop(adap);
			goto out;

		case 0x38: /* Arbitration lost during SLA+W, SLA+R or data bytes */
			DEB2("Arbitration lost\n");
			/*
			 * The PCA9564 data sheet (2006-09-01) says "A
			 * START condition will be transmitted when the
			 * bus becomes free (STOP or SCL and SDA high)"
			 * when the STA bit is set (p. 11).
			 *
			 * In case this won't work, try pca_reset()
			 * instead.
			 */
			pca_start(adap);
			goto out;

		case 0x58: /* Data byte has been received; NOT ACK has been returned */
+1 −1
Original line number Diff line number Diff line
@@ -284,7 +284,7 @@ static int ali1535_transaction(struct i2c_adapter *adap)
		 && (timeout++ < MAX_TIMEOUT));

	/* If the SMBus is still busy, we give up */
	if (timeout >= MAX_TIMEOUT) {
	if (timeout > MAX_TIMEOUT) {
		result = -ETIMEDOUT;
		dev_err(&adap->dev, "SMBus Timeout!\n");
	}
+1 −1
Original line number Diff line number Diff line
@@ -306,7 +306,7 @@ static int ali15x3_transaction(struct i2c_adapter *adap)
		 && (timeout++ < MAX_TIMEOUT));

	/* If the SMBus is still busy, we give up */
	if (timeout >= MAX_TIMEOUT) {
	if (timeout > MAX_TIMEOUT) {
		result = -ETIMEDOUT;
		dev_err(&adap->dev, "SMBus Timeout!\n");
	}
+2 −2
Original line number Diff line number Diff line
@@ -126,7 +126,7 @@ static int amd756_transaction(struct i2c_adapter *adap)
		} while ((temp & (GS_HST_STS | GS_SMB_STS)) &&
		         (timeout++ < MAX_TIMEOUT));
		/* If the SMBus is still busy, we give up */
		if (timeout >= MAX_TIMEOUT) {
		if (timeout > MAX_TIMEOUT) {
			dev_dbg(&adap->dev, "Busy wait timeout (%04x)\n", temp);
			goto abort;
		}
@@ -143,7 +143,7 @@ static int amd756_transaction(struct i2c_adapter *adap)
	} while ((temp & GS_HST_STS) && (timeout++ < MAX_TIMEOUT));

	/* If the SMBus is still busy, we give up */
	if (timeout >= MAX_TIMEOUT) {
	if (timeout > MAX_TIMEOUT) {
		dev_dbg(&adap->dev, "Completion timeout!\n");
		goto abort;
	}
Loading