From nobody Wed Feb 19 02:15:01 2025
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 (mail-am0eur02on2082.outbound.protection.outlook.com [40.107.247.82])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2BB4217E0;
	Fri, 24 Jan 2025 00:13:27 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
 arc=fail smtp.client-ip=40.107.247.82
ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1737677609; cv=fail;
 b=br55PL6XNPwNXfKNxIvkhIdm0QtXJ6PRaTmGhb6f40CEVxSGuJtTpQWTebaPoaaPopTGgGeFH365Fs3mwjMJzUm6sVmHbiT79PKegclxVlW5OOrbaHfG1/Or+8DyeGZdHh4JOuKO51aLUxfXmgZnxO/z9givacLiYX87X3osr+A=
ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1737677609; c=relaxed/simple;
	bh=udWy57/yMikxTbEDtQZa9hSzVL7eG4ZLgsYkg5p5NDc=;
	h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:
	 Content-Type:MIME-Version;
 b=sWBG1WSZJrU97pTmfpbX+qyz/LGGa3cu5ZVXDJO8jX/yyIl/5ieEwjDfkttovGAReCmH6hL+pdjwdkQqajiZWJyUGez8ZSYMbobhyNFJQSnXyjfP5zHtTN2hZxmO8tQ9fGXYNooWvxwYSrRYpyAcOfCKLj2YnPdixrpVrZUh5nU=
ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
 dmarc=pass (p=none dis=none) header.from=nxp.com;
 spf=pass smtp.mailfrom=nxp.com;
 dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com
 header.b=HfSs6oyi; arc=fail smtp.client-ip=40.107.247.82
Authentication-Results: smtp.subspace.kernel.org;
 dmarc=pass (p=none dis=none) header.from=nxp.com
Authentication-Results: smtp.subspace.kernel.org;
 spf=pass smtp.mailfrom=nxp.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com
 header.b="HfSs6oyi"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=DpNgUEyGgtWGKJiXIpDeG1tiXVfUKsiHBziaAFzaqYGv0uJsssGgWhlU1edYAHr2MWNLgNsIygBI5nVy1WLuMdNh9vixHXlPBps+pb0zQJBlpW1sxE41JsjKzE/feSWWtUsUmsZYUqmfFkl5CIQ3VfS0rLZzc/p7y54DZcETTVXVRTSN/Q5UbL3CA4hddQEP5tDgVAGaq1bfwg4QTr9PTcP6BtDqC/GFX6DqU4/wMkAVze6bOg4EWB8TM1mlslfATyC/YD2OAtz+aTxNoeLzMiCURFzuvpAu2otyyyDUA5vPMrr1GvGdRic07UFk3BRp8fpx/5Qt0eBXif0h2tmj/A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=qHIWasp8SiOZ3zxQuGXMl3OkhBt6p7Hcw2aqnzjd1Fo=;
 b=M2KS5U+DLNVkOfCIg7vjRbgWhYTKgNev2k3vfNbhe8PBmmSx5i1wgxZt1UbDCeYWe0tnA094PfHaeyMdEUPjTE+GxsPzKQoS2kSeGzQJD/NL+ngGke5bPUOskJKNolvZX/rz/5L4ZEdddiqpp9403jG2Qvh5TWo3Wd+EAXJJ5T28J/KFFu3ffIeCeUZIHyqkZFmeJPO/IXp9kEisMKzvLeZIrKydbeB0YBNmMJMgURO3QjxBgvBsRr5RCUl783TDNMxjuQSswnKehrRroG8gHwvS0GkivJfhjieD4jHrctZObmxXMCj3+MuQjHLKmBUbMMbWW/TGdXD6+0uNtoCTPA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass
 header.d=nxp.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=qHIWasp8SiOZ3zxQuGXMl3OkhBt6p7Hcw2aqnzjd1Fo=;
 b=HfSs6oyi0x9B3XsxAzzEY1pm9J+3nILxCq4wlk1fsE857rEKBIUqmL03arKWP76UgdWGr2wVSL4AoJOG5KZk5Usu5QweuQRNO5rxk0137PqBVezgap88l8zfecCVp0UOs5zVqabOeL7yh7pLpWq51kUerD570Uj8U5uAx16M5bk1Y1fwgjRia9MUBwsQt/M0AcrDNqHzepzZjEKl/GJGcvfMF68yMzWSxAUvouXKWcPHwvVFBlRneqW4DELgt3vU/LxQnBo87Jiuh7ZwSInbTUSdJD7Kna+sEABiw1ToKQ7BpR8MLy1Obn0D1XRye/EjTsukXZcoZQgEgf5TSz8/gQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=nxp.com;
Received: from PAXPR04MB9231.eurprd04.prod.outlook.com (2603:10a6:102:2bb::10)
 by PAXPR04MB9201.eurprd04.prod.outlook.com (2603:10a6:102:232::13) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8377.18; Fri, 24 Jan
 2025 00:13:23 +0000
Received: from PAXPR04MB9231.eurprd04.prod.outlook.com
 ([fe80::766c:5fb5:2049:dd01]) by PAXPR04MB9231.eurprd04.prod.outlook.com
 ([fe80::766c:5fb5:2049:dd01%4]) with mapi id 15.20.8377.009; Fri, 24 Jan 2025
 00:13:23 +0000
From: Mirela Rabulea <mirela.rabulea@nxp.com>
To: mchehab@kernel.org,
	sakari.ailus@linux.intel.com,
	hverkuil-cisco@xs4all.nl,
	laurent.pinchart+renesas@ideasonboard.com,
	robh@kernel.org,
	krzk+dt@kernel.org,
	bryan.odonoghue@linaro.org,
	laurentiu.palcu@nxp.com,
	robert.chiras@nxp.com
Cc: linux-media@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	LnxRevLi@nxp.com,
	kieran.bingham@ideasonboard.com,
	hdegoede@redhat.com,
	dave.stevenson@raspberrypi.com,
	mike.rudenko@gmail.com,
	alain.volmat@foss.st.com,
	devicetree@vger.kernel.org,
	conor+dt@kernel.org,
	alexander.stein@ew.tq-group.com,
	umang.jain@ideasonboard.com,
	zhi.mao@mediatek.com,
	festevam@denx.de,
	julien.vuillaumier@nxp.com,
	alice.yuan@nxp.com
Subject: [PATCH v3 1/4] dt-bindings: media: i2c: Add OX05B1S sensor
Date: Fri, 24 Jan 2025 02:12:40 +0200
Message-Id: <20250124001243.446511-2-mirela.rabulea@nxp.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20250124001243.446511-1-mirela.rabulea@nxp.com>
References: <20250124001243.446511-1-mirela.rabulea@nxp.com>
Content-Transfer-Encoding: quoted-printable
X-ClientProxiedBy: VI1P191CA0005.EURP191.PROD.OUTLOOK.COM
 (2603:10a6:800:1ba::12) To PAXPR04MB9231.eurprd04.prod.outlook.com
 (2603:10a6:102:2bb::10)
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PAXPR04MB9231:EE_|PAXPR04MB9201:EE_
X-MS-Office365-Filtering-Correlation-Id: 696673b4-8b68-46ab-ad33-08dd3c0bea58
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: 
	BCL:0;ARA:13230040|376014|52116014|7416014|366016|1800799024|38350700014;
X-Microsoft-Antispam-Message-Info: 
	=?us-ascii?Q?AkOBAYo5xFg45XM6Q1i8lmjaGh4fmVHPMHGeEHfp4eD+iK1qTw21U/iYum4Y?=
 =?us-ascii?Q?v/UQZNQeGxS20eLWr+6NEpIejBxF+JaTCvLFm1YRacVIHr030kaFNon0bsk4?=
 =?us-ascii?Q?slAGDhs3U+5f8ynQK1CRq7Q6SgOVCMuZGyY5rPb3qI5h3ED/DeBxidLv5BCt?=
 =?us-ascii?Q?Xbln4jIfOSZCQvTQn7HclA4s2rpvZFHvfEVxhgo09RYWVC9eDolMVtqV+M1F?=
 =?us-ascii?Q?6lxUuNmFe0oNQ14Jea0arjRAC4g0ixOjkyJ5PS/E7Umad14AOxN+j9NtkYd3?=
 =?us-ascii?Q?N/lrlnjG8eB2WnK+Vm0zm0hd7qCZvG5Pgij5R1CPfQmmL1snyqSyrxgWKSDJ?=
 =?us-ascii?Q?6CLaTwVKCoc5Xb5T/K4OLU3rNYa2aHYhXeoLI6DVwffJq80wDotvt8DJsv/V?=
 =?us-ascii?Q?2LAHc+HZmGxisYY9t4yiQbS0bNjaCi8id+c+9kOggLJxNIxTycwFwORyiGN5?=
 =?us-ascii?Q?4tbUPo+mjNXylKV8pV3b1cZr0qSP3QWATYz8eS57fMhxWqzPxIx5ULTpVXwl?=
 =?us-ascii?Q?KjyD9OqAlyV54wsqTeL9EowATJwicviq9GWDPhJUvnc/OtuF3tZRUUNrvHUB?=
 =?us-ascii?Q?DJARXqTDhSPtJZpskGjXsEQ34hlVVAjBUFyo1dpUUx6VSaiR/yKJSnKkvJjL?=
 =?us-ascii?Q?bNmLFKyidmcUULIKfNCo0lPF+Y+P2xBjAvHWKMVThgddGfRPG6sDEzi0KAAG?=
 =?us-ascii?Q?a3ckRu5jfZIv18StrRJQXfMYNi1iW9Vjtb9oORPstjjVIfoFIhtEm6Rhhb00?=
 =?us-ascii?Q?Hzx33Ca4OOEVG8dRu/9tGHNhQJkamULjAxx41teImxrWixr9RwpHmQm2w5mM?=
 =?us-ascii?Q?UAhgC2Q1EopQHDz4GCkMmoGtJRJ5xOh9vEjfvJSqkf7PsgvZzyfap4JpDd73?=
 =?us-ascii?Q?YV31ppOdR1uoZ/pQxfBKhjsABGlKmWMVYRfvjaWvfSnilLszWxRbWVVf8wu6?=
 =?us-ascii?Q?Iq4cuadSNmnFecCFpf2aiv8MT0iAgrCQ4cEce+pz/TQq3WqljRYujbYjp+L1?=
 =?us-ascii?Q?Tqv81anIVcxJdqRhGXguEnuZ/sOXCCnWFT5EdhxTk4Wmksz2IlJemeAP8mJ4?=
 =?us-ascii?Q?4dfPCKTEd6B6xAuyqWKG2NnA8/p3LXoxs9VNaIcY4H6faY2ge7T2nUMGorel?=
 =?us-ascii?Q?7U8dAPUqcKVQ0v4SM3EYix1rUSp/9PoGP9niqIyY5+rQR08QwBWgXfIh1coN?=
 =?us-ascii?Q?QC58X3E2Ntjt+Vzc7TL9mDQGfu1jBf9psLPZmiwnTDOnV1BJr4xhEcXxJDZ5?=
 =?us-ascii?Q?DjmgfW02dgMSJZz0cCoJNz1R7n8pJtso72KRlo/WXXjaEIn8xYRyo8c2kjcv?=
 =?us-ascii?Q?hlOEKfJ6mCYG513zcv9Q0yDMaxvavuw/OuGSmC+FiR1yUZFi4VkZvbrc/6Su?=
 =?us-ascii?Q?nsEyFLSovw5WkQw14RVW7baikMqY?=
X-Forefront-Antispam-Report: 
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9231.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(52116014)(7416014)(366016)(1800799024)(38350700014);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: 
	=?us-ascii?Q?lFy5yV06xwsK9WXL+oy8kKTGPKw7UXossRoIyBRbUuzgpg4jT9V9v5YZ6cRY?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?m5YhYyHM5l4trpiXpWytpO6QfDJBb4YrUdXz4wM6iZ4ZbxMnGo6JyW6SjHV6?=
 =?us-ascii?Q?SRIxYF/6Gx0u72+jkpj0McyvbkK7zIk1+doUsCzdyL3efSBLAIFiWhBKFKu2?=
 =?us-ascii?Q?FpdZvHU/yW3e41qzJsaRJkTBn0SnPODZ5TBK1MiNTKu0myCfVaOtkGk/NkSE?=
 =?us-ascii?Q?SD3ZzWOn3RdyAwNBQrqrc8T56p9C1IddNMRhuHI3tDbc0rTaMnSu271nFQgp?=
 =?us-ascii?Q?ZED6yrEWKrKZvbOT0ATnmP9/zwZX0plQuOP3QPSfWNAzz0JP/4ktnOPEBxCQ?=
 =?us-ascii?Q?EeCbcPptyMxvrzu/E1X07nr4jewKKPIlQv1EI0eB+M3W1haDQM6rCMu/EzqJ?=
 =?us-ascii?Q?URb0Zsd1q0OjVsMp86YTuCDlaxoKjjIpx1uJEfn6p2umJFIp71YeYRGrdA+h?=
 =?us-ascii?Q?TK4eocv3KpCxSbAEKhhi1unr0JZJD2q5m3mscKfqXu8ldZpuwvVcsQGN0MGm?=
 =?us-ascii?Q?WvaScEJdD8YabvAefx1qbd7HoSsu8kcpGmuDhD3YKpf2lxI2eA0LGGpmINDF?=
 =?us-ascii?Q?FC/pgwY8FxGJ752zpjTar8xqisBDq8laPqWRK81Tp1rcE9wdrDaRf8ZkXyJS?=
 =?us-ascii?Q?+KOzMFfBTf6UjnqTqJKRdcX1CbEoF3RgMmgg2yC92Mqf1vWndumFYITBRSFw?=
 =?us-ascii?Q?d796RdhLTt0/0cW+32pmBIIcw3kadvIRTTQWp0uCkX55k+3r7qzd92Exv50h?=
 =?us-ascii?Q?GA=3D=3D?=
X-OriginatorOrg: nxp.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 
 696673b4-8b68-46ab-ad33-08dd3c0bea58
X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9231.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2025 00:13:23.1774
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 
 G6iJ3yP16u61jWA454hbMKmBeHzJceJv8RzgVzUCTDe0GuAt+AzEVDQsm+ZyFuEjnD1nNL/5hMN93mu3jLTDqw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9201
Content-Type: text/plain; charset="utf-8"

Add bindings for Omnivision OX05B1S sensor.
Also add compatible for Omnivision OS08A20 sensor.

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---

Changes in v3:
	Use unevaluatedProperties: false and drop orientation/rotation
	Drop items and keep alphabetical order in compatible property
	Shorten the description for reset_gpio
	Make the supplies required.
	Use generic node name (camera instead of ox05b1s)

Changes in v2:
	Small updates on description
	Update subject, drop "bindings" and "driver"
	Just one binding patch (squash os08a20 bindings)
	Re-flow to 80 columns.
	Drop clock name (not needed in case of single clock)
	Make the clock required property, strictly from sensor module point of vie=
