public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Naushir Patuck <naush@raspberrypi.com>,
	Jacopo Mondi <jacopo.mondi@ideasonboard.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	Sasha Levin <sashal@kernel.org>,
	kernel-list@raspberrypi.com, mchehab@kernel.org,
	florian.fainelli@broadcom.com, rjui@broadcom.com,
	sbranden@broadcom.com, linux-media@vger.kernel.org,
	linux-rpi-kernel@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH AUTOSEL 6.13 05/15] media: bcm2835-unicam: Disable trigger mode operation
Date: Tue, 28 Jan 2025 12:53:36 -0500	[thread overview]
Message-ID: <20250128175346.1197097-5-sashal@kernel.org> (raw)
In-Reply-To: <20250128175346.1197097-1-sashal@kernel.org>

From: Naushir Patuck <naush@raspberrypi.com>

[ Upstream commit 697a252bb2ea414cc1c0b4cf4e3d94a879eaf162 ]

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>
---
 drivers/media/platform/broadcom/bcm2835-unicam.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/media/platform/broadcom/bcm2835-unicam.c b/drivers/media/platform/broadcom/bcm2835-unicam.c
index 3aed0e493c81f..4090a8e477402 100644
--- a/drivers/media/platform/broadcom/bcm2835-unicam.c
+++ b/drivers/media/platform/broadcom/bcm2835-unicam.c
@@ -816,11 +816,6 @@ static irqreturn_t unicam_isr(int irq, void *dev)
 		}
 	}
 
-	if (unicam_reg_read(unicam, UNICAM_ICTL) & UNICAM_FCM) {
-		/* Switch out of trigger mode if selected */
-		unicam_reg_write_field(unicam, UNICAM_ICTL, 1, UNICAM_TFC);
-		unicam_reg_write_field(unicam, UNICAM_ICTL, 0, UNICAM_FCM);
-	}
 	return IRQ_HANDLED;
 }
 
@@ -984,8 +979,7 @@ static void unicam_start_rx(struct unicam_device *unicam,
 
 	unicam_reg_write_field(unicam, UNICAM_ANA, 0, UNICAM_DDL);
 
-	/* Always start in trigger frame capture mode (UNICAM_FCM set) */
-	val = UNICAM_FSIE | UNICAM_FEIE | UNICAM_FCM | UNICAM_IBOB;
+	val = UNICAM_FSIE | UNICAM_FEIE | UNICAM_IBOB;
 	line_int_freq = max(fmt->height >> 2, 128);
 	unicam_set_field(&val, line_int_freq, UNICAM_LCIE_MASK);
 	unicam_reg_write(unicam, UNICAM_ICTL, val);
-- 
2.39.5


  parent reply	other threads:[~2025-01-28 17:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-28 17:53 [PATCH AUTOSEL 6.13 01/15] media: cxd2841er: fix 64-bit division on gcc-9 Sasha Levin
2025-01-28 17:53 ` [PATCH AUTOSEL 6.13 02/15] PCI: endpoint: Add size check for fixed size BARs in pci_epc_set_bar() Sasha Levin
2025-01-28 17:53 ` [PATCH AUTOSEL 6.13 03/15] media: i2c: ds90ub913: Add error handling to ub913_hw_init() Sasha Levin
2025-01-28 17:53 ` [PATCH AUTOSEL 6.13 04/15] media: i2c: ds90ub953: Add error handling for i2c reads/writes Sasha Levin
2025-01-28 17:53 ` Sasha Levin [this message]
2025-01-28 17:53 ` [PATCH AUTOSEL 6.13 06/15] media: uvcvideo: Implement dual stream quirk to fix loss of usb packets Sasha Levin
2025-01-28 17:53 ` [PATCH AUTOSEL 6.13 07/15] media: uvcvideo: Add new quirk definition for the Sonix Technology Co. 292a camera Sasha Levin
2025-01-28 17:53 ` [PATCH AUTOSEL 6.13 08/15] media: uvcvideo: Add Kurokesu C1 PRO camera Sasha Levin
2025-01-28 17:53 ` [PATCH AUTOSEL 6.13 09/15] media: vidtv: Fix a null-ptr-deref in vidtv_mux_stop_thread Sasha Levin
2025-01-28 17:53 ` [PATCH AUTOSEL 6.13 10/15] Drivers: hv: vmbus: Wait for boot-time offers during boot and resume Sasha Levin
2025-01-28 17:53 ` [PATCH AUTOSEL 6.13 11/15] hyperv: Do not overlap the hvcall IO areas in hv_vtl_apicid_to_vp_id() Sasha Levin
2025-01-28 21:15   ` Roman Kisel
2025-01-28 17:53 ` [PATCH AUTOSEL 6.13 12/15] PCI: mediatek-gen3: Avoid PCIe resetting via PERST# for Airoha EN7581 SoC Sasha Levin
2025-01-28 17:53 ` [PATCH AUTOSEL 6.13 13/15] PCI: Store number of supported End-End TLP Prefixes Sasha Levin
2025-01-28 18:00   ` Ilpo Järvinen
2025-01-28 18:11     ` Sasha Levin
2025-01-28 17:53 ` [PATCH AUTOSEL 6.13 14/15] PCI/DPC: Quirk PIO log size for Intel Raptor Lake-P Sasha Levin
2025-01-28 17:53 ` [PATCH AUTOSEL 6.13 15/15] PCI: switchtec: Add Microchip PCI100X device IDs Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250128175346.1197097-5-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=florian.fainelli@broadcom.com \
    --cc=jacopo.mondi@ideasonboard.com \
    --cc=kernel-list@raspberrypi.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=mchehab+huawei@kernel.org \
    --cc=mchehab@kernel.org \
    --cc=naush@raspberrypi.com \
    --cc=rjui@broadcom.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=sbranden@broadcom.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox