Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: rcar-csi2: update stream start for V3M

Latest errata document updates the start procedure for V3M. This change
in addition to adhering to the datasheet update fixes capture on early
revisions of V3M.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>

authored by

Niklas Söderlund and committed by
Mauro Carvalho Chehab
4070fc9a 5bfffa0c

+14 -6
+14 -6
drivers/media/platform/rcar-vin/rcar-csi2.c
··· 339 339 340 340 struct rcar_csi2_info { 341 341 int (*init_phtw)(struct rcar_csi2 *priv, unsigned int mbps); 342 + int (*confirm_start)(struct rcar_csi2 *priv); 342 343 const struct rcsi2_mbps_reg *hsfreqrange; 343 344 unsigned int csi0clkfreqrange; 344 345 bool clear_ulps; ··· 545 544 ret = rcsi2_wait_phy_start(priv); 546 545 if (ret) 547 546 return ret; 547 + 548 + /* Confirm start */ 549 + if (priv->info->confirm_start) { 550 + ret = priv->info->confirm_start(priv); 551 + if (ret) 552 + return ret; 553 + } 548 554 549 555 /* Clear Ultra Low Power interrupt. */ 550 556 if (priv->info->clear_ulps) ··· 889 881 890 882 static int rcsi2_init_phtw_v3m_e3(struct rcar_csi2 *priv, unsigned int mbps) 891 883 { 884 + return rcsi2_phtw_write_mbps(priv, mbps, phtw_mbps_v3m_e3, 0x44); 885 + } 886 + 887 + static int rcsi2_confirm_start_v3m_e3(struct rcar_csi2 *priv) 888 + { 892 889 static const struct phtw_value step1[] = { 893 890 { .data = 0xed, .code = 0x34 }, 894 891 { .data = 0xed, .code = 0x44 }, ··· 902 889 { .data = 0xed, .code = 0x94 }, 903 890 { /* sentinel */ }, 904 891 }; 905 - 906 - int ret; 907 - 908 - ret = rcsi2_phtw_write_mbps(priv, mbps, phtw_mbps_v3m_e3, 0x44); 909 - if (ret) 910 - return ret; 911 892 912 893 return rcsi2_phtw_write_array(priv, step1); 913 894 } ··· 956 949 957 950 static const struct rcar_csi2_info rcar_csi2_info_r8a77970 = { 958 951 .init_phtw = rcsi2_init_phtw_v3m_e3, 952 + .confirm_start = rcsi2_confirm_start_v3m_e3, 959 953 }; 960 954 961 955 static const struct of_device_id rcar_csi2_of_table[] = {