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

media: bcm2835-unicam: Disable trigger mode operation

The imx219/imx708 sensors frequently generate a single corrupt frame
(image or embedded data) when the sensor first starts. This can either
be a missing line, or invalid samples within the line. This only occurrs
using the upstream Unicam kernel driver.

Disabling trigger mode elimiates this corruption. Since trigger mode is
a legacy feature copied from the firmware driver and not expected to be
needed, remove it. Tested on the Raspberry Pi cameras and shows no ill
effects.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

authored by

Naushir Patuck and committed by
Mauro Carvalho Chehab
697a252b a4781bf8

+1 -7
+1 -7
drivers/media/platform/broadcom/bcm2835-unicam.c
··· 834 834 } 835 835 } 836 836 837 - if (unicam_reg_read(unicam, UNICAM_ICTL) & UNICAM_FCM) { 838 - /* Switch out of trigger mode if selected */ 839 - unicam_reg_write_field(unicam, UNICAM_ICTL, 1, UNICAM_TFC); 840 - unicam_reg_write_field(unicam, UNICAM_ICTL, 0, UNICAM_FCM); 841 - } 842 837 return IRQ_HANDLED; 843 838 } 844 839 ··· 997 1002 998 1003 unicam_reg_write_field(unicam, UNICAM_ANA, 0, UNICAM_DDL); 999 1004 1000 - /* Always start in trigger frame capture mode (UNICAM_FCM set) */ 1001 - val = UNICAM_FSIE | UNICAM_FEIE | UNICAM_FCM | UNICAM_IBOB; 1005 + val = UNICAM_FSIE | UNICAM_FEIE | UNICAM_IBOB; 1002 1006 line_int_freq = max(fmt->height >> 2, 128); 1003 1007 unicam_set_field(&val, line_int_freq, UNICAM_LCIE_MASK); 1004 1008 unicam_reg_write(unicam, UNICAM_ICTL, val);