w, it is mandatory (will use a fixed clock for nxp board)
	Add regulators: avdd, dvdd, dovdd
	Add $ref: /schemas/media/video-interface-devices.yaml
	Drop assigned-clock* properties (defined in clocks.yaml)
	Keep "additionalProperties : false" and orientation/rotation (unevaluatedP=
roperties: false was suggested, but only orientation/rotation are needed fr=
om video-interface-devices.yaml)
	Include assigned-clock* in the example, for completeness sake (although it=
 was also suggested to omit them)

 .../bindings/media/i2c/ovti,ox05b1s.yaml      | 119 ++++++++++++++++++
 1 file changed, 119 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/ovti,ox05b1=
s.yaml

diff --git a/Documentation/devicetree/bindings/media/i2c/ovti,ox05b1s.yaml =
b/Documentation/devicetree/bindings/media/i2c/ovti,ox05b1s.yaml
new file mode 100644
index 000000000000..9f35b4e67bea
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/i2c/ovti,ox05b1s.yaml
@@ -0,0 +1,119 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (C) 2024 NXP
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/i2c/ovti,ox05b1s.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Omnivision OX05B1S Image Sensor
+
+maintainers:
+  - Mirela Rabulea <mirela.rabulea@nxp.com>
+
+description:
+  The Omnivision OX05B1S is a 1/2.5-Inch CMOS image sensor with an active
+  array size of 2592 x 1944. It is programmable through I2C interface.
+  Image data is available via MIPI CSI-2 serial data output.
+
+allOf:
+  - $ref: /schemas/media/video-interface-devices.yaml#
+
+properties:
+  compatible:
+    enum:
+      - ovti,os08a20
+      - ovti,ox05b1s
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    description: Input clock (24 MHz)
+    maxItems: 1
+
+  reset-gpios:
+    description: Active low XSHUTDOWN pin
+    maxItems: 1
+
+  avdd-supply:
+    description: Power for analog circuit (2.8V)
+
+  dovdd-supply:
+    description: Power for I/O circuit (1.8V)
+
+  dvdd-supply:
+    description: Power for digital circuit (1.2V)
+
+  port:
+    $ref: /schemas/graph.yaml#/$defs/port-base
+    additionalProperties: false
+    description: MIPI CSI-2 transmitter port
+
+    properties:
+      endpoint:
+        $ref: /schemas/media/video-interfaces.yaml#
+        unevaluatedProperties: false
+
+        properties:
+          data-lanes:
+            anyOf:
+              - items:
+                  - const: 1
+                  - const: 2
+              - items:
+                  - const: 1
+                  - const: 2
+                  - const: 3
+                  - const: 4
+        required:
+          - data-lanes
+
+    required:
+      - endpoint
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - port
+  - avdd-supply
+  - dovdd-supply
+  - dvdd-supply
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    i2c {
+        #address-cells =3D <1>;
+        #size-cells =3D <0>;
+
+        camera@36 {
+            compatible =3D "ovti,ox05b1s";
+            reg =3D <0x36>;
+            clocks =3D <&ox05b1s_clk>;
+
+            assigned-clocks =3D <&ox05b1s_clk>;
+            assigned-clock-parents =3D <&ox05b1s_clk_parent>;
+            assigned-clock-rates =3D <24000000>;
+
+            reset-gpios =3D <&gpio1 6 GPIO_ACTIVE_LOW>;
+
+            avdd-supply =3D <&camera_avdd_2v8>;
+            dovdd-supply =3D <&camera_dovdd_1v8>;
+            dvdd-supply =3D <&camera_dvdd_1v2>;
+
+            orientation =3D <2>;
+            rotation =3D <0>;
+
+            port {
+                ox05b1s_mipi_0_ep: endpoint {
+                    remote-endpoint =3D <&mipi_csi0_ep>;
+                    data-lanes =3D <1 2 3 4>;
+                };
+            };
+        };
+    };
+...
--=20
2.25.1
From nobody Wed Feb 19 02:15:01 2025
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 (mail-am0eur02on2082.outbound.protection.outlook.com [40.107.247.82])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 864874C91;
	Fri, 24 Jan 2025 00:13:29 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
 arc=fail smtp.client-ip=40.107.247.82
ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1737677612; cv=fail;
 b=f5A1cJ+FRVpPJLjPl2NfoAPcjLdQ4Qd9p6mIirT8Q4VEDW2Xn8Hs8pylLcLD//PdyzRtUnjff6pZriBzKzOj4BM83kFqf+hZh6gbe/gWzWNJody7CBbjoT0VplWWQ5X1zpywZPgP+F3hZaJa05/GAs006LImPqzA2SH9hwnPOEM=
ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1737677612; c=relaxed/simple;
	bh=wx9s0n4P4bgTayAUbxX3KZWPlb6gXnv06/qmlK7vr4U=;
	h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:
	 Content-Type:MIME-Version;
 b=NKcR0o8q2h+pWYFZWSNJMLFbj5UfQIF7vRXXmSAhl1SbwTjERahPDwXRaF2cqG7Rs7diw81kBzW2mLNHFQEATmiqh78DdLvYI3VHhYla7D+i05VyIXpixp0AhqruTzUKScDl7oriMmcZyC5yZhFNIvGukxtwIGt1GwBqQjekzz8=
ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
 dmarc=pass (p=none dis=none) header.from=nxp.com;
 spf=pass smtp.mailfrom=nxp.com;
 dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com
 header.b=bXivHJeG; arc=fail smtp.client-ip=40.107.247.82
Authentication-Results: smtp.subspace.kernel.org;
 dmarc=pass (p=none dis=none) header.from=nxp.com
Authentication-Results: smtp.subspace.kernel.org;
 spf=pass smtp.mailfrom=nxp.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com
 header.b="bXivHJeG"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=DfAlR04Lw0H0HnCRmlb1p6Yg5i8hJ649Esgx/0ZehYKM3yk+yEBujAdLtAJ8bl1ItJqE3R6+fBXamw72cmKE0BUtRaJFzuORrayMYJAoz1C+3FoznAfuuvu6HRf5B+gLJB8zja7v/MnvFjZM6FcYyaei9y5L16CdQEQ4d712F1RYfb/IAGJiEtkth9GBJ8PBjL3f4z5KKG3/G1Vn1Pmtq9UlQqKF/h7rhdD5IfL09/mwxZQisg0s5aulR664rQSrNog4vm7aDZvTbjyZd1sowXFuxpgGcJaFpb6aQ00pAWv01jjpquVVP7/7nhxUlsCFl7CUsH+ksiGVKLuGnvG/DQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=7tMjSwNiM7aTMEPorQohza+Yiu/Uuzjr/g5GkHax7S0=;
 b=hO69lE4zchbNU4wcfU2I+jp0tiIt/OV2aWQNP2HmY1qRhee2xUr9/FIm0GvT4yhEktSQX5/xW4uqzMNITuyz2NmMlt33efkttv1gi8u6T1uRv5vMiiaR+aVFGkkYJlNKMFND6YHyPTdqYfVgXwMyN0AQoKPz6VqMOSwCqIiJoRqMPT0ZoADztBm+FKHFdh8HByeDb/8oCpgJ40XAj+vpsnojYhv/azl6b4sqRkWNwENMRKzpyP8xL+4peuFXtlmTeWUwu1YF+kmpkqMwlEuaBdhzzEBFdD/Niic4dQ3GzdVT1rIwwNLSLeCtgzkl363EnoiSL3udNb+7Td2Q2MBgVQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass
 header.d=nxp.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=7tMjSwNiM7aTMEPorQohza+Yiu/Uuzjr/g5GkHax7S0=;
 b=bXivHJeGb36J3jOztkCXa6TAQHMuu6pVAdnFYgswJborMULHEJw9vPJuJyf/8PvnFAJuOVUHTZL0IOoku6vd0b5FU4GNLhci7uJmNL2ndYnr2D+bSYlHobVIgNPVycpIJ9I9BUfLr39RA61NQwNR4eKTmQBkTDzVZcbfsEnEAtBCO0lyVodoCxvMTgjbF7qy5WROXQDbzmkTwjfLAQbCslkOVBPnO/vjjf78QLLuLGsWjWI75/RXwTA22mrxNBSlgZnA5fGM+kjgiqVp7KiIIGIxGtaEDKOHPr7z+gtX4fZDRXTwBZ66zsoqoRfcM+dBHTBYilKAAuauUciZsF3uZA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=nxp.com;
Received: from PAXPR04MB9231.eurprd04.prod.outlook.com (2603:10a6:102:2bb::10)
 by PAXPR04MB9201.eurprd04.prod.outlook.com (2603:10a6:102:232::13) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8377.18; Fri, 24 Jan
 2025 00:13:24 +0000
Received: from PAXPR04MB9231.eurprd04.prod.outlook.com
 ([fe80::766c:5fb5:2049:dd01]) by PAXPR04MB9231.eurprd04.prod.outlook.com
 ([fe80::766c:5fb5:2049:dd01%4]) with mapi id 15.20.8377.009; Fri, 24 Jan 2025
 00:13:24 +0000
From: Mirela Rabulea <mirela.rabulea@nxp.com>
To: mchehab@kernel.org,
	sakari.ailus@linux.intel.com,
	hverkuil-cisco@xs4all.nl,
	laurent.pinchart+renesas@ideasonboard.com,
	robh@kernel.org,
	krzk+dt@kernel.org,
	bryan.odonoghue@linaro.org,
	laurentiu.palcu@nxp.com,
	robert.chiras@nxp.com
Cc: linux-media@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	LnxRevLi@nxp.com,
	kieran.bingham@ideasonboard.com,
	hdegoede@redhat.com,
	dave.stevenson@raspberrypi.com,
	mike.rudenko@gmail.com,
	alain.volmat@foss.st.com,
	devicetree@vger.kernel.org,
	conor+dt@kernel.org,
	alexander.stein@ew.tq-group.com,
	umang.jain@ideasonboard.com,
	zhi.mao@mediatek.com,
	festevam@denx.de,
	julien.vuillaumier@nxp.com,
	alice.yuan@nxp.com
Subject: [PATCH v3 2/4] media: ox05b1s: Add omnivision OX05B1S raw sensor
 driver
Date: Fri, 24 Jan 2025 02:12:41 +0200
Message-Id: <20250124001243.446511-3-mirela.rabulea@nxp.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20250124001243.446511-1-mirela.rabulea@nxp.com>
References: <20250124001243.446511-1-mirela.rabulea@nxp.com>
Content-Transfer-Encoding: quoted-printable
X-ClientProxiedBy: VI1P191CA0005.EURP191.PROD.OUTLOOK.COM
 (2603:10a6:800:1ba::12) To PAXPR04MB9231.eurprd04.prod.outlook.com
 (2603:10a6:102:2bb::10)
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PAXPR04MB9231:EE_|PAXPR04MB9201:EE_
X-MS-Office365-Filtering-Correlation-Id: 1c840160-1291-419c-0b0c-08dd3c0beb34
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: 
	BCL:0;ARA:13230040|376014|52116014|7416014|366016|1800799024|38350700014;
X-Microsoft-Antispam-Message-Info: 
	=?us-ascii?Q?5AUCrbeb9ILmUPQb3yICP7iId5l0uq5KtYXIVcM10RzmxzNNM0206QMCkSGK?=
 =?us-ascii?Q?+x+msk7hGymoSYiI1SioiqX911B1lp2iONWoddDdEKwOL9aA3+HWOM2t6poH?=
 =?us-ascii?Q?M6dHwJdiK5h4TCmyFsTw3vFbSxCVyBDfmQ/EP46Ft5bb6WcaoSNUVJJ86K2m?=
 =?us-ascii?Q?exCxNmQ9nYGUva0mCBm3eQeHVciikAMblcaOyab6h9UGzGtUzSEYqMg3ScrI?=
 =?us-ascii?Q?LQxbFCv34Vjv8muH7amdNEDcF4rht7nfQ6bQ7I23nLlFP5Ir0eTWXiYvXhPg?=
 =?us-ascii?Q?lG+nIUk50D9KYGG9KsGO6AEajn16DJt3gyvTosmMGYT8fxR4ixR1ns2FeJvk?=
 =?us-ascii?Q?mTyNQDToPCw8fe9WfqD1yU6lkoJwqFdf/8hr394CRc8ty4hg7+mH5tjEIKME?=
 =?us-ascii?Q?S6LV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eXLzSa0hTuO6mQFGfvn77cmlgQVcyh8QNA?=
 =?us-ascii?Q?hpT1UXIYItbLcyQ7FdiqLyatUzZzO9hcwZA8z1tsesA8fK8F+uJE/69i09dN?=
 =?us-ascii?Q?LWzW1dhg9NJ9aok0ZnYsZfYY4ahe7VwKioYAJeu6chHfoqsKVrx/3oS2/q8a?=
 =?us-ascii?Q?RnZr2weixa1oXqZmwanBY25EtqPoXVb0?=
X-Forefront-Antispam-Report: 
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9231.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(52116014)(7416014)(366016)(1800799024)(38350700014);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: 
	=?us-ascii?Q?4ufBBIS43RHzWRiU2Dx+iYHPFb/xd6PZeqCyWeC+yVvVoFw3P2hlG/qGv8z3?=
 =?us-ascii?Q?x6MQr1BAe7XhWOZismDNUPUv9c4OU1wN2I1qgOlvJSlzuHuGmEwfDCU22U1l?=
 =?us-ascii?Q?REktiZQ9cRlR8PgAvxVnAbc4stjJPP8N3AXZc8v8txFd7EEVgCFTie114dvB?=
 =?us-ascii?Q?3fQkcOL5UREMtc3q3GF++i69jcT+EjNNxLFfWsDN9HHdp/HSNy+2q7Gz2twd?=
 =?us-ascii?Q?MS5EeFI+U9lB2IHNOkIlhgXuEO6jGRUuRfb6GmWIa1YXKhRTvYSdyJ2qzGhv?=
 =?us-ascii?Q?N+56RrX7cpb3tcAnkQNGxEn68syKwmgaz+Gq/PwJt7Ag7ZIuvFHQw5k2qP95?=
 =?us-ascii?Q?Tl3QLVYgHiIyHcI6jWWB+Le6BhPm0SAqTGJsseOoNPtwBMXBUC/XE+jg9FBV?=
 =?us-ascii?Q?GPWdIe2fdUgj4TmoYWKV4i1eBeaQ5v+aGVenw1/5vbhqV0Zisxo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q?VsrPz0eitKyaF5EdHHm6xNTjmp7N01s94iwrhTAKSqhHzm82vhBI6oVdhbT0?=
 =?us-ascii?Q?qESVuCwASkMj7aN3n6BmJcR4lLjgat/RdvjQO9ATsF8HFuDyD9BBLKRlBH7x?=
 =?us-ascii?Q?KXvFgH3CnOgossbv2WU54JLTaCQrZIjH2rtqVog7oyKSubQTvbkNzxkZbyFq?=
 =?us-ascii?Q?ICXXFJPYaVe3tzF98I6P65QSLX3ozxXyQSwo2oFtndYjKv/lQ9wAZbI/GHii?=
 =?us-ascii?Q?kYUUGFU1BWTiGTwCZrWQUU/HQnfQ6C+AmG/OJNTZ7DkGRs1kfRN+cqPjuiql?=
 =?us-ascii?Q?ww=3D=3D?=
X-OriginatorOrg: nxp.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 
 1c840160-1291-419c-0b0c-08dd3c0beb34
