From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 294EF1F8666; Tue, 28 Jan 2025 17:54:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738086862; cv=none; b=pwRytblJwoP9XspjNwrbqfGFxJdJaJwrdixI3yypX8p6+GTAXpuicZIGOa5fsF7ZhSeJUN/gWREJ5W8AjK8Tr3zoTnAyvVciSo823f8b6C/v9IGBfx1jUVqtzZ/IBhiKYhdL2s1rgWgWEVGFLb2sencnEUlASC7lLzexL7+zcKY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738086862; c=relaxed/simple; bh=3PihCPL1PbGiywV8gTwWjfgktAJ1JYwtLg/idGjpC6c=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=GdhQu+RJ2cQrGjeDcikuWTYksNS7jgcTQER4sg57a4SbgTIi+XbEYKgs9r/B7zJ6nPnueIPzixpwSMEWUuXx2Ny7u9BI58q1QJ7ScMj/E0AjVJEJDAyvipq5cIyOzZ4eLxhhyGjFz9gGRK/BSiavcdnBwbn0YXg9jAer+ZMHwpk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=h7NP31Kc; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="h7NP31Kc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6385AC4CEE1; Tue, 28 Jan 2025 17:54:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1738086862; bh=3PihCPL1PbGiywV8gTwWjfgktAJ1JYwtLg/idGjpC6c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h7NP31KcitYNaQzOQZzEDzACInNAPQLq7UT4wUuOCt9VukSYPwRbagqIGVHE+4RpR XzPNMGH3EBMG0ee6hJzI0dnCldoTn1bWXm1v8NoDP5i88MQ+RQxsRLsHLiqPe7sba2 6IKPAeJ99P5IylTqfZMSvF4gTZzZuvA2RARamGwGKSJydFM0tnjo9lhC+fkgjIC/kQ Rboxm25Ynjr6oPNxF44eUc8AEBp4yUqf/2W4beHy6zCH1ShB+2iFu3FsXxAErJmwP8 /DxTTll1YOJO4gKeFU5DusZkd/CPkniF+bukAFNKMOvGWo8eP62D2Jz7ksBmcvJbvg vjeun150yctfA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Naushir Patuck , Jacopo Mondi , Sakari Ailus , Mauro Carvalho Chehab , Sasha Levin , 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.12 04/12] media: bcm2835-unicam: Disable trigger mode operation Date: Tue, 28 Jan 2025 12:54:06 -0500 Message-Id: <20250128175414.1197295-4-sashal@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250128175414.1197295-1-sashal@kernel.org> References: <20250128175414.1197295-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.12.11 Content-Transfer-Encoding: 8bit From: Naushir Patuck [ 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 Reviewed-by: Jacopo Mondi Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- 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 a1d93c14553d8..9f81e1582a300 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