Reuse lt9211_configure_timing() in lt9211c_configure_timing().

Signed-off-by: Philipp Zabel <[email protected]>
---
 drivers/gpu/drm/bridge/lontium-lt9211.c | 26 +++++++------------------
 1 file changed, 7 insertions(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/bridge/lontium-lt9211.c 
b/drivers/gpu/drm/bridge/lontium-lt9211.c
index 9888119f5287..5e5601551658 100644
--- a/drivers/gpu/drm/bridge/lontium-lt9211.c
+++ b/drivers/gpu/drm/bridge/lontium-lt9211.c
@@ -689,26 +689,14 @@ static int lt9211c_autodetect_rx(struct lt9211 *ctx,
 static int lt9211c_configure_timing(struct lt9211 *ctx,
                                    const struct drm_display_mode *mode)
 {
-       const struct reg_sequence lt9211c_timing[] = {
-               { 0xd00d, (mode->vtotal >> 8) & 0xff },
-               { 0xd00e, mode->vtotal & 0xff },
-               { 0xd00f, (mode->vdisplay >> 8) & 0xff },
-               { 0xd010, mode->vdisplay & 0xff },
-               { 0xd011, (mode->htotal >> 8) & 0xff },
-               { 0xd012, mode->htotal & 0xff },
-               { 0xd013, (mode->hdisplay >> 8) & 0xff },
-               { 0xd014, mode->hdisplay & 0xff },
-               { 0xd015, (mode->vsync_end - mode->vsync_start) & 0xff },
-               { 0xd04c, ((mode->hsync_end - mode->hsync_start) >> 8) & 0xff },
-               { 0xd016, (mode->hsync_end - mode->hsync_start) & 0xff },
-               { 0xd017, ((mode->vsync_start - mode->vdisplay) >> 8) & 0xff },
-               { 0xd018, (mode->vsync_start - mode->vdisplay) & 0xff },
-               { 0xd019, ((mode->hsync_start - mode->hdisplay) >> 8) & 0xff },
-               { 0xd01a, (mode->hsync_start - mode->hdisplay) & 0xff },
-       };
+       int ret;
 
-       return regmap_multi_reg_write(ctx->regmap, lt9211c_timing,
-                                     ARRAY_SIZE(lt9211c_timing));
+       ret = lt9211_configure_timing(ctx, mode);
+       if (ret < 0)
+               return ret;
+
+       return regmap_write(ctx->regmap, 0xd04c,
+                           ((mode->hsync_end - mode->hsync_start) >> 8) & 
0xff);
 }
 
 static int lt9211c_configure_plls(struct lt9211 *ctx,
-- 
2.47.3

Reply via email to