OSDN Git Service

media: imx: imx7-media-csi: Clear all configurable CSICR18 fields
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Mon, 15 Feb 2021 04:27:12 +0000 (05:27 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 11 Mar 2021 10:59:51 +0000 (11:59 +0100)
commitd525febdb7a1778de349ce78761667ad7053b5e5
tree8f41fb7f3a78a70e362fab311ffff2e8354c0924
parent49a72bb614dc49754d57ca114c2a08e4fecdb148
media: imx: imx7-media-csi: Clear all configurable CSICR18 fields

When configuring the CSI in imx7_csi_configure(), the CSICR18 is set
through a read-modify-write cycle to avoid affecting fields whose usage
isn't clear. The function then sets fields depending on whether the
input is interlaced or progressive, and from the parallel input or the
CSI-2 receiver.

Those bits are only set and never cleared. For instance, when switching
from a CSI-2 source to the parallel input, the BIT_DATA_FROM_MIPI will
stay set. Fix this issue by first clearing all the fields we need to
configure.

Add BIT_CSI_HW_ENABLE to the set of fields being cleared, as the CSI
needs to start in the disabled state. This allows dropping the call to
imx7_csi_hw_disable() in imx7_csi_sw_reset().

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/staging/media/imx/imx7-media-csi.c