From: Michael Tretter <[email protected]>

The ADV7533 supports a test mode that simply prints vertical bars on the
output whenever the MIPI-DSI clock is running. This allows to test the
clock without making sure that the data lanes produce valid data.

Signed-off-by: Michael Tretter <[email protected]>
Signed-off-by: Lucas Stach <[email protected]>
---
 drivers/gpu/drm/bridge/adv7511/adv7533.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/bridge/adv7511/adv7533.c 
b/drivers/gpu/drm/bridge/adv7511/adv7533.c
index 122ad91e8a32..707796b91bad 100644
--- a/drivers/gpu/drm/bridge/adv7511/adv7533.c
+++ b/drivers/gpu/drm/bridge/adv7511/adv7533.c
@@ -7,6 +7,10 @@
 
 #include "adv7511.h"
 
+static bool test_mode;
+module_param(test_mode, bool, 0644);
+MODULE_PARM_DESC(test_mode, "Enable test mode");
+
 static const struct reg_sequence adv7533_fixed_registers[] = {
        { 0x16, 0x20 },
        { 0x9a, 0xe0 },
@@ -85,8 +89,10 @@ void adv7533_dsi_power_on(struct adv7511 *adv)
 
        /* enable hdmi */
        regmap_write(adv->regmap_cec, 0x03, 0x89);
-       /* disable test mode */
-       regmap_write(adv->regmap_cec, 0x55, 0x00);
+       if (test_mode)
+               regmap_write(adv->regmap_cec, 0x55, 0x80);
+       else
+               regmap_write(adv->regmap_cec, 0x55, 0x00);
 
        regmap_register_patch(adv->regmap_cec, adv7533_cec_fixed_registers,
                              ARRAY_SIZE(adv7533_cec_fixed_registers));
-- 
2.39.5

Reply via email to