]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: rcar-csi2: Update D-PHY startup on V4M
authorNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Tue, 10 Dec 2024 15:54:00 +0000 (16:54 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 19 Dec 2024 11:50:14 +0000 (12:50 +0100)
The latest datasheet (Rev.0.70) updates the D-PHY start-up sequence for
D-PHY operation. Unfortunately the datasheet do not add any additional
documentation on the magic values.

This have been tested together with the MAX96724 available on the single
board test platform and it works as expected.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/renesas/rcar-csi2.c

index 8a0b6a68e194060c922cdb8e91b26974b87dc419..0a53dd47d7bf24e07b416c0b0dfd9cfa70462529 100644 (file)
@@ -1406,15 +1406,15 @@ static int rcsi2_init_common_v4m(struct rcar_csi2 *priv, unsigned int mbps)
        static const struct phtw_value step2[] = {
                { .data = 0x00, .code = 0x00 },
                { .data = 0x80, .code = 0xe0 },
-               { .data = 0x01, .code = 0xe1 },
+               { .data = 0x31, .code = 0xe1 },
                { .data = 0x06, .code = 0x00 },
-               { .data = 0x0f, .code = 0x11 },
+               { .data = 0x11, .code = 0x11 },
                { .data = 0x08, .code = 0x00 },
-               { .data = 0x0f, .code = 0x11 },
+               { .data = 0x11, .code = 0x11 },
                { .data = 0x0a, .code = 0x00 },
-               { .data = 0x0f, .code = 0x11 },
+               { .data = 0x11, .code = 0x11 },
                { .data = 0x0c, .code = 0x00 },
-               { .data = 0x0f, .code = 0x11 },
+               { .data = 0x11, .code = 0x11 },
                { .data = 0x01, .code = 0x00 },
                { .data = 0x31, .code = 0xaa },
                { .data = 0x05, .code = 0x00 },
@@ -1427,6 +1427,11 @@ static int rcsi2_init_common_v4m(struct rcar_csi2 *priv, unsigned int mbps)
                { .data = 0x05, .code = 0x09 },
        };
 
+       static const struct phtw_value step3[] = {
+               { .data = 0x01, .code = 0x00 },
+               { .data = 0x06, .code = 0xab },
+       };
+
        if (priv->info->hsfreqrange) {
                ret = rcsi2_set_phypll(priv, mbps);
                if (ret)
@@ -1457,7 +1462,7 @@ static int rcsi2_init_common_v4m(struct rcar_csi2 *priv, unsigned int mbps)
                        return ret;
        }
 
-       return ret;
+       return rcsi2_phtw_write_array(priv, step3, ARRAY_SIZE(step3));
 }
 
 static int rcsi2_start_receiver_v4m(struct rcar_csi2 *priv,