mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Primoz Fiser <primoz.fiser@norik.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	upstream@lists.phytec.de
Subject: [PATCH 3/3] media: mt9v032: Add get_mbus_config subdev_pad_ops callback
Date: Fri,  9 Oct 2026 12:28:17 +0200	[thread overview]
Message-ID: <20261009102817.2421388-4-primoz.fiser@norik.com> (raw)
In-Reply-To: <20261009102817.2421388-1-primoz.fiser@norik.com>

From: Stefan Riedmüller <s.riedmueller@phytec.de>

Some drivers like the i.MX6 IPU driver require the get_mbus_config
callback to be implemented, thus implement it.

Signed-off-by: Stefan Riedmüller <s.riedmueller@phytec.de>
Signed-off-by: Primoz Fiser <primoz.fiser@norik.com>
---
 drivers/media/i2c/mt9v032.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/media/i2c/mt9v032.c b/drivers/media/i2c/mt9v032.c
index d8e34e128d77..7cf0421355b5 100644
--- a/drivers/media/i2c/mt9v032.c
+++ b/drivers/media/i2c/mt9v032.c
@@ -1003,6 +1003,25 @@ static int mt9v032_close(struct v4l2_subdev *subdev, struct v4l2_subdev_fh *fh)
 	return mt9v032_set_power(subdev, 0);
 }
 
+static int mt9v032_get_mbus_config(struct v4l2_subdev *sd, unsigned int pad,
+				   struct v4l2_mbus_config *cfg)
+{
+	struct mt9v032 *mt9v032 = to_mt9v032(sd);
+
+	cfg->type = V4L2_MBUS_PARALLEL;
+
+	cfg->bus.parallel.flags = V4L2_MBUS_MASTER |
+				  V4L2_MBUS_HSYNC_ACTIVE_HIGH |
+				  V4L2_MBUS_VSYNC_ACTIVE_HIGH |
+				  V4L2_MBUS_DATA_ACTIVE_HIGH;
+
+	cfg->bus.parallel.flags |= mt9v032->pdata.clk_pol ?
+				   V4L2_MBUS_PCLK_SAMPLE_RISING :
+				   V4L2_MBUS_PCLK_SAMPLE_FALLING;
+
+	return 0;
+}
+
 static const struct v4l2_subdev_core_ops mt9v032_subdev_core_ops = {
 	.s_power	= mt9v032_set_power,
 };
@@ -1018,6 +1037,7 @@ static const struct v4l2_subdev_pad_ops mt9v032_subdev_pad_ops = {
 	.set_fmt = mt9v032_set_format,
 	.get_selection = mt9v032_get_selection,
 	.set_selection = mt9v032_set_selection,
+	.get_mbus_config = mt9v032_get_mbus_config,
 };
 
 static const struct v4l2_subdev_ops mt9v032_subdev_ops = {
-- 
2.34.1


      parent reply	other threads:[~2026-10-09 10:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-09 10:28 [PATCH 0/3] media: mt9v032: Improvements from PHYTEC Primoz Fiser
2026-10-09 10:28 ` [PATCH 1/3] media: mt9v032: Support color format selection Primoz Fiser
2026-10-09 10:28 ` [PATCH 2/3] media: mt9v032: Add control for row noise correction Primoz Fiser
2026-10-09 10:28 ` Primoz Fiser [this message]

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=20261009102817.2421388-4-primoz.fiser@norik.com \
    --to=primoz.fiser@norik.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=upstream@lists.phytec.de \
    /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®