X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9231.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2025 00:13:24.6896
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 
 oXtC/UqTCeH4oP5u/CUXAccKsBRpS9XiKNDoJrh/Npoc74N8qXSGClezQWb5bERvsMkndcEJGIomQu51Smn0Og==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9201
Content-Type: text/plain; charset="utf-8"

Add a v4l2 subdevice driver for the Omnivision OX05B1S RGB-IR sensor.

The Omnivision OX05B1S is a 1/2.5-Inch CMOS image sensor with an
active array size of 2592 x 1944.

The following features are supported for OX05B1S:
- Manual exposure an gain control support
- vblank/hblank control support
- Supported resolution: 2592 x 1944 @ 30fps (SGRBG10)

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
---

Changes in v3:
	Use helpers from v4l2-cci.h (drop ox05b1s_write_reg, ox05b1s_read_reg, ox0=
5b1s_set_hts/vts/exp/analog_gain, ox05b1s_regmap_config)
	Don't hardcode timing registers: remove timing registers x_output_size/y_o=
utput_size from register configuration list, add them to ox05b1s_apply_curr=
ent_mode
	Remove HTS,VTS from register config list as they are written by HBLANK and=
 VBLANK controls through __v4l2_ctrl_handler_setup
	ox05b1s register config cleaning (remove all registers that were at their =
default value, and more, keep only what seems mandatory to be able to strea=
m)
	Use const for ox05b1s_supported_modes
	Device should be silent on success, use dev_dbg.
	Drop unneeded {}
	Fixed an error introduced in v2 in ox05b1s_nearest_size (set_fmt for 4k BG=
GR12 mode was stuck)
	Fix an issue in ox05b1s_set_fmt, the format was saved in subdev state only=
 for _TRY, save it also for _ACTIVE

Changes in v2:
	Use dev_err_probe for missing clock, since it is now required property, an=
d use NULL for devm_clk_get (no name for single clock), remove check for no=
n NULL sensor->sensor_clk
	Remove dev_err message for devm_regmap_init_i2c allocation error
	Added spaces inside brackets, wrap lines to 80
	Remove some redundant initializations
	Add regulators
	Make "sizes" a pointer
		Use struct v4l2_area instead of u32[2] array
		Remove the count for supported_modes[] and supported_codes[], instead use=
 sentinel element at the end
		Consequently, update ox05b1s_enum_mbus_code, ox05b1s_enum_frame_size, ox0=
5b1s_nearest_size, ox05b1s_find_code, to not use the count
	Remove .h files for modes, however did not move this code in the driver fi=
le but added a separate c file for all supported modes
	Refactor register lists to allow multiple register arrays per mode
	Use GPL-2.0-only instead of GPL-2.0

 drivers/media/i2c/Kconfig                 |   1 +
 drivers/media/i2c/Makefile                |   1 +
 drivers/media/i2c/ox05b1s/Kconfig         |  10 +
 drivers/media/i2c/ox05b1s/Makefile        |   2 +
 drivers/media/i2c/ox05b1s/ox05b1s.h       |  22 +
 drivers/media/i2c/ox05b1s/ox05b1s_mipi.c  | 939 ++++++++++++++++++++++
 drivers/media/i2c/ox05b1s/ox05b1s_modes.c |  63 ++
 7 files changed, 1038 insertions(+)
 create mode 100644 drivers/media/i2c/ox05b1s/Kconfig
 create mode 100644 drivers/media/i2c/ox05b1s/Makefile
 create mode 100644 drivers/media/i2c/ox05b1s/ox05b1s.h
 create mode 100644 drivers/media/i2c/ox05b1s/ox05b1s_mipi.c
 create mode 100644 drivers/media/i2c/ox05b1s/ox05b1s_modes.c

diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig
index 8ba096b8ebca..5cda062c0463 100644
--- a/drivers/media/i2c/Kconfig
+++ b/drivers/media/i2c/Kconfig
@@ -700,6 +700,7 @@ config VIDEO_VGXY61
=20
 source "drivers/media/i2c/ccs/Kconfig"
 source "drivers/media/i2c/et8ek8/Kconfig"
+source "drivers/media/i2c/ox05b1s/Kconfig"
=20
 endif
=20
diff --git a/drivers/media/i2c/Makefile b/drivers/media/i2c/Makefile
index fbb988bd067a..028eb08e648c 100644
--- a/drivers/media/i2c/Makefile
+++ b/drivers/media/i2c/Makefile
@@ -114,6 +114,7 @@ obj-$(CONFIG_VIDEO_OV9282) +=3D ov9282.o
 obj-$(CONFIG_VIDEO_OV9640) +=3D ov9640.o
 obj-$(CONFIG_VIDEO_OV9650) +=3D ov9650.o
 obj-$(CONFIG_VIDEO_OV9734) +=3D ov9734.o
+obj-$(CONFIG_VIDEO_OX05B1S) +=3D ox05b1s/
 obj-$(CONFIG_VIDEO_RDACM20) +=3D rdacm20.o
 obj-$(CONFIG_VIDEO_RDACM21) +=3D rdacm21.o
 obj-$(CONFIG_VIDEO_RJ54N1) +=3D rj54n1cb0c.o
