media: tegra-video: Add CSI MIPI pads calibration
authorSowjanya Komatineni <skomatineni@nvidia.com>
Wed, 12 Aug 2020 00:27:20 +0000 (02:27 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Fri, 28 Aug 2020 13:13:31 +0000 (15:13 +0200)
commit523c857e34ce025b993e4f85864644f579a08aac
treef0ffca0aadf3aa770ddf990fc06be0ae0dc741ee
parentcf5153e4338c4cca655a4a4eff6d54c6a0adcdb7
media: tegra-video: Add CSI MIPI pads calibration

CSI MIPI pads need to be enabled and calibrated for capturing from
the external sensor or transmitter.

MIPI CAL unit calibrates MIPI pads pull-up, pull-down and termination
impedances. Calibration is done by co-work of MIPI BIAS pad and MIPI
CAL control unit.

Triggering calibration start can happen any time after MIPI pads are
enabled but calibration results will be latched and applied to MIPI
pads by MIPI CAL unit only when the link is in LP11 state and then
calibration status register gets updated.

This patch enables CSI MIPI pads and calibrates them during streaming.

Tegra CSI receiver is able to catch the very first clock transition.
So, CSI receiver is always enabled prior to sensor streaming and
trigger of calibration start is done during CSI subdev streaming and
status of calibration is verified after sensor stream on.

Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/staging/media/tegra-video/TODO
drivers/staging/media/tegra-video/csi.c
drivers/staging/media/tegra-video/csi.h
drivers/staging/media/tegra-video/vi.c