]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: sun4i-csi: Fix [HV]sync polarity handling
authorChen-Yu Tsai <wens@csie.org>
Sun, 15 Dec 2019 16:59:14 +0000 (17:59 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Feb 2020 07:36:25 +0000 (08:36 +0100)
commite1e1cdbc646f99255f6fde34fea7743c934b38b1
treea402345158af965518f29a1263a31a2d588dcd9c
parent65fbde986aef2df1033cf2450ad80002590897fd
media: sun4i-csi: Fix [HV]sync polarity handling

[ Upstream commit 1948dcf0f928b8bcdca57ca3fba8545ba380fc29 ]

The Allwinner camera sensor interface has a different definition of
[HV]sync. While the timing diagram uses the names HSYNC and VSYNC,
the note following the diagram and register names use HREF and VREF.
Combined they imply the hardware uses either [HV]REF or inverted
[HV]SYNC. There are also registers to set horizontal skip lengths
in pixels and vertical skip lengths in lines, also known as back
porches.

Fix the polarity handling by using the opposite polarity flag for
the checks. Also rename `[hv]sync_pol` to `[hv]ref_pol` to better
match the hardware register description.

Fixes: 577bbf23b758 ("media: sunxi: Add A10 CSI driver")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.h
drivers/media/platform/sunxi/sun4i-csi/sun4i_dma.c