diff --git a/drivers/media/i2c/ox05b1s/Kconfig b/drivers/media/i2c/ox05b1s/=
Kconfig
new file mode 100644
index 000000000000..48fcd04b20d5
--- /dev/null
+++ b/drivers/media/i2c/ox05b1s/Kconfig
@@ -0,0 +1,10 @@
+config VIDEO_OX05B1S
+	tristate "OmniVision raw sensor support OX05B1S"
+	depends on OF
+	depends on GPIOLIB
+	select REGMAP_I2C
+	help
+	  This is a Video4Linux2 sensor driver for the Omnivision OX05B1S RGB-IR =
sensor.
+	  This is a 1/2.5-Inch CMOS image sensor with an active array size of 259=
2 x 1944.
+	  It is programmable through I2C interface.
+	  The output is on MIPI CSI-2 interface.
diff --git a/drivers/media/i2c/ox05b1s/Makefile b/drivers/media/i2c/ox05b1s=
/Makefile
new file mode 100644
index 000000000000..0b38dbf98bcd
--- /dev/null
+++ b/drivers/media/i2c/ox05b1s/Makefile
@@ -0,0 +1,2 @@
+ox05b1s-objs :=3D ox05b1s_modes.o ox05b1s_mipi.o
+obj-$(CONFIG_VIDEO_OX05B1S) +=3D ox05b1s.o
diff --git a/drivers/media/i2c/ox05b1s/ox05b1s.h b/drivers/media/i2c/ox05b1=
s/ox05b1s.h
new file mode 100644
index 000000000000..a893c65894f3
--- /dev/null
+++ b/drivers/media/i2c/ox05b1s/ox05b1s.h
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (C) 2024, NXP
+ */
+
+#ifndef OX05B1S_H
+#define OX05B1S_H
+
+#include <linux/types.h>
+
+struct ox05b1s_reg {
+	u32 addr;
+	u32 data;
+};
+
+struct ox05b1s_reglist {
+	struct ox05b1s_reg *regs;
+};
+
+extern struct ox05b1s_reglist ox05b1s_reglist_2592x1944[];
+
+#endif /* OX05B1S_H */
diff --git a/drivers/media/i2c/ox05b1s/ox05b1s_mipi.c b/drivers/media/i2c/o=
x05b1s/ox05b1s_mipi.c
new file mode 100644
index 000000000000..aeea7caa6a15
--- /dev/null
+++ b/drivers/media/i2c/ox05b1s/ox05b1s_mipi.c
@@ -0,0 +1,939 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * A V4L2 driver for Omnivision OX05B1S RGB-IR camera.
+ * Copyright (C) 2024, NXP
+ *
+ * Inspired from Sony imx219, imx290, imx214 and imx334 camera drivers
+ *
+ */
+
+#include <linux/clk.h>
+#include <linux/pm_runtime.h>
+#include <linux/regmap.h>
+#include <linux/regulator/consumer.h>
+#include <media/v4l2-cci.h>
+#include <media/mipi-csi2.h>
+#include <media/v4l2-ctrls.h>
+#include <media/v4l2-device.h>
+#include <media/v4l2-fwnode.h>
+
+#include "ox05b1s.h"
+
+#define OX05B1S_SENS_PAD_SOURCE	0
+#define OX05B1S_SENS_PADS_NUM	1
+
+#define OX05B1S_REG_SW_STB		CCI_REG8(0x0100)
+#define OX05B1S_REG_SW_RST		CCI_REG8(0x0103)
+#define OX05B1S_REG_CHIP_ID		CCI_REG24(0x300a)
+#define OX05B1S_REG_TIMING_HTS		CCI_REG16(0x380c)
+#define OX05B1S_REG_TIMING_VTS		CCI_REG16(0x380e)
+#define OX05B1S_REG_EXPOSURE		CCI_REG16(0x3501)
+#define OX05B1S_REG_GAIN		CCI_REG16(0x3508)
+#define OX05B1S_REG_X_OUTPUT_SIZE	CCI_REG16(0x3808)
+#define OX05B1S_REG_Y_OUTPUT_SIZE	CCI_REG16(0x380a)
+
+#define client_to_ox05b1s(client)\
+	container_of(i2c_get_clientdata(client), struct ox05b1s, subdev)
+
+struct ox05b1s_sizes {
+	u32	code;
+	const struct v4l2_area *sizes;
+};
+
+struct ox05b1s_plat_data {
+	char				name[20];
+	u32				chip_id;
+	u32				native_width;
+	u32				native_height;
+	u32				active_top;
+	u32				active_left;
+	u32				active_width;
+	u32				active_height;
+	const struct ox05b1s_mode	*supported_modes;
+	u32				default_mode_index;
+	const struct ox05b1s_sizes	*supported_codes;
+};
+
+struct ox05b1s_ctrls {
+	struct v4l2_ctrl_handler handler;
+	struct v4l2_ctrl *link_freq;
+	struct v4l2_ctrl *pixel_rate;
+	struct v4l2_ctrl *hblank;
+	struct v4l2_ctrl *vblank;
+	struct v4l2_ctrl *gain;
+	struct v4l2_ctrl *exposure;
+};
+
+struct ox05b1s_mode {
+	u32 index;
+	u32 width;
+	u32 height;
+	u32 code;
+	u32 bpp;
+	u32 vts; /* default VTS */
+	u32 hts; /* default HTS */
+	u32 exp; /* max exposure */
+	bool h_bin; /* horizontal binning */
+	u32 fps;
+	struct ox05b1s_reglist *reg_data;
+};
+
+/* regulator supplies */
+static const char * const ox05b1s_supply_name[] =3D {
+	"AVDD",  /* Analog voltage supply, 2.8 volts */
+	"DVDD",  /* Digital I/O voltage supply, 1.8 volts */
+	"DOVDD", /* Digital voltage supply, 1.2 volts */
+};
+
+#define OX05B1S_NUM_SUPPLIES ARRAY_SIZE(ox05b1s_supply_name)
+
+struct ox05b1s {
+	struct i2c_client *i2c_client;
+	struct regmap *regmap;
+	struct gpio_desc *rst_gpio;
+	struct regulator_bulk_data supplies[OX05B1S_NUM_SUPPLIES];
+	struct clk *sensor_clk;
+	const struct ox05b1s_plat_data *model;
+	struct v4l2_subdev subdev;
+	struct media_pad pads[OX05B1S_SENS_PADS_NUM];
+	const struct ox05b1s_mode *mode;
+	struct mutex lock; /* sensor lock */
+	u32 stream_status;
+	struct ox05b1s_ctrls ctrls;
+};
+
+static const struct ox05b1s_mode ox05b1s_supported_modes[] =3D {
+	{
+		.index		=3D 0,
+		.width		=3D 2592,
+		.height		=3D 1944,
+		.code		=3D MEDIA_BUS_FMT_SGRBG10_1X10,
+		.bpp		=3D 10,
+		.vts		=3D 0x850,
+		.hts		=3D 0x2f0,
+		.exp		=3D 0x850 - 8,
+		.h_bin		=3D false,
+		.fps		=3D 30,
+		.reg_data	=3D ox05b1s_reglist_2592x1944,
+	}, {
+		/* sentinel */
+	}
+};
+
+/* keep in sync with ox05b1s_supported_modes */
+static const struct v4l2_area ox05b1s_sgrbg10_sizes[] =3D {
+	{
+		.width =3D 2592,
+		.height =3D 1944,
+	}, {
+		/* sentinel */
+	}
+};
+
+static const struct ox05b1s_sizes ox05b1s_supported_codes[] =3D {
+	{
+		.code =3D MEDIA_BUS_FMT_SGRBG10_1X10,
+		.sizes =3D ox05b1s_sgrbg10_sizes,
+	}, {
+		/* sentinel */
+	}
+};
+
+static int ox05b1s_power_on(struct ox05b1s *sensor)
+{
+	struct device *dev =3D &sensor->i2c_client->dev;
+	int ret =3D 0;
+
+	ret =3D regulator_bulk_enable(OX05B1S_NUM_SUPPLIES, sensor->supplies);
+	if (ret) {
+		dev_err(dev, "Failed to enable regulators\n");
+		return ret;
+	}
+
+	/* get out of powerdown and reset */
+	gpiod_set_value_cansleep(sensor->rst_gpio, 0);
+
+	ret =3D clk_prepare_enable(sensor->sensor_clk);
+	if (ret < 0) {
+		dev_err(dev, "Enable sensor clk fail ret=3D%d\n", ret);
+		goto reg_off;
+	}
+
+	/* with XVCLK@24MHz, t2 =3D 6ms required delay for ox05b1s before first S=
CCB transaction */
+	fsleep(6000);
+
+	return ret;
+
+reg_off:
+	regulator_bulk_disable(OX05B1S_NUM_SUPPLIES, sensor->supplies);
+
+	return ret;
+}
+
+static int ox05b1s_power_off(struct ox05b1s *sensor)
+{
+	gpiod_set_value_cansleep(sensor->rst_gpio, 1);
+
+	/* XVCLK must be active for 512 cycles (0.34 ms at 24MHz) after last SCCB=
 transaction */
+	fsleep(350);
+	clk_disable_unprepare(sensor->sensor_clk);
+
+	regulator_bulk_disable(OX05B1S_NUM_SUPPLIES, sensor->supplies);
+
+	return 0;
+}
+
+static int ox05b1s_runtime_suspend(struct device *dev)
+{
+	struct v4l2_subdev *sd =3D dev_get_drvdata(dev);
+	struct i2c_client *client =3D v4l2_get_subdevdata(sd);
+	struct ox05b1s *sensor =3D client_to_ox05b1s(client);
+
+	return ox05b1s_power_off(sensor);
+}
+
+static int ox05b1s_runtime_resume(struct device *dev)
+{
+	struct v4l2_subdev *sd =3D dev_get_drvdata(dev);
+	struct i2c_client *client =3D v4l2_get_subdevdata(sd);
+	struct ox05b1s *sensor =3D client_to_ox05b1s(client);
+
+	return ox05b1s_power_on(sensor);
+}
+
+#define OX05B1S_MAX_REG_BULK 16
+static int ox05b1s_write_reg_array(struct ox05b1s *sensor,
+				   struct ox05b1s_reg *reg_array)
+{
+	struct device *dev =3D &sensor->i2c_client->dev;
+	struct ox05b1s_reg *table =3D reg_array;
+	u8 vals[OX05B1S_MAX_REG_BULK];
+	int i;
+	int ret;
+
+	while (table->addr) {
+		for (i =3D 0; i < OX05B1S_MAX_REG_BULK; i++) {
+			if (table[i].addr !=3D (table[0].addr + i))
+				break;
+			vals[i] =3D table[i].data;
+		}
+		ret =3D regmap_bulk_write(sensor->regmap, table->addr, vals, i);
+		if (ret) {
+			dev_err(dev, "Failed to write reg addr=3D%x, count %d\n", table->addr, =
i);
+			return ret;
+		}
+		table +=3D i;
+	}
+
+	return 0;
+}
+
+static inline struct v4l2_subdev *ctrl_to_sd(struct v4l2_ctrl *ctrl)
+{
+	return &container_of(ctrl->handler, struct ox05b1s,
+			     ctrls.handler)->subdev;
+}
+
+static int ox05b1s_s_ctrl(struct v4l2_ctrl *ctrl)
+{
+	struct v4l2_subdev *sd =3D ctrl_to_sd(ctrl);
+	struct i2c_client *client =3D v4l2_get_subdevdata(sd);
+	struct ox05b1s *sensor =3D client_to_ox05b1s(client);
+	u32 w =3D sensor->mode->width;
+	u32 h =3D sensor->mode->height;
+	int ret =3D 0;
+
+	/* apply V4L2 controls values only if power is already up */
+	if (!pm_runtime_get_if_in_use(&client->dev))
+		return 0;
+
+	/* s_ctrl holds sensor lock */
+	switch (ctrl->id) {
+	case V4L2_CID_VBLANK:
+		ret =3D cci_write(sensor->regmap, OX05B1S_REG_TIMING_VTS,
+				h + ctrl->val, NULL);
+		break;
+	case V4L2_CID_HBLANK:
+		u32 hts =3D (sensor->mode->h_bin) ?
+			  w + ctrl->val : (w + ctrl->val) / 2;
+		ret =3D cci_write(sensor->regmap, OX05B1S_REG_TIMING_HTS,
+				hts, NULL);
+		break;
+	case V4L2_CID_PIXEL_RATE:
+		/* Read-only, but we adjust it based on mode. */
+		break;
+	case V4L2_CID_ANALOGUE_GAIN:
+		ret =3D cci_write(sensor->regmap, OX05B1S_REG_GAIN,
+				ctrl->val, NULL);
+		break;
+	case V4L2_CID_EXPOSURE:
+		ret =3D cci_write(sensor->regmap, OX05B1S_REG_EXPOSURE,
+				ctrl->val, NULL);
+		break;
+	default:
+		ret =3D -EINVAL;
+		break;
+	}
+
+	pm_runtime_put(&client->dev);
+
+	return ret;
+}
+
+static const struct v4l2_ctrl_ops ox05b1s_ctrl_ops =3D {
+	.s_ctrl =3D ox05b1s_s_ctrl,
+};
+
+/*
+ * MIPI CSI-2 link frequencies.
+ * link_freq =3D (pixel_rate * bpp) / (2 * data_lanes)
+ */
+static const s64 ox05b1s_csi2_link_freqs[] =3D {
+	200000000,
+};
+
+/* Link freq for default mode: 1080p RAW10, 4 data lanes 800 Mbps/lane. */
+#define OX05B1S_DEFAULT_LINK_FREQ	0
+
+static int ox05b1s_init_controls(struct ox05b1s *sensor)
+{
+	const struct v4l2_ctrl_ops *ops =3D &ox05b1s_ctrl_ops;
+	struct ox05b1s_ctrls *ctrls =3D &sensor->ctrls;
+	struct v4l2_ctrl_handler *hdl =3D &ctrls->handler;
+	struct device *dev =3D &sensor->i2c_client->dev;
+	struct v4l2_fwnode_device_properties props;
+	int ret;
+
+	v4l2_ctrl_handler_init(hdl, 7);
+
+	/* we can use our own mutex for the ctrl lock */
+	hdl->lock =3D &sensor->lock;
+
+	/* Clock related controls */
+	ctrls->link_freq =3D v4l2_ctrl_new_int_menu(hdl, ops,
+						  V4L2_CID_LINK_FREQ,
+						  ARRAY_SIZE(ox05b1s_csi2_link_freqs) - 1,
+						  OX05B1S_DEFAULT_LINK_FREQ,
+						  ox05b1s_csi2_link_freqs);
+
+	/* mode dependent, actual range set in ox05b1s_update_controls */
+	ctrls->pixel_rate =3D v4l2_ctrl_new_std(hdl, ops, V4L2_CID_PIXEL_RATE,
+					      0, 0, 1, 0);
+
+	ctrls->hblank =3D v4l2_ctrl_new_std(hdl, ops, V4L2_CID_HBLANK,
+					  0, 0, 1, 0);
+
+	ctrls->vblank =3D v4l2_ctrl_new_std(hdl, ops, V4L2_CID_VBLANK,
+					  0, 0, 1, 0);
+
+	ctrls->exposure =3D v4l2_ctrl_new_std(hdl, ops, V4L2_CID_EXPOSURE,
+					    0, 0, 1, 0);
+
+	ctrls->gain =3D v4l2_ctrl_new_std(hdl, ops, V4L2_CID_ANALOGUE_GAIN,
+					0, 0xFFFF, 1, 0x80);
+
+	if (hdl->error) {
+		ret =3D hdl->error;
+		goto free_ctrls;
+	}
+
+	ctrls->link_freq->flags |=3D V4L2_CTRL_FLAG_READ_ONLY;
+	ctrls->pixel_rate->flags |=3D V4L2_CTRL_FLAG_READ_ONLY;
+
+	ret =3D v4l2_fwnode_device_parse(dev, &props);
+	if (ret)
+		goto free_ctrls;
+
+	ret =3D v4l2_ctrl_new_fwnode_properties(hdl, ops, &props);
+	if (ret)
+		goto free_ctrls;
+
+	sensor->subdev.ctrl_handler =3D hdl;
+	return 0;
+
+free_ctrls:
+	dev_err(dev, "Failed to init controls\n");
+	v4l2_ctrl_handler_free(hdl);
+	return ret;
+}
+
+static int ox05b1s_apply_current_mode(struct ox05b1s *sensor);
+
+static int ox05b1s_s_stream(struct v4l2_subdev *sd, int enable)
+{
+	struct i2c_client *client =3D v4l2_get_subdevdata(sd);
+	struct ox05b1s *sensor =3D client_to_ox05b1s(client);
+	int ret =3D 0;
+
+	if (enable) {
+		ret =3D pm_runtime_resume_and_get(&client->dev);
+		if (ret < 0)
+			return ret;
+		ret =3D ox05b1s_apply_current_mode(sensor);
+		if (!ret)
+			ret =3D cci_write(sensor->regmap, OX05B1S_REG_SW_STB, 0x01, NULL);
+	} else {
+		ret =3D cci_write(sensor->regmap, OX05B1S_REG_SW_STB, 0x00, NULL);
+	}
+
+	sensor->stream_status =3D enable;
+
+	if (!enable || ret) {
+		pm_runtime_mark_last_busy(&sensor->i2c_client->dev);
+		pm_runtime_put_autosuspend(&client->dev);
+	}
+
+	return 0;
+}
+
+static void ox05b1s_update_pad_format(struct ox05b1s *sensor,
+				      const struct ox05b1s_mode *mode,
+				      struct v4l2_mbus_framefmt *fmt)
+{
+	fmt->code =3D mode->code;
+	fmt->width =3D mode->width;
+	fmt->height =3D mode->height;
+	fmt->field =3D V4L2_FIELD_NONE;
+	fmt->colorspace =3D V4L2_COLORSPACE_RAW;
+	fmt->quantization =3D V4L2_QUANTIZATION_FULL_RANGE;
+	fmt->xfer_func =3D V4L2_XFER_FUNC_NONE;
+}
+
+static int ox05b1s_init_state(struct v4l2_subdev *sd,
+			      struct v4l2_subdev_state *state)
+{
+	struct i2c_client *client =3D v4l2_get_subdevdata(sd);
+	struct ox05b1s *sensor =3D client_to_ox05b1s(client);
+	struct v4l2_mbus_framefmt *format;
+
+	/* Initialize the format. */
+	format =3D v4l2_subdev_state_get_format(state, 0);
+	ox05b1s_update_pad_format(sensor, &sensor->model->supported_modes[0], for=
mat);
+
+	return 0;
+}
+
+static int ox05b1s_enum_mbus_code(struct v4l2_subdev *sd,
+				  struct v4l2_subdev_state *state,
+				  struct v4l2_subdev_mbus_code_enum *code)
+{
+	struct i2c_client *client =3D v4l2_get_subdevdata(sd);
+	struct ox05b1s *sensor =3D client_to_ox05b1s(client);
+	const struct ox05b1s_sizes *supported_codes =3D sensor->model->supported_=
codes;
+	int i =3D 0;
+
+	while (i++ < code->index && supported_codes->code)
+		supported_codes++;
+	if (!supported_codes->code) /* code->index outside supported_codes[] */
+		return -EINVAL;
+
+	code->code =3D supported_codes->code;
+
+	return 0;
+}
+
+static int ox05b1s_enum_frame_size(struct v4l2_subdev *sd,
+				   struct v4l2_subdev_state *sd_state,
+				   struct v4l2_subdev_frame_size_enum *fse)
+{
+	struct i2c_client *client =3D v4l2_get_subdevdata(sd);
+	struct ox05b1s *sensor =3D client_to_ox05b1s(client);
+	const struct ox05b1s_sizes *supported_codes =3D sensor->model->supported_=
codes;
+	const struct v4l2_area *sizes;
+	int i =3D 0;
+
+	if (fse->pad !=3D 0)
+		return -EINVAL;
+
+	while (supported_codes->code) {
+		if (supported_codes->code =3D=3D fse->code)
+			break;
+		supported_codes++;
+	}
+
+	if (!supported_codes->code) /* fse->code not in supported_codes[] */
+		return -EINVAL;
+
+	sizes =3D supported_codes->sizes;
+	while (i++ < fse->index && sizes->width)
+		sizes++;
+	if (!sizes->width) /* fse->index outside sizes[] */
+		return -EINVAL;
+
+	fse->min_width =3D sizes->width;
+	fse->max_width =3D fse->min_width;
+	fse->min_height =3D sizes->height;
+	fse->max_height =3D fse->min_height;
+
+	return 0;
+}
+
+/* Update control ranges based on current streaming mode, needs sensor loc=
k */
+static int ox05b1s_update_controls(struct ox05b1s *sensor)
+{
+	int ret;
+	struct device *dev =3D &sensor->i2c_client->dev;
+	u32 hts =3D sensor->mode->hts;
+	u32 hblank;
+	u32 vts =3D sensor->mode->vts;
+	u32 vblank =3D vts - sensor->mode->height;
+	u32 fps =3D sensor->mode->fps;
+	u64 pixel_rate =3D (sensor->mode->h_bin) ? hts * vts * fps : 2 * hts * vt=
s * fps;
+	u32 min_exp =3D 8;
+	u32 max_exp =3D vts - 8;
+
+	ret =3D __v4l2_ctrl_modify_range(sensor->ctrls.pixel_rate, pixel_rate,
+				       pixel_rate, 1, pixel_rate);
+	if (ret) {
+		dev_err(dev, "Modify range for ctrl: pixel_rate %llu-%llu failed\n",
+			pixel_rate, pixel_rate);
+		goto out;
+	}
+
+	if (sensor->mode->h_bin)
+		hblank =3D hts - sensor->mode->width;
+	else
+		hblank =3D 2 * hts - sensor->mode->width;
+
+	ret =3D __v4l2_ctrl_modify_range(sensor->ctrls.hblank, hblank, hblank,
+				       1, hblank);
+	if (ret) {
+		dev_err(dev, "Modify range for ctrl: hblank %u-%u failed\n",
+			hblank, hblank);
+		goto out;
+	}
+	__v4l2_ctrl_s_ctrl(sensor->ctrls.hblank, sensor->ctrls.hblank->default_va=
lue);
+
+	ret =3D __v4l2_ctrl_modify_range(sensor->ctrls.vblank, 0, vblank * 4,
+				       1, vblank);
+	if (ret) {
+		dev_err(dev, "Modify range for ctrl: vblank %u-%u failed\n",
+			vblank, vblank);
+		goto out;
+	}
+	__v4l2_ctrl_s_ctrl(sensor->ctrls.vblank, sensor->ctrls.vblank->default_va=
lue);
+
+	ret =3D __v4l2_ctrl_modify_range(sensor->ctrls.exposure, min_exp, max_exp,
+				       1, max_exp / 2);
+	if (ret) {
+		dev_err(dev, "Modify range for ctrl: exposure %u-%u failed\n",
+			min_exp, max_exp);
+		goto out;
+	}
+	__v4l2_ctrl_s_ctrl(sensor->ctrls.exposure, sensor->ctrls.exposure->defaul=
t_value);
+
+out:
+	return ret;
+}
+
+/* needs sensor lock and power on */
+static int ox05b1s_apply_current_mode(struct ox05b1s *sensor)
+{
+	struct device *dev =3D &sensor->i2c_client->dev;
+	struct ox05b1s_reglist *reg_data =3D sensor->mode->reg_data;
+	u32 w =3D sensor->mode->width;
+	u32 h =3D sensor->mode->height;
+	int ret =3D 0;
+
+	cci_write(sensor->regmap, OX05B1S_REG_SW_RST, 0x01, NULL);
+
+	while (reg_data->regs) {
+		ret =3D ox05b1s_write_reg_array(sensor, reg_data->regs);
+		if (ret)
+			goto out;
+		reg_data++;
+	}
+
+	cci_write(sensor->regmap, OX05B1S_REG_X_OUTPUT_SIZE, w, &ret);
+	cci_write(sensor->regmap, OX05B1S_REG_Y_OUTPUT_SIZE, h, &ret);
+	if (ret)
+		goto out;
+
+	/* setup handler will write actual controls into sensor registers */
+	ret =3D  __v4l2_ctrl_handler_setup(&sensor->ctrls.handler);
+
+out:
+	if (ret < 0)
+		dev_err(dev, "Failed to apply mode %dx%d,bpp=3D%d\n", w, h,
+			sensor->mode->bpp);
+
+	return ret;
+}
+
+/* similar with v4l2_find_nearest_size but filter for mbus code, needs sen=
sor lock */
+static const struct ox05b1s_mode *ox05b1s_nearest_size(const struct ox05b1=
s_mode *supported_modes,
+						       struct v4l2_subdev_format *fmt)
+{
+	u32 error, min_error =3D U32_MAX;
+	const struct ox05b1s_mode *best =3D NULL;
+
+	if (!supported_modes)
+		return NULL;
+
+	for (; supported_modes->width; supported_modes++) {
+		const u32 w =3D supported_modes->width;
+		const u32 h =3D supported_modes->height;
+
+		if (supported_modes->code !=3D fmt->format.code)
+			continue;
+
+		error =3D abs(w - fmt->format.width) + abs(h - fmt->format.height);
+		if (error > min_error)
+			continue;
+
+		min_error =3D error;
+		best =3D supported_modes;
+		if (!error)
+			break;
+	}
+
+	return best;
+}
+
+/* get a valid mbus code for the model, either the requested one or the de=
fault one */
+static u32 ox05b1s_find_code(const struct ox05b1s_plat_data *model, u32 co=
de)
+{
+	u32 found_code =3D 0;
+	const struct ox05b1s_sizes *supported_codes =3D model->supported_codes;
+
+	while (supported_codes->code) {
+		if (supported_codes->code =3D=3D code) {
+			found_code =3D code;
+			break;
+		}
+		supported_codes++;
+	}
+
+	if (!supported_codes->code) /* code not in supported_codes[] */
+		found_code =3D model->supported_codes[model->default_mode_index].code;
+
+	return found_code;
+}
+
+static int ox05b1s_set_fmt(struct v4l2_subdev *sd,
+			   struct v4l2_subdev_state *state,
+			   struct v4l2_subdev_format *fmt)
+{
+	struct i2c_client *client =3D v4l2_get_subdevdata(sd);
+	struct ox05b1s *sensor =3D client_to_ox05b1s(client);
+	struct device *dev =3D &sensor->i2c_client->dev;
+	struct v4l2_mbus_framefmt *format;
+	const struct ox05b1s_mode *mode;
+
+	/* if no matching mbus code is found, use the one from the default mode */
+	fmt->format.code =3D ox05b1s_find_code(sensor->model, fmt->format.code);
+	mode =3D ox05b1s_nearest_size(sensor->model->supported_modes, fmt);
+
+	fmt->format.width =3D mode->width;
+	fmt->format.height =3D mode->height;
+	fmt->format.field =3D V4L2_FIELD_NONE;
+
+	format =3D v4l2_subdev_state_get_format(state, 0);
+	*format =3D fmt->format;
+	if (fmt->which =3D=3D V4L2_SUBDEV_FORMAT_TRY)
+		return 0;
+
+	sensor->mode =3D mode;
+
+	/* update controls that depend on current mode */
+	ox05b1s_update_controls(sensor);
+
+	dev_dbg(dev, "Set mode index=3D%d, %d x %d, code=3D0x%x\n", sensor->mode-=
>index,
+		fmt->format.width, fmt->format.height, fmt->format.code);
+
+	return 0;
+}
+
+static u8 ox05b1s_code2dt(const u32 code)
+{
+	switch (code) {
+	case MEDIA_BUS_FMT_SGRBG10_1X10:
+		return MIPI_CSI2_DT_RAW10;
+	default:
+		return MIPI_CSI2_DT_RAW10;
+	}
+}
+
+static int ox05b1s_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad,
+				  struct v4l2_mbus_frame_desc *fd)
+{
+	struct i2c_client *client =3D v4l2_get_subdevdata(sd);
+	struct ox05b1s *sensor =3D client_to_ox05b1s(client);
+
+	fd->type =3D V4L2_MBUS_FRAME_DESC_TYPE_CSI2;
+	fd->num_entries =3D 1;
+
+	/* get sensor current code*/
+	mutex_lock(&sensor->lock);
+	fd->entry[0].pixelcode =3D sensor->mode->code;
+	mutex_unlock(&sensor->lock);
+
+	fd->entry[0].bus.csi2.vc =3D 0;
+	fd->entry[0].bus.csi2.dt =3D ox05b1s_code2dt(fd->entry[0].pixelcode);
+
+	return 0;
+}
+
+static int ox05b1s_get_selection(struct v4l2_subdev *sd,
+				 struct v4l2_subdev_state *sd_state,
+				 struct v4l2_subdev_selection *sel)
+{
+	struct i2c_client *client =3D v4l2_get_subdevdata(sd);
+	struct ox05b1s *sensor =3D client_to_ox05b1s(client);
+
+	switch (sel->target) {
+	case V4L2_SEL_TGT_NATIVE_SIZE:
+	case V4L2_SEL_TGT_CROP_BOUNDS:
+		sel->r.top =3D 0;
+		sel->r.left =3D 0;
+		sel->r.width =3D sensor->model->native_width;
+		sel->r.height =3D sensor->model->native_height;
+		return 0;
+	case V4L2_SEL_TGT_CROP:
+	case V4L2_SEL_TGT_CROP_DEFAULT:
+		sel->r.top =3D sensor->model->active_top;
+		sel->r.left =3D sensor->model->active_left;
+		sel->r.width =3D sensor->model->active_width;
+		sel->r.height =3D sensor->model->active_height;
+		return 0;
+	}
+
+	return -EINVAL;
+}
+
+static const struct v4l2_subdev_video_ops ox05b1s_subdev_video_ops =3D {
+	.s_stream =3D ox05b1s_s_stream,
+};
+
+static const struct v4l2_subdev_pad_ops ox05b1s_subdev_pad_ops =3D {
+	.set_fmt		=3D ox05b1s_set_fmt,
+	.get_fmt		=3D v4l2_subdev_get_fmt,
+	.get_frame_desc		=3D ox05b1s_get_frame_desc,
+	.enum_mbus_code		=3D ox05b1s_enum_mbus_code,
+	.enum_frame_size	=3D ox05b1s_enum_frame_size,
+	.get_selection		=3D ox05b1s_get_selection,
+};
+
+static const struct v4l2_subdev_ops ox05b1s_subdev_ops =3D {
+	.video =3D &ox05b1s_subdev_video_ops,
+	.pad   =3D &ox05b1s_subdev_pad_ops,
+};
+
+static const struct v4l2_subdev_internal_ops ox05b1s_internal_ops =3D {
+	.init_state =3D ox05b1s_init_state,
+};
+
+static void ox05b1s_get_gpios(struct ox05b1s *sensor)
+{
+	struct device *dev =3D &sensor->i2c_client->dev;
+
+	sensor->rst_gpio =3D devm_gpiod_get_optional(dev, "reset",
+						   GPIOD_OUT_HIGH);
+	if (IS_ERR(sensor->rst_gpio))
+		dev_warn(dev, "No sensor reset pin available");
+}
+
+static int ox05b1s_get_regulators(struct ox05b1s *sensor)
+{
+	struct device *dev =3D &sensor->i2c_client->dev;
+	unsigned int i;
+
+	for (i =3D 0; i < OX05B1S_NUM_SUPPLIES; i++)
+		sensor->supplies[i].supply =3D ox05b1s_supply_name[i];
+
+	return devm_regulator_bulk_get(dev, OX05B1S_NUM_SUPPLIES, sensor->supplie=
s);
+}
+
+static int ox05b1s_read_chip_id(struct ox05b1s *sensor)
+{
+	struct device *dev =3D &sensor->i2c_client->dev;
+	u64 chip_id =3D 0;
+	char *camera_name;
+	int ret =3D 0;
+
+	ret =3D cci_read(sensor->regmap, OX05B1S_REG_CHIP_ID, &chip_id, NULL);
+	if (ret) {
+		dev_err(dev, "Camera chip_id read error\n");
+		return -ENODEV;
+	}
+
+	switch (chip_id) {
+	case 0x580542:
+		camera_name =3D "ox05b1s";
+		break;
+	default:
+		camera_name =3D "unknown";
+		break;
+	}
+
+	if (chip_id =3D=3D sensor->model->chip_id) {
+		dev_dbg(dev, "Camera %s detected, chip_id=3D%llx\n", camera_name, chip_i=
d);
+	} else {
+		dev_err(dev, "Detected %s camera (chip_id=3D%llx), but expected %s (chip=
_id=3D%x)\n",
+			camera_name, chip_id, sensor->model->name, sensor->model->chip_id);
+		ret =3D -ENODEV;
+	}
+
+	return ret;
+}
+
+static int ox05b1s_probe(struct i2c_client *client)
+{
+	int retval;
+	struct device *dev =3D &client->dev;
+	struct v4l2_subdev *sd;
+	struct ox05b1s *sensor;
+
+	sensor =3D devm_kzalloc(dev, sizeof(*sensor), GFP_KERNEL);
+	if (!sensor)
+		return -ENOMEM;
+
+	sensor->regmap =3D devm_cci_regmap_init_i2c(client, 16);
+	if (IS_ERR(sensor->regmap))
+		return PTR_ERR(sensor->regmap);
+
+	sensor->i2c_client =3D client;
+
+	sensor->model =3D of_device_get_match_data(dev);
+
+	ox05b1s_get_gpios(sensor);
+
+	/* Get system clock, xvclk */
+	sensor->sensor_clk =3D devm_clk_get(dev, NULL);
+	if (IS_ERR(sensor->sensor_clk))
+		return dev_err_probe(dev, PTR_ERR(sensor->sensor_clk),
+				     "Failed to get xvclk\n");
+
+	retval =3D ox05b1s_get_regulators(sensor);
+	if (retval)
+		return dev_err_probe(dev, retval, "Failed to get regulators\n");
+
+	sd =3D &sensor->subdev;
+	v4l2_i2c_subdev_init(sd, client, &ox05b1s_subdev_ops);
+	sd->internal_ops =3D &ox05b1s_internal_ops;
+	sd->flags |=3D V4L2_SUBDEV_FL_HAS_DEVNODE;
+	sd->dev =3D &client->dev;
+	sd->entity.function =3D MEDIA_ENT_F_CAM_SENSOR;
+	sensor->pads[OX05B1S_SENS_PAD_SOURCE].flags =3D MEDIA_PAD_FL_SOURCE;
+	retval =3D media_entity_pads_init(&sd->entity, OX05B1S_SENS_PADS_NUM,
+					sensor->pads);
+	if (retval)
+		goto probe_out;
+
+	mutex_init(&sensor->lock);
+
+	retval =3D ox05b1s_init_controls(sensor);
+	if (retval)
+		goto probe_err_entity_cleanup;
+
+	/* power on manually */
+	retval =3D ox05b1s_power_on(sensor);
+	if (retval) {
+		dev_err(dev, "Failed to power on\n");
+		goto probe_err_free_ctrls;
+	}
+
+	pm_runtime_set_active(dev);
+	pm_runtime_get_noresume(dev);
+	pm_runtime_enable(dev);
+
+	retval =3D ox05b1s_read_chip_id(sensor);
+	if (retval)
+		goto probe_err_pm_runtime;
+
+	v4l2_i2c_subdev_set_name(sd, client, sensor->model->name, NULL);
+
+	/* Centrally managed subdev active state */
+	sd->state_lock =3D &sensor->lock;
+	retval =3D v4l2_subdev_init_finalize(sd);
+	if (retval < 0) {
+		dev_err(dev, "Subdev init error: %d\n", retval);
+		goto probe_err_pm_runtime;
+	}
+
+	retval =3D v4l2_async_register_subdev_sensor(sd);
+	if (retval < 0) {
+		dev_err(&client->dev, "Async register failed, ret=3D%d\n", retval);
+		goto probe_err_subdev_cleanup;
+	}
+
+	sensor->mode =3D &sensor->model->supported_modes[0];
+	ox05b1s_update_controls(sensor);
+
+	pm_runtime_set_autosuspend_delay(dev, 1000);
+	pm_runtime_use_autosuspend(dev);
+	pm_runtime_put_autosuspend(dev);
+
+	return 0;
+
+probe_err_subdev_cleanup:
+	v4l2_subdev_cleanup(sd);
+probe_err_pm_runtime:
+	pm_runtime_put_noidle(dev);
+	pm_runtime_disable(dev);
+	ox05b1s_runtime_suspend(dev);
+probe_err_free_ctrls:
+	v4l2_ctrl_handler_free(&sensor->ctrls.handler);
+probe_err_entity_cleanup:
+	media_entity_cleanup(&sd->entity);
+probe_out:
+	return retval;
+}
+
+static void ox05b1s_remove(struct i2c_client *client)
+{
+	struct v4l2_subdev *sd =3D i2c_get_clientdata(client);
+	struct ox05b1s *sensor =3D client_to_ox05b1s(client);
+	struct device *dev =3D &client->dev;
+
+	pm_runtime_disable(dev);
+	if (!pm_runtime_status_suspended(dev))
+		ox05b1s_runtime_suspend(dev);
+	pm_runtime_set_suspended(dev);
+	v4l2_async_unregister_subdev(sd);
+	v4l2_subdev_cleanup(sd);
+	media_entity_cleanup(&sd->entity);
+	v4l2_ctrl_handler_free(&sensor->ctrls.handler);
+	mutex_destroy(&sensor->lock);
+}
+
+static DEFINE_RUNTIME_DEV_PM_OPS(ox05b1s_pm_ops, ox05b1s_runtime_suspend,
+				 ox05b1s_runtime_resume, NULL);
+
+static const struct ox05b1s_plat_data ox05b1s_data =3D {
+	.name			=3D "ox05b1s",
+	.chip_id		=3D 0x580542,
+	.native_width		=3D 2608, /* 8 dummy + 2592 active pixels + 8 dummy */
+	.native_height		=3D 1960, /* 8 dummy + 1944 active lines + 8 dummy */
+	.active_top		=3D 8,
+	.active_left		=3D 8,
+	.active_width		=3D 2592,
+	.active_height		=3D 1944,
+	.supported_modes	=3D ox05b1s_supported_modes,
+	.default_mode_index	=3D 0,
+	.supported_codes	=3D ox05b1s_supported_codes,
+};
+
+static const struct of_device_id ox05b1s_of_match[] =3D {
+	{
+		.compatible =3D "ovti,ox05b1s",
+		.data =3D &ox05b1s_data,
+	},
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, ox05b1s_of_match);
+
+static struct i2c_driver ox05b1s_i2c_driver =3D {
+	.driver =3D {
+		.name  =3D "ox05b1s",
+		.pm =3D pm_ptr(&ox05b1s_pm_ops),
+		.of_match_table	=3D ox05b1s_of_match,
+	},
+	.probe	=3D ox05b1s_probe,
+	.remove =3D ox05b1s_remove,
+};
+
+module_i2c_driver(ox05b1s_i2c_driver);
+MODULE_DESCRIPTION("Omnivision OX05B1S MIPI Camera Subdev Driver");
+MODULE_AUTHOR("Mirela Rabulea <mirela.rabulea@nxp.com>");
+MODULE_LICENSE("GPL");
diff --git a/drivers/media/i2c/ox05b1s/ox05b1s_modes.c b/drivers/media/i2c/=
ox05b1s/ox05b1s_modes.c
new file mode 100644
index 000000000000..1f3b822d4482
--- /dev/null
+++ b/drivers/media/i2c/ox05b1s/ox05b1s_modes.c
@@ -0,0 +1,63 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Register configurations for all sensor supported modes
+ * Copyright (C) 2024, NXP
+ * Copyright (C) 2024, Omnivision
+ * Copyright (C) 2024, Verisilicon
+ *
+ */
+
+#include "ox05b1s.h"
+
+/*
+ * Register configuration for Omnivision OX05B1S raw camera
+ * 2592X1944_30FPS_FULL_RGBIr 2592 1944
+ */
+struct ox05b1s_reg ovx5b_init_setting_2592x1944[] =3D {
+	{ 0x0107, 0x01 },
+	{ 0x0307, 0x02 },
+	{ 0x034a, 0x05 },
+	{ 0x040b, 0x5c },
+	{ 0x040c, 0xcd },
+	{ 0x3009, 0x2e },
+	{ 0x3219, 0x08 },
+	{ 0x3684, 0x6d },
+	{ 0x3685, 0x6d },
+	{ 0x3686, 0x6d },
+	{ 0x3687, 0x6d },
+	{ 0x368c, 0x07 },
+	{ 0x368d, 0x07 },
+	{ 0x368e, 0x07 },
+	{ 0x368f, 0x00 },
+	{ 0x3690, 0x04 },
+	{ 0x3691, 0x04 },
+	{ 0x3692, 0x04 },
+	{ 0x3693, 0x04 },
+	{ 0x3698, 0x00 },
+	{ 0x36a0, 0x05 },
+	{ 0x36a2, 0x16 },
+	{ 0x36a3, 0x03 },
+	{ 0x36a4, 0x07 },
+	{ 0x36a5, 0x24 },
+	{ 0x36e3, 0x09 },
+	{ 0x3702, 0x0a },
+	{ 0x3821, 0x04 }, /* mirror */
+	{ 0x3822, 0x10 },
+	{ 0x382b, 0x03 },
+	{ 0x3866, 0x10 },
+	{ 0x386c, 0x46 },
+	{ 0x386d, 0x08 },
+	{ 0x386e, 0x7b },
+	{ 0x4802, 0x00 },
+	{ 0x481b, 0x3c },
+	{ 0x4837, 0x19 },
+	{ /* sentinel*/ },
+};
+
+struct ox05b1s_reglist ox05b1s_reglist_2592x1944[] =3D {
+	{
+		.regs =3D ovx5b_init_setting_2592x1944
+	}, {
+		/* sentinel */
+	}
+};
--=20
2.25.1
From nobody Wed Feb 19 02:15:01 2025
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 (mail-am0eur02on2082.outbound.protection.outlook.com [40.107.247.82])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id D9F344C98;
	Fri, 24 Jan 2025 00:13:32 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
 arc=fail smtp.client-ip=40.107.247.82
ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1737677614; cv=fail;
 b=qELske1efUB7XfZmtFrgLmvV3hy4nBPqUEvNFgIyn5wBOJY3J8ehtHNrU30tYqc5WhUWH+nJ4fAStq14ua4Am/79tAbvBzfmB9Y6pzFukr96HJDRtv+dbZvcRt7tkAMwE/Fk45+BxF4qzCBg6s0CluER9WmsagpXhju9quxoL1I=
ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1737677614; c=relaxed/simple;
	bh=y4ay53V7ha6hW2fmwNhDsT0mkVXGmOkjX0Qeaj4ybu8=;
	h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:
	 Content-Type:MIME-Version;
 b=McHpgMuKVAuJL8lsE4FpkCBAe5q/JlA5UQ0et4G9/AlaY9zZcZIYvs6Izk+W1BisR3OaBdDBBN/FlzpoRrvUgqiBlRGtdemUWzzu3gjlVZldZl+O22ZgcAvVXfxZ7pFGsHV3Y1IsfR/HyWKJXmSvE/EzlkTHB03q35Ek9bIxm7A=
ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
 dmarc=pass (p=none dis=none) header.from=nxp.com;
 spf=pass smtp.mailfrom=nxp.com;
 dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com
 header.b=TyZV51rw; arc=fail smtp.client-ip=40.107.247.82
