On the Epson Moverio BT-200, reading back registers does not work with the
default value, so make it configurable. Real meaning of this value is not
known from public sources.

Signed-off-by: Andreas Kemnade <[email protected]>
---
 drivers/gpu/drm/bridge/tc358762.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/bridge/tc358762.c 
b/drivers/gpu/drm/bridge/tc358762.c
index 1bea89fb03a8..194785bff997 100644
--- a/drivers/gpu/drm/bridge/tc358762.c
+++ b/drivers/gpu/drm/bridge/tc358762.c
@@ -15,6 +15,7 @@
 #include <linux/gpio/consumer.h>
 #include <linux/module.h>
 #include <linux/of_graph.h>
+#include <linux/property.h>
 #include <linux/regulator/consumer.h>
 #include <linux/spi/spi.h>
 
@@ -101,8 +102,6 @@
 
 #define IDREG                  0x04A0 /* Chip and Revision ID */
 
-#define LPX_PERIOD             3
-
 struct tc358762 {
        struct device *dev;
        struct drm_bridge bridge;
@@ -112,6 +111,7 @@ struct tc358762 {
        struct spi_controller *spi;
        bool pre_enabled;
        int error;
+       u32 lpx_period;
        bool use_vtg;
 };
 
@@ -246,7 +246,7 @@ static void tc358762_pre_enable(struct drm_bridge *bridge,
        tc358762_write(ctx, PPI_D1S_CLRSIPOCOUNT, 5);
        tc358762_write(ctx, PPI_D0S_ATMR, 0);
        tc358762_write(ctx, PPI_D1S_ATMR, 0);
-       tc358762_write(ctx, PPI_LPTXTIMECNT, LPX_PERIOD);
+       tc358762_write(ctx, PPI_LPTXTIMECNT, ctx->lpx_period);
 
        if (ctx->use_vtg) {
                struct videomode vm = { 0 };
@@ -367,6 +367,9 @@ static int tc358762_parse_dt(struct tc358762 *ctx)
        if (IS_ERR(ctx->reset_gpio))
                return PTR_ERR(ctx->reset_gpio);
 
+       ctx->lpx_period = 3;
+       device_property_read_u32(dev, "toshiba,lptxtimecnt", &ctx->lpx_period);
+
        return 0;
 }
 

-- 
2.47.3

Reply via email to