media: ti-vpe: cal: fix stop state timeout
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Wed, 25 Mar 2020 12:15:10 +0000 (13:15 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 14 Apr 2020 10:52:07 +0000 (12:52 +0200)
commit6dfcbde592e0fc4d5ab9618764d9849f66e3090c
tree098094c73800110bdc1c5a9ecbcf14ba7ec677c3
parent355357457a5880ddeb776e0f61bbb74f49dc5f4c
media: ti-vpe: cal: fix stop state timeout

The stop-state timeout needs to be over 100us as per CSI spec. With the
CAL fclk of 266 MHZ on DRA76, with the current value the driver uses,
the timeout is 24us. Too small timeout will cause failure to enable the
streaming.

Also, the fclk can be different on other SoCs, as is the case with AM65x
where the fclk is 250 MHz.

This patch fixes the timeout by calculating it correctly based on the
fclk rate.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/ti-vpe/cal.c