Authentication-Results: smtp.subspace.kernel.org;
 dmarc=pass (p=none dis=none) header.from=nxp.com
Authentication-Results: smtp.subspace.kernel.org;
 spf=pass smtp.mailfrom=nxp.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com
 header.b="TyZV51rw"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=JSXdeQLAf1vcSmWpjUldncM2XSvex5DmYF1L62ePhZCwSkpHQoT2slXhr7mfBQLXTIKNHoPb845gFgkpdQV49KcV1xiwPCx2nrxG3PGmFUu1akFPyhWjmW9yMFBSTPuRAwhE/2sQnho/Qw0HEl0yqaDAGOH0/71y7Em83iHLzouk2q9bWbXHXlaTTmpVWubYobkXb3mtWy1pWiR0GlciJorh0Bns3OesYnUL7gm9A323axx1jZMdP8ul3HwDwZjHA9dlXcLIDWYBHPZlxJm0yGOb6qZGBaD9PH8zmBfhHHnAxybsIrjCnA/ZPd51K1MoCkK3GevGh7Q9jzbBLnl/KQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=3AVBtVjIaieNMTZHVdzTsb5Uc5jYgAJkLC9bT5xdVdc=;
 b=FzgRoGDJbOhMMUMzbyQDWOsWwi84PFDL0Xn9C0e1fGSedv98cU7tJdTwIHEDQC8iFN/px6ya2lcqNYOJYxJbt1ydyPg7XH6MOrre7Z0s4r8mtL7XMw1+kpiJfmBrc70heTfDwyKGxQc5zB9tygP6tcE5AKJ5BqJ/taEhOlgJuI6YzpWsV8BHXJHym1rkFAYe8S768o6Ve6ghCcI6LV6lQt1+joR363NqZjCTYkZShKEFCYa6x3WweGCmsBnEMV/APaiN37MEy2pwbxa9v5fVJLet3UunSctqcIOE1/XYl54Ytg8krjkwCogTnFkKc4GkK6atp6mHtoLreEXFfNdCRQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass
 header.d=nxp.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=3AVBtVjIaieNMTZHVdzTsb5Uc5jYgAJkLC9bT5xdVdc=;
 b=TyZV51rwOO/I7jBaCCCsOzRHHCIy+zBoqfFfYtIpRw/42P9TSIomPne3Y5aioxy2LuAcJPY4GZXFqMaHaBF5yGYxNzkM5XMJmALpenMfuyd+/6nQgSB88VKs807IIgsYThEvkg+KTx750+X4cjsmx6XRl+q1grwuBSKUMs8rZCj06Db77Zze50xkhXh1vkpD+DYSovfNBjD4PeR0KyIewKSOoVbL5stIJA3GFIMjpjCm5mXsMT7UjtyLjmFNtOsugG2z8sEFUjlDnY1QOltkuFXrbtAkWbVDAmUTszwiPXRg/vnU3d+obJkxwUqTfGrlX9Y9/PRnhygn/2KxvAmmZQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=nxp.com;
