mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard Leitner <richard.leitner@linux.dev>
To: Sakari Ailus <sakari.ailus@linux.intel.com>,
	 Dave Stevenson <dave.stevenson@raspberrypi.com>,
	 Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Richard Leitner <richard.leitner@linux.dev>
Subject: [PATCH 2/3] media: i2c: ov9282: add AEC Manual register definition
Date: Tue, 25 Feb 2025 14:08:41 +0100	[thread overview]
Message-ID: <20250225-b4-ov9282-gain-v1-2-a24af2820dde@linux.dev> (raw)
In-Reply-To: <20250225-b4-ov9282-gain-v1-0-a24af2820dde@linux.dev>

Add #define's for the "AEC MANUAL" (0x3503) register and its
values/flags. Use those in the registers single usage within the
`common_regs` struct.

All values are based on the OV9281 datasheet v1.01 (09.18.2015).

Signed-off-by: Richard Leitner <richard.leitner@linux.dev>
---
 drivers/media/i2c/ov9282.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/ov9282.c b/drivers/media/i2c/ov9282.c
index c926842257893c4da3319b847fab9908b5bdaec6..c882a021cf18852237bf9b9524d3de0c5b48cbcb 100644
--- a/drivers/media/i2c/ov9282.c
+++ b/drivers/media/i2c/ov9282.c
@@ -44,6 +44,15 @@
 #define OV9282_EXPOSURE_STEP	1
 #define OV9282_EXPOSURE_DEFAULT	0x0282
 
+/* AEC/AGC manual */
+#define OV9282_REG_AEC_MANUAL		0x3503
+#define OV9282_DIGFRAC_GAIN_DELAY	BIT(6)
+#define OV9282_GAIN_CHANGE_DELAY	BIT(5)
+#define OV9282_GAIN_DELAY		BIT(4)
+#define OV9282_GAIN_PREC16_EN		BIT(3)
+#define OV9282_GAIN_MANUAL_AS_SENSGAIN	BIT(2)
+#define OV9282_AEC_MANUAL_DEFAULT	0x00
+
 /* Analog gain control */
 #define OV9282_REG_AGAIN	0x3509
 #define OV9282_AGAIN_MIN	0x10
@@ -214,7 +223,7 @@ static const struct ov9282_reg common_regs[] = {
 	{0x3030, 0x10},
 	{0x3039, 0x32},
 	{0x303a, 0x00},
-	{0x3503, 0x08},
+	{OV9282_REG_AEC_MANUAL, OV9282_GAIN_PREC16_EN},
 	{0x3505, 0x8c},
 	{0x3507, 0x03},
 	{0x3508, 0x00},

-- 
2.47.2



  parent reply	other threads:[~2025-02-25 13:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-25 13:08 [PATCH 0/3] Fix analogue gain maximum for ov9282 Richard Leitner
2025-02-25 13:08 ` [PATCH 1/3] media: i2c: ov9282: use register definitions Richard Leitner
2025-02-25 14:19   ` Dave Stevenson
2025-02-25 13:08 ` Richard Leitner [this message]
2025-02-25 14:20   ` [PATCH 2/3] media: i2c: ov9282: add AEC Manual register definition Dave Stevenson
2025-02-25 13:08 ` [PATCH 3/3] media: i2c: ov9282: fix analogue gain maximum Richard Leitner
2025-02-25 15:30   ` Dave Stevenson
2025-02-25 15:46     ` Laurent Pinchart
2025-02-26 11:10       ` Richard Leitner
2025-02-26 11:07     ` Richard Leitner
2025-02-26 12:52       ` Dave Stevenson
2025-02-26 13:01         ` Sakari Ailus
2025-02-26 13:22           ` Richard Leitner

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=20250225-b4-ov9282-gain-v1-2-a24af2820dde@linux.dev \
    --to=richard.leitner@linux.dev \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    /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

all inboxes | Powered by JetHome®