lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 2 Nov 2021 17:30:08 +0200
From:   Eugen Hristev <eugen.hristev@...rochip.com>
To:     <akinobu.mita@...il.com>, <linux-media@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
CC:     <sakari.ailus@...ux.intel.com>,
        Eugen Hristev <eugen.hristev@...rochip.com>
Subject: [PATCH] media: i2c: ov7740: implement get_mbus_config

Implement the get_mbus_config callback.
ov7740 is a parallel sensor, and according to datasheet, the register
REG12 controls the CCIR656 mode. This register is written to 0 in yuyv mode.
According to REG12[5] , CCIR656 mode, the behavior is:
CCIR656: disabled
REG28 controls the polarity of the signals. This register is unused.
The default behavior is then:
HSYNC polarity : positive
VSYNC polarity : positive
HREF polarity: positive

Signed-off-by: Eugen Hristev <eugen.hristev@...rochip.com>
---
 drivers/media/i2c/ov7740.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/media/i2c/ov7740.c b/drivers/media/i2c/ov7740.c
index 2539cfee85c8..f8a717aecb6f 100644
--- a/drivers/media/i2c/ov7740.c
+++ b/drivers/media/i2c/ov7740.c
@@ -873,12 +873,26 @@ static int ov7740_get_fmt(struct v4l2_subdev *sd,
 	return ret;
 }
 
+static int ov7740_get_mbus_config(struct v4l2_subdev *sd,
+				  unsigned int pad,
+				  struct v4l2_mbus_config *cfg)
+{
+	cfg->type = V4L2_MBUS_PARALLEL;
+	cfg->flags = V4L2_MBUS_MASTER | V4L2_MBUS_HSYNC_ACTIVE_HIGH |
+		     V4L2_MBUS_VSYNC_ACTIVE_HIGH |
+		     V4L2_MBUS_PCLK_SAMPLE_RISING |
+		     V4L2_MBUS_FIELD_EVEN_LOW | V4L2_MBUS_DATA_ACTIVE_HIGH;
+
+	return 0;
+}
+
 static const struct v4l2_subdev_pad_ops ov7740_subdev_pad_ops = {
 	.enum_frame_interval = ov7740_enum_frame_interval,
 	.enum_frame_size = ov7740_enum_frame_size,
 	.enum_mbus_code = ov7740_enum_mbus_code,
 	.get_fmt = ov7740_get_fmt,
 	.set_fmt = ov7740_set_fmt,
+	.get_mbus_config = ov7740_get_mbus_config,
 };
 
 static const struct v4l2_subdev_ops ov7740_subdev_ops = {
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