Received: from PAXPR04MB9231.eurprd04.prod.outlook.com (2603:10a6:102:2bb::10)
 by PAXPR04MB9201.eurprd04.prod.outlook.com (2603:10a6:102:232::13) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8377.18; Fri, 24 Jan
 2025 00:13:26 +0000
Received: from PAXPR04MB9231.eurprd04.prod.outlook.com
 ([fe80::766c:5fb5:2049:dd01]) by PAXPR04MB9231.eurprd04.prod.outlook.com
 ([fe80::766c:5fb5:2049:dd01%4]) with mapi id 15.20.8377.009; Fri, 24 Jan 2025
 00:13:26 +0000
From: Mirela Rabulea <mirela.rabulea@nxp.com>
To: mchehab@kernel.org,
	sakari.ailus@linux.intel.com,
	hverkuil-cisco@xs4all.nl,
	laurent.pinchart+renesas@ideasonboard.com,
	robh@kernel.org,
	krzk+dt@kernel.org,
	bryan.odonoghue@linaro.org,
	laurentiu.palcu@nxp.com,
	robert.chiras@nxp.com
Cc: linux-media@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	LnxRevLi@nxp.com,
	kieran.bingham@ideasonboard.com,
	hdegoede@redhat.com,
	dave.stevenson@raspberrypi.com,
	mike.rudenko@gmail.com,
	alain.volmat@foss.st.com,
	devicetree@vger.kernel.org,
	conor+dt@kernel.org,
	alexander.stein@ew.tq-group.com,
	umang.jain@ideasonboard.com,
	zhi.mao@mediatek.com,
	festevam@denx.de,
	julien.vuillaumier@nxp.com,
	alice.yuan@nxp.com
Subject: [PATCH v3 3/4] MAINTAINERS: Add entry for OX05B1S sensor driver
Date: Fri, 24 Jan 2025 02:12:42 +0200
Message-Id: <20250124001243.446511-4-mirela.rabulea@nxp.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20250124001243.446511-1-mirela.rabulea@nxp.com>
References: <20250124001243.446511-1-mirela.rabulea@nxp.com>
Content-Transfer-Encoding: quoted-printable
X-ClientProxiedBy: VI1P191CA0005.EURP191.PROD.OUTLOOK.COM
 (2603:10a6:800:1ba::12) To PAXPR04MB9231.eurprd04.prod.outlook.com
 (2603:10a6:102:2bb::10)
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PAXPR04MB9231:EE_|PAXPR04MB9201:EE_
X-MS-Office365-Filtering-Correlation-Id: 1c45500f-e636-4cf2-4e5b-08dd3c0bec24
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: 
	BCL:0;ARA:13230040|376014|52116014|7416014|366016|1800799024|38350700014;
X-Microsoft-Antispam-Message-Info: 
	=?us-ascii?Q?ToqUESPkBiA3sHl/qkmc5RVfNbVcRGzWBp9UJn88ZNRLatPvFl9g7nXjG5Ei?=
 =?us-ascii?Q?A575cswKs+I2ArEmZvHRnA0y+R0eb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R6pL7EIwpIkjD+?=
 =?us-ascii?Q?U+EbM4mQWUZWchWuLq/pbrzWnaA2YsSbtXNhjgRwvlDThfZbHdNYdyQpjhvF?=
 =?us-ascii?Q?oYzHLgcd5+NSD/rAkj/nZ0J9tbtG6vaX8SNpp4rj2wU/6/EUzi/cOtBWRiE8?=
 =?us-ascii?Q?ImPtjizyqSDaePoYnDJqMqyYJdxPzrmoGr7Zm2cNtMoFJSB9GbFuXJtJl5pv?=
 =?us-ascii?Q?sSMHMqOqUdkyGMG8Fb/6BwD8DbN0QNixVoRrXFEfNNA2rawijMQiPz2In/Bs?=
 =?us-ascii?Q?8eSiwQb2DgrTQAWG7OR6iSj/O02cctEI2uNZ1Kqjaols2baDq6cKahdWU4ow?=
 =?us-ascii?Q?Q2I//Vs4DV4Pl0PK5iP44/0VccpntwtUv8DRfCsrq/6R1iaB98w4GuSdylCa?=
 =?us-ascii?Q?8OqhbGUlXkQ3DWQUlW26dAWnefVWYgA1gkSrF3Ky60RsvfNPBSbrDEAQgh5X?=
 =?us-ascii?Q?vWngN4zdt/vEo5x3eSbzy/kAFVhhwJ2oo5sAr/w1BZmsZ8T43VEXJW7W3ckd?=
 =?us-ascii?Q?U7IAYKlCJvUU+HzzkSogErZFb/tkhE7x?=
X-Forefront-Antispam-Report: 
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9231.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(52116014)(7416014)(366016)(1800799024)(38350700014);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: 
	=?us-ascii?Q?t3RW+RakNA0jJamak9etOcqM95HlD0C5SCfXLYbMh1MnkfSI0/BNpuwPGS9a?=
 =?us-ascii?Q?pvc56koICAv1CgZwqa0GiCEy7AoDIQUuujadQrCmqok58Ogn3srLYCj7ioi3?=
 =?us-ascii?Q?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jApVMxIWRv0DgscqgwzRvT04qjIIkUfXyj2Yj+EAFv9zRt6EKR?=
 =?us-ascii?Q?gZRfqhqyux0EJudnhhv+O2LxIIjhopb3432ZzuVImhP0Bt33QEy3716Lbbip?=
 =?us-ascii?Q?h7l3+LuvILMkRIuXJZawT/gUc/9rGsJFsvUyJTOb//vMaZ5mbaV60a4lkJ8a?=
 =?us-ascii?Q?+ZTLsqbAUebkb6lStdMhWF3K6oOs0GAQW1Bpw+u0+6nyPDKEmUd8a+tHhSaa?=
 =?us-ascii?Q?GhgjLeZ3km7aQYwTRmsQXZ6ijXDkMNeUN4sNmEKLuM8Gs1vrQSZlcKctpf5A?=
 =?us-ascii?Q?2GEFXyu3Ku5dcTN3mcCVjsAo5zxabn6oSuobAO/OkMT37g+f4X1xkNsTQm34?=
 =?us-ascii?Q?+lRMz7cjMWoFpyidYXC4XDULJOOVIAPPkMXDdrYh3LkdRyPHH5YqutWvvHN8?=
 =?us-ascii?Q?oxBrJ/zkuXoNfszK76uoy0L30icLnWnq40z34TTyhaiLajHw2Lz2oImcQGR7?=
 =?us-ascii?Q?ni06Hty6MnUZTpgnI+QnTnAZ7DIGRDRgXcBHKTtOJpjGhuQam+3MDXSpNvdz?=
 =?us-ascii?Q?RbphWyZ38w97gph4m3szUhvlnotow+LzbhM5uHMcgEuHSljDNwQ3FY/7PXkY?=
 =?us-ascii?Q?/St8ymFxcsUbjsraxaPdSXPRqfkA+UpHvJaa+BXsr38K2ct+Bw5Azu2If7iv?=
 =?us-ascii?Q?4g=3D=3D?=
X-OriginatorOrg: nxp.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 
 1c45500f-e636-4cf2-4e5b-08dd3c0bec24
X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9231.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2025 00:13:26.2610
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 
 /cI4K3+w9oyLjVBww08MyZS1n2y65HXjDzYrZO+jmCS3xYXdxSi4pIMUtwtJe8wnkdDqsXng26l/+JcKjyqAKA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9201
Content-Type: text/plain; charset="utf-8"

Add maintainer for Omnivision OX05B1S sensor driver.

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
---

Changes in v3:
	None

Changes in v2:
	None

 MAINTAINERS | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 6ff0565d874f..fca5f3f2f2bf 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -17570,6 +17570,16 @@ S:	Maintained
 T:	git git://linuxtv.org/media.git
 F:	drivers/media/i2c/ov9734.c
