drm: bridge: it66121: Use regmap_noinc_read()
authorPaul Cercueil <paul@crapouillou.net>
Wed, 14 Dec 2022 12:58:14 +0000 (13:58 +0100)
committerPaul Cercueil <paul@crapouillou.net>
Fri, 16 Dec 2022 10:39:24 +0000 (11:39 +0100)
Use regmap_noinc_read() instead of reading the data from the DDC FIFO one
byte at a time.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20221214125821.12489-4-paul@crapouillou.net
drivers/gpu/drm/bridge/ite-it66121.c

index a698eec..1222284 100644 (file)
@@ -589,13 +589,12 @@ static int it66121_get_edid_block(void *context, u8 *buf,
                if (ret)
                        return ret;
 
-               do {
-                       ret = regmap_read(ctx->regmap, IT66121_DDC_RD_FIFO_REG, &val);
-                       if (ret)
-                               return ret;
-                       *(buf++) = val;
-                       cnt--;
-               } while (cnt > 0);
+               ret = regmap_noinc_read(ctx->regmap, IT66121_DDC_RD_FIFO_REG,
+                                       buf, cnt);
+               if (ret)
+                       return ret;
+
+               buf += cnt;
        }
 
        return 0;