Skip to content

Commit cfe08da

Browse files
committed
drivers: bcm2835_unicam: Disable trigger mode operation
On a Pi3 B/B+ platform the imx219 sensor frequently generates a single corrupt frame when the sensor first starts. This can either be a missing line, or invalid samples within the line. This only occurrs using the Unicam kernel driver. Disabling trigger mode elimiates this corruption. Since trigger mode is a legacy feature copied from the firmeare 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 <[email protected]>
1 parent 0b54dbd commit cfe08da

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

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

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -983,11 +983,6 @@ static irqreturn_t unicam_isr(int irq, void *dev)
983983
}
984984
}
985985

986-
if (reg_read(unicam, UNICAM_ICTL) & UNICAM_FCM) {
987-
/* Switch out of trigger mode if selected */
988-
reg_write_field(unicam, UNICAM_ICTL, 1, UNICAM_TFC);
989-
reg_write_field(unicam, UNICAM_ICTL, 0, UNICAM_FCM);
990-
}
991986
return IRQ_HANDLED;
992987
}
993988

@@ -2297,8 +2292,7 @@ static void unicam_start_rx(struct unicam_device *dev, dma_addr_t *addr)
22972292

22982293
reg_write_field(dev, UNICAM_ANA, 0, UNICAM_DDL);
22992294

2300-
/* Always start in trigger frame capture mode (UNICAM_FCM set) */
2301-
val = UNICAM_FSIE | UNICAM_FEIE | UNICAM_FCM | UNICAM_IBOB;
2295+
val = UNICAM_FSIE | UNICAM_FEIE | UNICAM_IBOB;
23022296
set_field(&val, line_int_freq, UNICAM_LCIE_MASK);
23032297
reg_write(dev, UNICAM_ICTL, val);
23042298
reg_write(dev, UNICAM_STA, UNICAM_STA_MASK_ALL);
@@ -2411,12 +2405,6 @@ static void unicam_start_rx(struct unicam_device *dev, dma_addr_t *addr)
24112405
/* Load embedded data buffer pointers if needed */
24122406
if (dev->node[METADATA_PAD].streaming && dev->sensor_embedded_data)
24132407
reg_write_field(dev, UNICAM_DCS, 1, UNICAM_LDP);
2414-
2415-
/*
2416-
* Enable trigger only for the first frame to
2417-
* sync correctly to the FS from the source.
2418-
*/
2419-
reg_write_field(dev, UNICAM_ICTL, 1, UNICAM_TFC);
24202408
}
24212409

24222410
static void unicam_disable(struct unicam_device *dev)

0 commit comments

Comments
 (0)