Linux Media Controller development
 help / color / mirror / Atom feed
From: Jacopo Mondi <jacopo@jmondi.org>
To: "Krzysztof Hałasa" <khalasa@piap.pl>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"Sakari Ailus" <sakari.ailus@iki.fi>,
	"Laurent Pinchart" <laurent.pinchart@ideasonboard.com>
Cc: Jacopo Mondi <jacopo@jmondi.org>, linux-media@vger.kernel.org
Subject: [PATCH v2 06/10] media: ar0521: Add LINK_FREQ control
Date: Sat, 22 Oct 2022 11:20:11 +0200	[thread overview]
Message-ID: <20221022092015.208592-7-jacopo@jmondi.org> (raw)
In-Reply-To: <20221022092015.208592-1-jacopo@jmondi.org>

Add support for V4L2_CID_LINK_FREQ which currently reports a single
hard-coded frequency which depends on the fixed pixel clock.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
---
 drivers/media/i2c/ar0521.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/media/i2c/ar0521.c b/drivers/media/i2c/ar0521.c
index fcd852760750..2310346f11d5 100644
--- a/drivers/media/i2c/ar0521.c
+++ b/drivers/media/i2c/ar0521.c
@@ -89,6 +89,10 @@ static const char * const ar0521_supply_names[] = {
 	"vaa",		/* Analog (2.7V) supply */
 };
 
+static const s64 ar0521_link_frequencies[] = {
+	184000000,
+};
+
 struct ar0521_ctrls {
 	struct v4l2_ctrl_handler handler;
 	struct {
@@ -547,6 +551,13 @@ static int ar0521_s_ctrl(struct v4l2_ctrl *ctrl)
 		ret = ar0521_write_reg(sensor, AR0521_REG_TEST_PATTERN_MODE,
 				       ctrl->val);
 		break;
+	case V4L2_CID_LINK_FREQ:
+		/*
+		 * Link frequency index is used at PLL configuration time,
+		 * nothing to do here.
+		 */
+		ret = 0;
+		break;
 	default:
 		dev_err(&sensor->i2c_client->dev,
 			"Unsupported control %x\n", ctrl->id);
@@ -611,6 +622,10 @@ static int ar0521_init_controls(struct ar0521_dev *sensor)
 	ctrls->exposure = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_EXPOSURE, 0,
 					    65535, 1, 360);
 
+	v4l2_ctrl_new_int_menu(hdl, ops, V4L2_CID_LINK_FREQ,
+			       ARRAY_SIZE(ar0521_link_frequencies) - 1,
+			       0, ar0521_link_frequencies);
+
 	ctrls->test_pattern = v4l2_ctrl_new_std_menu_items(hdl, ops,
 					V4L2_CID_TEST_PATTERN,
 					ARRAY_SIZE(test_pattern_menu) - 1,
-- 
2.37.3


  parent reply	other threads:[~2022-10-22 10:38 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-22  9:20 [PATCH v2 00/10] media: ar0521: Add analog gain, rework clock tree Jacopo Mondi
2022-10-22  9:20 ` [PATCH v2 01/10] media: ar0521: Implement enum_frame_sizes Jacopo Mondi
2022-10-22  9:20 ` [PATCH v2 02/10] media: ar0521: Add V4L2_CID_ANALOG_GAIN Jacopo Mondi
2022-10-24 12:13   ` Dave Stevenson
2022-10-24 12:31     ` Jacopo Mondi
2022-10-25 14:02       ` Sakari Ailus
2022-10-22  9:20 ` [PATCH v2 03/10] media: ar0521: Set maximum resolution to 2592x1944 Jacopo Mondi
2022-10-22  9:20 ` [PATCH v2 04/10] media: ar0521: Rework PLL computation Jacopo Mondi
2022-10-22  9:20 ` [PATCH v2 05/10] media: ar0521: Refuse unsupported controls Jacopo Mondi
2022-10-24 13:00   ` Dave Stevenson
2022-10-24 13:10     ` Jacopo Mondi
2022-10-22  9:20 ` Jacopo Mondi [this message]
2022-10-24 15:44   ` [PATCH v2 06/10] media: ar0521: Add LINK_FREQ control Dave Stevenson
2022-10-22  9:20 ` [PATCH v2 07/10] media: ar0521: Adjust exposure and blankings limits Jacopo Mondi
2022-10-24 17:47   ` Dave Stevenson
2022-10-25 17:45     ` Dave Stevenson
2022-10-27  7:10       ` Jacopo Mondi
2022-10-22  9:20 ` [PATCH v2 08/10] media: ar0521: Setup controls at s_stream time Jacopo Mondi
2022-10-22  9:20 ` [PATCH v2 09/10] media: ar0521: Rework startup sequence Jacopo Mondi
2022-10-22  9:20 ` [PATCH v2 10/10] media: ar0521: Tab-align definitions Jacopo Mondi

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=20221022092015.208592-7-jacopo@jmondi.org \
    --to=jacopo@jmondi.org \
    --cc=khalasa@piap.pl \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@iki.fi \
    /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