Lower the speed of I2C for DDC/CI
Maciej Wójcik
w8jcik at gmail.com
Fri Aug 30 14:35:06 UTC 2024
Hello,
DDC/CI is an interface that allows changing of display settings like
brightness, contrast, colors, selection of input.
DDC/CI implemented in i915 driver operates over I2C with a hard-coded speed
of 100KHz.
This speed works for most of the displays, but not all of them.
Would you consider lowering the default speed of I2C to support additional
displays?
Does the change below look acceptable, or do you expect some issues with it?
diff --git a/drivers/gpu/drm/i915/display/intel_gmbus.c
b/drivers/gpu/drm/i915/display/intel_gmbus.cindex e9e4dcf34..88aba021e
100644--- a/drivers/gpu/drm/i915/display/intel_gmbus.c+++
b/drivers/gpu/drm/i915/display/intel_gmbus.c@@ -200,7 +200,7 @@ bool
intel_gmbus_is_valid_pin(struct drm_i915_private *i915, unsigned int
pin)
/* Intel GPIO access functions */
-#define I2C_RISEFALL_TIME 10+#define I2C_RISEFALL_TIME 5
static inline struct intel_gmbus *
to_intel_gmbus(struct i2c_adapter *i2c)@@ -916,7 +916,7 @@ int
intel_gmbus_setup(struct drm_i915_private *i915)
bus->adapter.retries = 1;
/* By default use a conservative clock rate */- bus->reg0 = pin |
GMBUS_RATE_100KHZ;+ bus->reg0 = pin | GMBUS_RATE_50KHZ;
/* gmbus seems to be broken on i830 */
if (IS_I830(i915))
I have tested this change by recompiling my system kernel. The change fixes
DDC/CI for one of my displays, while not breaking any other displays that I
had.
What would be even more flexible is some way to change the speed run-time
or boot-time. I can try to implement it if you suggest what mechanism to
use for that. Otherwise, would you accept a simple change of lowering the
speed?
Related issue https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11528
--
Maciej Wójcik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/intel-gfx/attachments/20240830/c39b7e2a/attachment.htm>
More information about the Intel-gfx
mailing list