commit bd92b18d18604d2dd846473290a62aaaeebf732b Author: Andriy Gapon Date: Fri Apr 13 19:16:59 2012 +0300 intel_iic: correct the comment we should always restore slave address back to the original format in case there will be retries or other repeated executions of the command diff --git a/sys/dev/drm/intel_iic.c b/sys/dev/drm/intel_iic.c index b82b6cb..2dac132 100644 --- a/sys/dev/drm/intel_iic.c +++ b/sys/dev/drm/intel_iic.c @@ -393,7 +393,7 @@ intel_iic_quirk_xfer(device_t idev, struct iic_msg *msgs, int nmsgs) msgs[i].flags |= IIC_M_NOSTOP; } ret = iicbus_transfer(idev, msgs, nmsgs); - /* restore just in case */ + /* restore the addresses */ for (i = 0; i < nmsgs; i++) msgs[i].slave >>= 1; IICBB_SETSDA(bridge_dev, 1); commit 6c90d1dcc322fae58c21f8973db99fc14f8d0718 Author: Andriy Gapon Date: Fri Apr 13 19:11:21 2012 +0300 intel_iic_quirk_xfer: force use of repeated start within a transaction This behavior is default on Linux, but on FreeBSD we issue stop and start between individual messages of a transaction. The distinction is important for SDVO I2C control bus switch case. The hardware switches back from DDC bus when it sees a stop bit and so the stop bit should appear only at the very end of a transaction intended for the DDC bus. diff --git a/sys/dev/drm/intel_iic.c b/sys/dev/drm/intel_iic.c index 1e171a2..b82b6cb 100644 --- a/sys/dev/drm/intel_iic.c +++ b/sys/dev/drm/intel_iic.c @@ -386,8 +386,12 @@ intel_iic_quirk_xfer(device_t idev, struct iic_msg *msgs, int nmsgs) DELAY(I2C_RISEFALL_TIME); /* convert slave addresses to format expected by iicbb */ - for (i = 0; i < nmsgs; i++) + for (i = 0; i < nmsgs; i++) { msgs[i].slave <<= 1; + /* force use of repeated start instead of default stop+start */ + if (i != (nmsgs - 1)) + msgs[i].flags |= IIC_M_NOSTOP; + } ret = iicbus_transfer(idev, msgs, nmsgs); /* restore just in case */ for (i = 0; i < nmsgs; i++) commit 348fe0fb0cdf81ec3c1e99e9426f8feee8584e17 Author: Andriy Gapon Date: Fri Apr 13 19:56:58 2012 +0300 drm_edid: print a debug message only when there is an error diff --git a/sys/dev/drm/drm_edid.c b/sys/dev/drm/drm_edid.c index 0ee0647..3bc2fb8 100644 --- a/sys/dev/drm/drm_edid.c +++ b/sys/dev/drm/drm_edid.c @@ -272,8 +272,9 @@ drm_do_probe_ddc_edid(device_t adapter, unsigned char *buf, } }; ret = iicbus_transfer(adapter, msgs, 2); - DRM_DEBUG_KMS("iicbus_transfer countdown %d error %d\n", - retries, ret); + if (ret != 0) + DRM_DEBUG_KMS("iicbus_transfer countdown %d error %d\n", + retries, ret); } while (ret != 0 && --retries); return (ret == 0 ? 0 : -1);