=20
+OMNIVISION OX05B1S SENSOR DRIVER
+M:	Mirela Rabulea <mirela.rabulea@nxp.com>
+R:	Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
+R:	Robert Chiras <robert.chiras@oss.nxp.com>
+L:	linux-media@vger.kernel.org
+S:	Maintained
+T:	git git://linuxtv.org/media_tree.git
+F:	Documentation/devicetree/bindings/media/i2c/ovti,ox05b1s.yaml
+F:	drivers/media/i2c/ox05b1s/*
+
 ONBOARD USB HUB DRIVER
 M:	Matthias Kaehlcke <mka@chromium.org>
 L:	linux-usb@vger.kernel.org
--=20
2.25.1
From nobody Wed Feb 19 02:15:01 2025
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 (mail-am0eur02on2082.outbound.protection.outlook.com [40.107.247.82])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 10BEC18651;
	Fri, 24 Jan 2025 00:13:35 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
 arc=fail smtp.client-ip=40.107.247.82
ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1737677617; cv=fail;
 b=KFEmlP43iK4H9zrb128287HSvrjtA1gXqU9RQrUpW/7RXcI1dhB/XI7KvN+MYqEh8RXITjFG9gV7F0Nwq1e2pynvot83PD13yT62EBYL0lRRvkXXVTbiEAmbOtqmU3HUTXL9iL44F7z5gn7/dadyPCHen+rHTz6RDmjlP2WOObM=
ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1737677617; c=relaxed/simple;
	bh=ixkt+8sXxE3w9xsRCgrPBeZkHB8W3DzJUh3crXIA8to=;
	h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:
	 Content-Type:MIME-Version;
 b=O43G7G93H4ff4gaBab/dZPaxasspf5rQmUG110JXn7qvK5xI205s3sZ2GyHluP8e+TzglsmHp54fQnbEXMg9gSa/dCxgOQLSGrLMjyTZ+MK970IfH41Evw4zQlAgzPtp4rp+LCt6QNlWcX2SJ1HA/4kpXkz/QwRwKo7i+agH40Q=
ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
 dmarc=pass (p=none dis=none) header.from=nxp.com;
 spf=pass smtp.mailfrom=nxp.com;
 dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com
 header.b=Th86hTtz; arc=fail smtp.client-ip=40.107.247.82
Authentication-Results: smtp.subspace.kernel.org;
 dmarc=pass (p=none dis=none) header.from=nxp.com
Authentication-Results: smtp.subspace.kernel.org;
 spf=pass smtp.mailfrom=nxp.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com
 header.b="Th86hTtz"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=lVdHkKoTVXQ4HsqGKzFQeJc5wOs9R9lD9TtuYya055AQGic1z4fzibf1+8SQ+srikQf0Uw4+prEzv76omBOtdsEC7Jk7g2YHkwf/C+xpVBWbTPCnwuFGkvXQFO3w0SAtxOirDWkG2htQqmfk0Fjfn1cjsbXnnpFGheI6o+qdUAakQIybx+L++4lg2tvw4yY99W44x/lvZtPbC69AhLt4GRGyyvarHFWH+NLW+ICYbHfKgcRb95uaP7l/QYIOK6aTO6b2EyA/llKJs7SZhEp6aOHN/UXP52inkuF3m84rVAlMw8HSRKlehopwdQkwUOhD5kc4ZuY7KVARU7G988p4IQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=N+niRkNmkffIPERobfLG9P08PEMAUZdx53ZDP0Z3vug=;
 b=c+ZCsKs5l6apsDUz8d6gRJqX5MAbkkrkaQ7+BBfxp6MDxtNdNtgDE4TbseYzjZTE83fOowy2GD9S8cXB0ZOY3U0wtdHpFGlo5gBoJyyQ4BMOGPihN4sHuRnWr95cInCAZw85vpSClVChZyFxIrvKVdYLIEZ/DLrrD1yHkPal3UdYF/kXUa2/TQ8PZUc/mdOyzLpRkaTY17tasxHQ5kqPCHx+KNhFSU/NDqFTu6vPORDFXm+oeNM4ZpgC6GTm5Y+nXxbVE0osr/RVyWzCU/qzfzCyF65elfmwfK/Tj9a3VWXCtn4Fv3idydHUTu8uZnNIaoJJyCTZ7oO7fV35EhG2uA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass
 header.d=nxp.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=N+niRkNmkffIPERobfLG9P08PEMAUZdx53ZDP0Z3vug=;
 b=Th86hTtzILUs6fT6u2ywD85KCcKlZo+pxQlx6t7d4/Aa1V2n7mA7yZO75jr31JQeO7tNpQXLnpUHSLVInWCF6sJyIKNWfXpAU5lP1s8ypZ/Km9G6KnpEaTa1COvP89TT1y3n9aFNjkLyDbe14/SBxGbyPyAjVFrMr3HjWD5WZFmipyDuX0q0L4CvA54oAA9rMbKfCfvvUFe6PZJwdnszQWM1HgK2XrtTxty3IiGCQa6PfBE916zjPCQQE+quhySt7qItiyYZ/eb3mS+Yf5I5WjOoDGa09w7vNJtdWddisB7Yc6ftmNOjRxl9k1dBB6otyM2UDaD/o4SWgiXa6E83wg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=nxp.com;
Received: from PAXPR04MB9231.eurprd04.prod.outlook.com (2603:10a6:102:2bb::10)
 by PAXPR04MB9201.eurprd04.prod.outlook.com (2603:10a6:102:232::13) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8377.18; Fri, 24 Jan
 2025 00:13:27 +0000
Received: from PAXPR04MB9231.eurprd04.prod.outlook.com
 ([fe80::766c:5fb5:2049:dd01]) by PAXPR04MB9231.eurprd04.prod.outlook.com
 ([fe80::766c:5fb5:2049:dd01%4]) with mapi id 15.20.8377.009; Fri, 24 Jan 2025
 00:13:27 +0000
From: Mirela Rabulea <mirela.rabulea@nxp.com>
To: mchehab@kernel.org,
	sakari.ailus@linux.intel.com,
	hverkuil-cisco@xs4all.nl,
	laurent.pinchart+renesas@ideasonboard.com,
	robh@kernel.org,
	krzk+dt@kernel.org,
	bryan.odonoghue@linaro.org,
	laurentiu.palcu@nxp.com,
	robert.chiras@nxp.com
Cc: linux-media@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	LnxRevLi@nxp.com,
	kieran.bingham@ideasonboard.com,
	hdegoede@redhat.com,
	dave.stevenson@raspberrypi.com,
	mike.rudenko@gmail.com,
	alain.volmat@foss.st.com,
	devicetree@vger.kernel.org,
	conor+dt@kernel.org,
	alexander.stein@ew.tq-group.com,
	umang.jain@ideasonboard.com,
	zhi.mao@mediatek.com,
	festevam@denx.de,
	julien.vuillaumier@nxp.com,
	alice.yuan@nxp.com
Subject: [PATCH v3 4/4] media: ox05b1s: Add support for Omnivision OS08A20 raw
 sensor
Date: Fri, 24 Jan 2025 02:12:43 +0200
Message-Id: <20250124001243.446511-5-mirela.rabulea@nxp.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20250124001243.446511-1-mirela.rabulea@nxp.com>
References: <20250124001243.446511-1-mirela.rabulea@nxp.com>
Content-Transfer-Encoding: quoted-printable
X-ClientProxiedBy: VI1P191CA0005.EURP191.PROD.OUTLOOK.COM
 (2603:10a6:800:1ba::12) To PAXPR04MB9231.eurprd04.prod.outlook.com
 (2603:10a6:102:2bb::10)
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PAXPR04MB9231:EE_|PAXPR04MB9201:EE_
X-MS-Office365-Filtering-Correlation-Id: 61709228-886e-424d-2591-08dd3c0bed0e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: 
	BCL:0;ARA:13230040|376014|52116014|7416014|366016|1800799024|38350700014;
X-Microsoft-Antispam-Message-Info: 
	=?us-ascii?Q?jswp8meDrFln5mfkHQCRrehAcUyOladREdnkuV42npSvXhioLxfdEXEgjPw6?=
 =?us-ascii?Q?vzIsLIgG4id8XEOtjmDck+vfJmvQelQ8VoAmaMiaXLsbtd/n0z2IjFRLCbr9?=
 =?us-ascii?Q?awSrJtr6TNr8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v+fqv7rWoTZitse8rUXPtBrpmpGO4dcBV?=
 =?us-ascii?Q?8NOp23881Cj3P8HTK8J3aGeNe1hTY82PZhUjMLkQNr5j0J/NeUadT2Xtpz0Z?=
 =?us-ascii?Q?tO7Co1yaT3mMtnfQyj2I8vUZWrDjibx/itr4FYzJF3cnz8UyRMGWKw11QFX+?=
 =?us-ascii?Q?OUxfQ3CJOaTV/asRnq5uUDxaPXt2z8R0hprEFG5gznQCp3eCCBgvFJwM5KwF?=
 =?us-ascii?Q?xmSpU7wDkSVuP/1NuPoQZwPtwd9TAZDH5zLruQqTXLmcBExuRXSZ2OnMSUfq?=
 =?us-ascii?Q?cZXH/aZpEKASRAAlkZMXxqQgsERrDOlTAP5h3QEXzTiDWEC6Q5T1Honcf9zl?=
 =?us-ascii?Q?yCP/FnlPsFUEBeoFrnOrg/qwbKXmpDlVJvlZrGaIHx5hWj8aVz30leteifXf?=
 =?us-ascii?Q?5iW2HxC69hpDr0rrkXW0tg4e7f4o7xYkVWBNJRayXbmh833n5TopGwBbIpMV?=
 =?us-ascii?Q?6DTg74WT88y4vjLuRMh084d5GOoPdfty?=
X-Forefront-Antispam-Report: 
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9231.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(52116014)(7416014)(366016)(1800799024)(38350700014);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: 
	=?us-ascii?Q?/q+Pbzj9lonSZ+pMqfdI9HXhZPxQ8szisklHs6IMaBbAlyqEWFPENNfLUh46?=
 =?us-ascii?Q?Fn2QO7MmYbml46/sTQOhnvzp3afXxsZgjGHZUZxvU1dajHPetAS4NPrONwo5?=
 =?us-ascii?Q?nL+877l492LDCB6cpmQgOW/i2QPU1LkTnePyL78lDQvAxBHhka+NQYOrmOv8?=
 =?us-ascii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Djb9vRx6xFUAKomJ5BI4Cmff7jXPMkEUAMGhn6Q/PjwycOThNRgVtLxG8Pc?=
 =?us-ascii?Q?83fZ2DknTHKj5TmbfJDGl/PazipZclq6mN+XNmkWqV4izbO7U7W1C1jEbTpi?=
 =?us-ascii?Q?remj3/QTY+O/iCuG+F2wapV8mi6ltfkZtm+sNgwji41iWryvxM7pCQPSjRwm?=
 =?us-ascii?Q?3GbZl/pdN4aeiUjAcpq+eeiUccxJcMxS1waGlI/ab78qy6TdtYdo4KKTjPHd?=
 =?us-ascii?Q?xC0UAgps/SgC+HIQlv81cWbvtCLDngs2CZxp3mnlDSrcW6WLbHINUDQMCeaW?=
 =?us-ascii?Q?CG7dfgBz6M4AKEzqTDzgeGYw7V92hF9HFp0+fAfHCgQoX6zHoSTeKwW0OsbX?=
 =?us-ascii?Q?ITcYmt05ouSnM27bUcJc7UbwpvpoC5Db78/9T/eGQHbY4Fv7ZUCY9S93D68r?=
 =?us-ascii?Q?XkO41DYZspBCu1uTpKkni04CCHN5hRNHB2AJaHcVpEU0GmvfU1H2OTkXeBW+?=
 =?us-ascii?Q?FQ9/Fdd20J+Z6mtJKDjYQSqhXmL0ixUs9HY2Zo46ZJMLt5sN6aI6He16WGV9?=
 =?us-ascii?Q?F18ATz5GFDagiI8ZemNa1Q9/wks3+pyrwQaInE/YTVDyvf+RqxcjJvaE0LSe?=
 =?us-ascii?Q?4Q=3D=3D?=
X-OriginatorOrg: nxp.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 
 61709228-886e-424d-2591-08dd3c0bed0e
X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9231.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2025 00:13:27.7610
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 
 lZ6ZFLVEf3zAAOrhc4D7TY7Gobilf4Z60qWNhDbK6bnDdiFLQfpy8VtWj8VbjkghYUmoPxmvi8Tbp1yWm5v6uA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9201
Content-Type: text/plain; charset="utf-8"

This is an 8 megapixel raw10/raw12 sensor with HDR capabilities.
HDR mode control is supported, with one HDR mode: staggered HDR
with 2 exposures on separate virtual channels. However, for now,
only one exposure (VC 0) is accessible via get_frame_desc.

Supported resolutions:
   - 1920 x 1080 @ 60fps (SBGGR10, no HDR)
   - 1920 x 1080 @ 30fps (SBGGR10, HDR)
   - 3840 x 2160 @ 30fps (SBGGR12, no HDR)
   - 3840 x 2160 @ 15fps (SBGGR12, HDR)
   - 3840 x 2160 @ 30fps (SBGGR10, no HDR)
   - 3840 x 2160 @ 15fps (SBGGR10, HDR)

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
---

Changes in v3:
	Don't hardcode timing registers: remove timing registers x_output_size/y_o=
utput_size from register configuration list, add them to ox05b1s_apply_curr=
ent_mode
	Remove HTS,VTS from register config list as they are written by HBLANK and=
 VBLANK controls through __v4l2_ctrl_handler_setup
	Use const for os08a20_supported_modes=09
	os08a20 register config cleaning (remove all registers that were at their =
default value, and more, keep only what seems mandatory to be able to strea=
m)
	Let the 4k 10bit mode by default without hdr, all 3 modes are now by defau=
lt without hdr, staggered hdr may be enabled via v4l2-ctl for any of them.
	Separate the 10/12 bit register settings into separate lists: os08a20_init=
_setting_10bit, os08a20_init_setting_12bit
	Update commit description: rearrange supported resolutions and remove 1 du=
plicate line, state HDR limitation
	Increase a bit the default vts for 1080p, to get exactly 60fps, it was 62.=
61
	Use regmap_update_bits() directly and remove ox05b1s_regmap_update_bits()

Changes in v2:
	Add spaces inside brackets, wrap lines to 80
	Remove some redundant initialization
	Use a loop in os08a20_enable_staggered_hdr/os08a20_disable_staggered_hdr, =
for that, add a register settings array for HDR enabling/disabling
	Make "sizes" a pointer
	Remove mode headers, add supported modes in the dedicated c file, ox05b1s_=
modes.c=20
	Refactor register lists, for os08a20 use a common list for all modes, and =
also specific lists per mode

 drivers/media/i2c/ox05b1s/ox05b1s.h       |   4 +
 drivers/media/i2c/ox05b1s/ox05b1s_mipi.c  | 184 ++++++++++++++++++++++
 drivers/media/i2c/ox05b1s/ox05b1s_modes.c |  96 +++++++++++
 3 files changed, 284 insertions(+)

diff --git a/drivers/media/i2c/ox05b1s/ox05b1s.h b/drivers/media/i2c/ox05b1=
s/ox05b1s.h
index a893c65894f3..5115060e23cb 100644
--- a/drivers/media/i2c/ox05b1s/ox05b1s.h
+++ b/drivers/media/i2c/ox05b1s/ox05b1s.h
@@ -17,6 +17,10 @@ struct ox05b1s_reglist {
 	struct ox05b1s_reg *regs;
 };
=20
+extern struct ox05b1s_reglist os08a20_reglist_4k_10b[];
+extern struct ox05b1s_reglist os08a20_reglist_4k_12b[];
+extern struct ox05b1s_reglist os08a20_reglist_1080p_10b[];
+
 extern struct ox05b1s_reglist ox05b1s_reglist_2592x1944[];
=20
 #endif /* OX05B1S_H */
diff --git a/drivers/media/i2c/ox05b1s/ox05b1s_mipi.c b/drivers/media/i2c/o=
x05b1s/ox05b1s_mipi.c
index aeea7caa6a15..7dcba5235926 100644
--- a/drivers/media/i2c/ox05b1s/ox05b1s_mipi.c
+++ b/drivers/media/i2c/ox05b1s/ox05b1s_mipi.c
@@ -40,6 +40,7 @@ struct ox05b1s_sizes {
 	const struct v4l2_area *sizes;
 };
