Clean up a the driver's DDC code, make it simpler, more robust, and mostly self contained. The patches in this patchset have previously been sent as part of rev 1 of [1]. Patches 1 and 2 fix long-standing problems in the DDC code. Patches 3 to 9 refactor the DDC code. The code then keeps its data structures internal, acquires locks automatically and is much more readable overall. Patch 10 replaces driver code with an equivalent helper. Tested on various Matrox hardware. [1] https://patchwork.freedesktop.org/series/131977/ Thomas Zimmermann (10): drm/mgag200: Set DDC timeout in milliseconds drm/mgag200: Bind I2C lifetime to DRM device drm/mgag200: Store pointer to struct mga_device in struct mga_i2c_chan drm/mgag200: Allocate instance of struct mga_i2c_chan dynamically drm/mgag200: Inline mgag200_i2c_init() drm/mgag200: Replace struct mga_i2c_chan with struct mgag200_ddc drm/mgag200: Rename mgag200_i2c.c to mgag200_ddc.c drm/mgag200: Rename struct i2c_algo_bit_data callbacks drm/mgag200: Acquire I/O-register lock in DDC code drm/mgag200: Use drm_connector_helper_get_modes() drivers/gpu/drm/mgag200/Makefile | 2 +- drivers/gpu/drm/mgag200/mgag200_ddc.c | 179 ++++++++++++++++++++++ drivers/gpu/drm/mgag200/mgag200_ddc.h | 11 ++ drivers/gpu/drm/mgag200/mgag200_drv.h | 18 +-- drivers/gpu/drm/mgag200/mgag200_g200.c | 11 +- drivers/gpu/drm/mgag200/mgag200_g200eh.c | 11 +- drivers/gpu/drm/mgag200/mgag200_g200eh3.c | 11 +- drivers/gpu/drm/mgag200/mgag200_g200er.c | 11 +- drivers/gpu/drm/mgag200/mgag200_g200ev.c | 11 +- drivers/gpu/drm/mgag200/mgag200_g200ew3.c | 11 +- drivers/gpu/drm/mgag200/mgag200_g200se.c | 11 +- drivers/gpu/drm/mgag200/mgag200_g200wb.c | 11 +- drivers/gpu/drm/mgag200/mgag200_i2c.c | 129 ---------------- drivers/gpu/drm/mgag200/mgag200_mode.c | 27 +--- 14 files changed, 241 insertions(+), 213 deletions(-) create mode 100644 drivers/gpu/drm/mgag200/mgag200_ddc.c create mode 100644 drivers/gpu/drm/mgag200/mgag200_ddc.h delete mode 100644 drivers/gpu/drm/mgag200/mgag200_i2c.c -- 2.45.0