Skip to content

Commit e5ca6d2

Browse files
naushirmehmetb0
authored andcommitted
media: bcm2835-unicam: Disable trigger mode operation
BugLink: https://bugs.launchpad.net/bugs/2104873 [ Upstream commit 697a252 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Noah Wager <noah.wager@canonical.com> Signed-off-by: Mehmet Basaran <mehmet.basaran@canonical.com>
1 parent 464f277 commit e5ca6d2

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

drivers/media/platform/broadcom/bcm2835-unicam.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -816,11 +816,6 @@ static irqreturn_t unicam_isr(int irq, void *dev)
816816
}
817817
}
818818

819-
if (unicam_reg_read(unicam, UNICAM_ICTL) & UNICAM_FCM) {
820-
/* Switch out of trigger mode if selected */
821-
unicam_reg_write_field(unicam, UNICAM_ICTL, 1, UNICAM_TFC);
822-
unicam_reg_write_field(unicam, UNICAM_ICTL, 0, UNICAM_FCM);
823-
}
824819
return IRQ_HANDLED;
825820
}
826821

@@ -984,8 +979,7 @@ static void unicam_start_rx(struct unicam_device *unicam,
984979

985980
unicam_reg_write_field(unicam, UNICAM_ANA, 0, UNICAM_DDL);
986981

987-
/* Always start in trigger frame capture mode (UNICAM_FCM set) */
988-
val = UNICAM_FSIE | UNICAM_FEIE | UNICAM_FCM | UNICAM_IBOB;
982+
val = UNICAM_FSIE | UNICAM_FEIE | UNICAM_IBOB;
989983
line_int_freq = max(fmt->height >> 2, 128);
990984
unicam_set_field(&val, line_int_freq, UNICAM_LCIE_MASK);
991985
unicam_reg_write(unicam, UNICAM_ICTL, val);

0 commit comments

Comments
 (0)