=20
+struct ox05b1s;
 struct ox05b1s_plat_data {
 	char				name[20];
 	u32				chip_id;
@@ -52,6 +53,9 @@ struct ox05b1s_plat_data {
 	const struct ox05b1s_mode	*supported_modes;
 	u32				default_mode_index;
 	const struct ox05b1s_sizes	*supported_codes;
+	const char * const		*hdr_modes;
+	u32				hdr_modes_count;
+	int (*set_hdr_mode)(struct ox05b1s *sensor, u32 hdr_mode);
 };
=20
 struct ox05b1s_ctrls {
@@ -62,6 +66,7 @@ struct ox05b1s_ctrls {
 	struct v4l2_ctrl *vblank;
 	struct v4l2_ctrl *gain;
 	struct v4l2_ctrl *exposure;
+	struct v4l2_ctrl *hdr_mode;
 };
=20
 struct ox05b1s_mode {
@@ -102,6 +107,85 @@ struct ox05b1s {
 	struct ox05b1s_ctrls ctrls;
 };
=20
+static const struct ox05b1s_mode os08a20_supported_modes[] =3D {
+	{
+		/* 1080p BGGR10, no hdr, 60fps */
+		.index		=3D 0,
+		.width		=3D 1920,
+		.height		=3D 1080,
+		.code		=3D MEDIA_BUS_FMT_SBGGR10_1X10,
+		.bpp		=3D 10,
+		.vts		=3D 0x4d3,
+		.hts		=3D 0x790,
+		.exp		=3D 0x4d3 - 8,
+		.h_bin		=3D true,
+		.fps		=3D 60,
+		.reg_data	=3D os08a20_reglist_1080p_10b,
+	}, {
+		/* 4k BGGR10, no hdr, 30fps */
+		.index		=3D 1,
+		.width		=3D 3840,
+		.height		=3D 2160,
+		.code		=3D MEDIA_BUS_FMT_SBGGR10_1X10,
+		.bpp		=3D 10,
+		.vts		=3D 0x90a,
+		.hts		=3D 0x818,
+		.exp		=3D 0x90a - 8,
+		.h_bin		=3D false,
+		.fps		=3D 30,
+		.reg_data	=3D os08a20_reglist_4k_10b,
+	}, {
+		/* 4k BGGR12, no hdr, 30fps */
+		.index		=3D 2,
+		.width		=3D 3840,
+		.height		=3D 2160,
+		.code		=3D MEDIA_BUS_FMT_SBGGR12_1X12,
+		.bpp		=3D 12,
+		.vts		=3D 0x8f0,
+		.hts		=3D 0x814,
+		.exp		=3D 0x8f0 - 8,
+		.h_bin		=3D false,
+		.fps		=3D 30,
+		.reg_data	=3D os08a20_reglist_4k_12b,
+	}, {
+		/* sentinel */
+	}
+};
+
+/* keep in sync with os08a20_supported_modes */
+static const struct v4l2_area os08a20_sbggr10_sizes[] =3D {
+	{
+		.width =3D 1920,
+		.height =3D 1080,
+	}, {
+		.width =3D 3840,
+		.height =3D 2160,
+	}, {
+		/* sentinel */
+	}
+};
+
+static const struct v4l2_area os08a20_sbggr12_sizes[] =3D {
+	{
+		.width =3D 3840,
+		.height =3D 2160,
+	}, {
+		/* sentinel */
+	}
+};
+
+static const struct ox05b1s_sizes os08a20_supported_codes[] =3D {
+	{
+		.code =3D MEDIA_BUS_FMT_SBGGR10_1X10,
+		.sizes =3D os08a20_sbggr10_sizes,
+	}, {
+		.code =3D MEDIA_BUS_FMT_SBGGR12_1X12,
+		.sizes =3D os08a20_sbggr12_sizes,
+	}, {
+		/* sentinel */
+	}
+};
+
 static const struct ox05b1s_mode ox05b1s_supported_modes[] =3D {
 	{
 		.index		=3D 0,
@@ -228,6 +312,62 @@ static int ox05b1s_write_reg_array(struct ox05b1s *sen=
sor,
 	return 0;
 }
=20
+static const char * const os08a20_hdr_modes[] =3D {
+	"NO HDR",		/* No HDR, single exposure */
+	"HDR Staggered",	/* Staggered HDR mode, 2 exposures on separate virtual c=
hannels */
+};
+
+static struct ox05b1s_reg os08a20_init_setting_hdr_en[] =3D {
+	{ 0x3661, BIT(0) }, /* CORE1[0] STG_HDR_ALIGN_EN */
+	{ 0x3821, BIT(5) }, /* FORMAT2[5] STG_HDR_EN */
+	{ 0x4813, BIT(3) }, /* MIPI_CTRL_13[3] */
+	{ 0x486e, BIT(2) }, /* MIPI_CTRL_6E[2] MIPI_VC_ENABLE */
+};
+
+static int os08a20_enable_staggered_hdr(struct ox05b1s *sensor)
+{
+	int ret;
+
+	for (int i =3D 0; i < ARRAY_SIZE(os08a20_init_setting_hdr_en); i++) {
+		ret =3D regmap_update_bits(sensor->regmap,
+					 os08a20_init_setting_hdr_en[i].addr,
+					 os08a20_init_setting_hdr_en[i].data,
+					 os08a20_init_setting_hdr_en[i].data);
+		if (ret)
+			return ret;
+	}
+
+	return 0;
+}
+
+static int os08a20_disable_staggered_hdr(struct ox05b1s *sensor)
+{
+	int ret;
+
+	for (int i =3D 0; i < ARRAY_SIZE(os08a20_init_setting_hdr_en); i++) {
+		ret =3D regmap_update_bits(sensor->regmap,
+					 os08a20_init_setting_hdr_en[i].addr,
+					 os08a20_init_setting_hdr_en[i].data,
+					 0);
+		if (ret)
+			return ret;
+	}
+
+	return 0;
+}
+
+static int os08a20_set_hdr_mode(struct ox05b1s *sensor, u32 hdr_mode)
+{
+	switch (hdr_mode) {
+	case 0:
+		return os08a20_disable_staggered_hdr(sensor);
+	case 1:
+		return os08a20_enable_staggered_hdr(sensor);
+	default:
+		return -EINVAL;
+	}
+}
+
 static inline struct v4l2_subdev *ctrl_to_sd(struct v4l2_ctrl *ctrl)
 {
 	return &container_of(ctrl->handler, struct ox05b1s,
@@ -270,6 +410,12 @@ static int ox05b1s_s_ctrl(struct v4l2_ctrl *ctrl)
 		ret =3D cci_write(sensor->regmap, OX05B1S_REG_EXPOSURE,
 				ctrl->val, NULL);
 		break;
+	case V4L2_CID_HDR_SENSOR_MODE:
+		if (sensor->model->set_hdr_mode)
+			ret =3D sensor->model->set_hdr_mode(sensor, ctrl->val);
+		else
+			ret =3D -EINVAL;
+		break;
 	default:
 		ret =3D -EINVAL;
 		break;
@@ -332,6 +478,13 @@ static int ox05b1s_init_controls(struct ox05b1s *senso=
r)
 	ctrls->gain =3D v4l2_ctrl_new_std(hdl, ops, V4L2_CID_ANALOGUE_GAIN,
 					0, 0xFFFF, 1, 0x80);
=20
+	if (sensor->model->hdr_modes)
+		ctrls->hdr_mode =3D v4l2_ctrl_new_std_menu_items(hdl, ops, V4L2_CID_HDR_=
SENSOR_MODE,
+							       sensor->model->hdr_modes_count - 1,
+								0, 0, sensor->model->hdr_modes);
+	else
+		ctrls->hdr_mode =3D NULL;
+
 	if (hdl->error) {
 		ret =3D hdl->error;
 		goto free_ctrls;
@@ -648,7 +801,10 @@ static u8 ox05b1s_code2dt(const u32 code)
 {
 	switch (code) {
 	case MEDIA_BUS_FMT_SGRBG10_1X10:
+	case MEDIA_BUS_FMT_SBGGR10_1X10:
 		return MIPI_CSI2_DT_RAW10;
+	case MEDIA_BUS_FMT_SBGGR12_1X12:
+		return MIPI_CSI2_DT_RAW12;
 	default:
 		return MIPI_CSI2_DT_RAW10;
 	}
@@ -758,6 +914,9 @@ static int ox05b1s_read_chip_id(struct ox05b1s *sensor)
 	}
=20
 	switch (chip_id) {
+	case 0x530841:
+		camera_name =3D "os08a20";
+		break;
 	case 0x580542:
 		camera_name =3D "ox05b1s";
 		break;
@@ -900,6 +1059,24 @@ static void ox05b1s_remove(struct i2c_client *client)
 static DEFINE_RUNTIME_DEV_PM_OPS(ox05b1s_pm_ops, ox05b1s_runtime_suspend,
 				 ox05b1s_runtime_resume, NULL);
=20
+static const struct ox05b1s_plat_data os08a20_data =3D {
+	.name			=3D "os08a20",
+	.chip_id		=3D 0x530841,
+	.native_width		=3D 3872, /* 16 dummy + 3840 active pixels + 16 dummy */
+	.native_height		=3D 2192, /* 16 dummy + 2160 active lines + 16 dummy */
+	.active_top		=3D 16,
+	.active_left		=3D 16,
+	.active_width		=3D 3840,
+	.active_height		=3D 2160,
+	.supported_modes	=3D os08a20_supported_modes,
+	.default_mode_index	=3D 0,
+	.supported_codes	=3D os08a20_supported_codes,
+	.hdr_modes		=3D os08a20_hdr_modes,
+	.hdr_modes_count	=3D ARRAY_SIZE(os08a20_hdr_modes),
+	.set_hdr_mode		=3D os08a20_set_hdr_mode,
+
+};
+
 static const struct ox05b1s_plat_data ox05b1s_data =3D {
 	.name			=3D "ox05b1s",
 	.chip_id		=3D 0x580542,
@@ -912,9 +1089,16 @@ static const struct ox05b1s_plat_data ox05b1s_data =
=3D {
 	.supported_modes	=3D ox05b1s_supported_modes,
 	.default_mode_index	=3D 0,
 	.supported_codes	=3D ox05b1s_supported_codes,
+	.hdr_modes		=3D NULL,
+	.hdr_modes_count	=3D 0,
+	.set_hdr_mode		=3D NULL,
 };
=20
 static const struct of_device_id ox05b1s_of_match[] =3D {
+	{
+		.compatible =3D "ovti,os08a20",
+		.data =3D &os08a20_data,
+	},
 	{
 		.compatible =3D "ovti,ox05b1s",
 		.data =3D &ox05b1s_data,
diff --git a/drivers/media/i2c/ox05b1s/ox05b1s_modes.c b/drivers/media/i2c/=
ox05b1s/ox05b1s_modes.c
index 1f3b822d4482..9cfc55f04a70 100644
--- a/drivers/media/i2c/ox05b1s/ox05b1s_modes.c
+++ b/drivers/media/i2c/ox05b1s/ox05b1s_modes.c
@@ -9,6 +9,102 @@
=20
 #include "ox05b1s.h"
=20
+/* Common register configuration for Omnivision OS08A20 raw camera */
+struct ox05b1s_reg os08a20_init_setting_common[] =3D {
+	{ 0x3605, 0x50 },
+	{ 0x3610, 0x39 },
+	{ 0x375e, 0x0b },
+	{ 0x5001, 0x42 },
+	{ 0x5005, 0x00 },
+	{ /* sentinel*/ },
+};
+
+/* Common register configuration for Omnivision OS08A20 10 bit */
+struct ox05b1s_reg os08a20_init_setting_10bit[] =3D {
+	{ 0x031e, 0x09 },
+	{ 0x3609, 0xb5 },
+	{ 0x3660, 0x43 },
+	{ 0x3706, 0x35 },
+	{ 0x370a, 0x00 },
+	{ 0x370b, 0x98 },
+	{ 0x3709, 0x49 },
+	{ /* sentinel*/ },
+};
+
+/* Common register configuration for Omnivision OS08A20 12 bit */
+struct ox05b1s_reg os08a20_init_setting_12bit[] =3D {
+	{ 0x031e, 0x0a },
+	{ 0x3609, 0xdb },
+	{ 0x3660, 0xd3 },
+	{ 0x3706, 0x6a },
+	{ 0x370a, 0x01 },
+	{ 0x370b, 0x30 },
+	{ 0x3709, 0x48 },
+	{ /* sentinel*/ },
+};
+
+/* Mode specific register configurations for Omnivision OS08A20 raw camera=
 */
+
+/* OS08A20 3840 x 2160 @30fps BGGR10 no more HDR */
+struct ox05b1s_reg os08a20_init_setting_4k_10b[] =3D {
+	{ 0x3821, 0x04 }, /* mirror */
+	{ 0x4837, 0x10 }, /* PCLK PERIOD */
+	{ /* sentinel*/ },
+};
+
+/* OS08A20 3840 x 2160 @30fps BGGR12 */
+struct ox05b1s_reg os08a20_init_setting_4k_12b[] =3D {
+	{ 0x3821, 0x04 }, /* mirror */
+	{ 0x4837, 0x10 }, /* PCLK PERIOD */
+	{ /* sentinel*/ },
+};
+
+/* OS08A20 1920 x 1080 @60fps BGGR10 */
+struct ox05b1s_reg os08a20_init_setting_1080p_10b[] =3D {
+	{ 0x3814, 0x03 }, /* X INC ODD */
+	{ 0x3816, 0x03 }, /* Y INC ODD */
+	{ 0x3820, 0x01 }, /* vertical bining */
+	{ 0x3821, 0x05 }, /* mirror, horizontal bining */
+	{ 0x4837, 0x16 }, /* PCLK PERIOD */
+	{ /* sentinel*/ },
+};
+
+struct ox05b1s_reglist os08a20_reglist_4k_10b[] =3D {
+	{
+		.regs =3D os08a20_init_setting_common
+	}, {
+		.regs =3D os08a20_init_setting_10bit
+	}, {
+		.regs =3D os08a20_init_setting_4k_10b
+	}, {
+		/* sentinel */
+	}
+};
+
+struct ox05b1s_reglist os08a20_reglist_4k_12b[] =3D {
+	{
+		.regs =3D os08a20_init_setting_common
+	}, {
+		.regs =3D os08a20_init_setting_12bit
+	}, {
+		.regs =3D os08a20_init_setting_4k_12b
+	}, {
+		/* sentinel */
+	}
+};
+
+struct ox05b1s_reglist os08a20_reglist_1080p_10b[] =3D {
+	{
+		.regs =3D os08a20_init_setting_common
+	}, {
+		.regs =3D os08a20_init_setting_10bit
+	}, {
+		.regs =3D os08a20_init_setting_1080p_10b
+	}, {
+		/* sentinel */
+	}
+};
+
 /*
  * Register configuration for Omnivision OX05B1S raw camera
  * 2592X1944_30FPS_FULL_RGBIr 2592 1944
--=20
2.25.1