Linux-Media Archive mirror
 help / color / mirror / Atom feed
From: Tommaso Merciai <tomm.merciai@gmail.com>
Cc: martin.hecht@avnet.eu, michael.roeder@avnet.eu,
	tomm.merciai@gmail.com,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 3/5] media: i2c: alvium: enable acquisition frame rate
Date: Tue, 16 Apr 2024 16:19:03 +0200	[thread overview]
Message-ID: <20240416141905.454253-4-tomm.merciai@gmail.com> (raw)
In-Reply-To: <20240416141905.454253-1-tomm.merciai@gmail.com>

Alvium camera by default is in free running mode. Datasheet say that
acquisition frame rate reg can only be used if frame start trigger
mode is set to off.
Enable r/w aquisition frame rate and turn off trigger mode.

Signed-off-by: Tommaso Merciai <tomm.merciai@gmail.com>
---
 drivers/media/i2c/alvium-csi2.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/media/i2c/alvium-csi2.c b/drivers/media/i2c/alvium-csi2.c
index 991b3bcc8b80..2ab4c7e563d2 100644
--- a/drivers/media/i2c/alvium-csi2.c
+++ b/drivers/media/i2c/alvium-csi2.c
@@ -1184,6 +1184,20 @@ static int alvium_set_frame_rate(struct alvium_dev *alvium, u64 fr)
 	struct device *dev = &alvium->i2c_client->dev;
 	int ret;
 
+	ret = alvium_write_hshake(alvium, REG_BCRM_ACQUISITION_FRAME_RATE_EN_RW,
+				  1);
+	if (ret) {
+		dev_err(dev, "Fail to set acquisition frame rate enable reg\n");
+		return ret;
+	}
+
+	ret = alvium_write_hshake(alvium, REG_BCRM_FRAME_START_TRIGGER_MODE_RW,
+				  0);
+	if (ret) {
+		dev_err(dev, "Fail to set frame start trigger mode reg\n");
+		return ret;
+	}
+
 	ret = alvium_write_hshake(alvium, REG_BCRM_ACQUISITION_FRAME_RATE_RW,
 				  fr);
 	if (ret) {
-- 
2.34.1


  parent reply	other threads:[~2024-04-16 14:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-16 14:19 [PATCH 0/5] Alvium improvements Tommaso Merciai
2024-04-16 14:19 ` [PATCH 1/5] media: i2c: alvium: fix alvium_get_fw_version() Tommaso Merciai
2024-04-24 18:10   ` Sakari Ailus
2024-04-16 14:19 ` [PATCH 2/5] media: i2c: alvium: rename acquisition frame rate enable reg Tommaso Merciai
2024-04-16 14:19 ` Tommaso Merciai [this message]
2024-04-16 14:19 ` [PATCH 4/5] media: i2c: alvium: implement enum_frame_size Tommaso Merciai
2024-04-16 14:19 ` [PATCH 5/5] media: i2c: alvium: Move V4L2_CID_GAIN to V4L2_CID_ANALOG_GAIN Tommaso Merciai
2024-04-24 18:11   ` Sakari Ailus
2024-04-26  7:09     ` Tommaso Merciai
2024-04-26  7:13       ` Sakari Ailus
2024-04-26  8:41         ` Tommaso Merciai
2024-04-26 10:49           ` Sakari Ailus

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=20240416141905.454253-4-tomm.merciai@gmail.com \
    --to=tomm.merciai@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=martin.hecht@avnet.eu \
    --cc=mchehab@kernel.org \
    --cc=michael.roeder@avnet.eu \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).