From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D4FFE35B642 for ; Fri, 6 Mar 2026 10:36:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772793399; cv=none; b=mafudG5Zscxdqu5UIMsXPsNvn1dXpdesAIZzMnNCFP39M3HVmVqVcODoanaXUGbVetEIcSqr6ml6sVf7WSe7tseE/kIWTGBbmw75PM/EiuezGT7zu3AyctJB2jm29r65WRjo7xEH9Z6IJ5Cs9ygmNPIElgHmP3NyrEXQMIFiHoI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772793399; c=relaxed/simple; bh=aaWtfuMIlwXcj8wRx+r/8nYmCfr9QmP6cTAQtbDeFr0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=jZgaTvwTU+4T3TKUCOA9KSmJ4JZCine6e4mh0T4fdk1XueaJY73fXq1Quh3oAteI0wmhdljmuhA44QdKSb7sBeT0vvpRk2X+WMzDe2o+4vb2I69LcAN7WLMQaNNcdJ/6Uvu2THIFdR4nJ4OucgXTQg08v4w22QSfmKU3ItGiQVA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=iaf2w4mh; arc=none smtp.client-ip=209.85.167.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iaf2w4mh" Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-5a12c19affeso2156773e87.1 for ; Fri, 06 Mar 2026 02:36:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772793396; x=1773398196; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=zJml/yLnnjSPJKQY6M87aIBCO5slyXTHcl3eiCEqAKo=; b=iaf2w4mhwsidB2Rl0k+o1Qu4n5Y6jdozW87OWU7ut0Hi1RObel7zpYAMgDrIuFojGC UV7JOoZ32pEIdecru5g6bix+Ig3DfEhnyonjU/xR3gvZnMcjye+G53xjGr8K8ZKdKTQF 426s3VungCSGv5mzjL2Uy0TRuEwQdHfHmqP80oUI46TI0Nji/AGjB3QsI3RMdjbpi4mn IrRKkKhJUbUhGq3wA0HyHnHAe1KBBJ0xvBQQ8p3Xi/547a++BafaaTVLe3JElG6Dqurb tEFdCT7gmGcLQNZ84ayaelljgyiQb+Mc0h1wvCps9NZp1uVjo0Sm6BYRApbyRKWLeRtx eeyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772793396; x=1773398196; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=zJml/yLnnjSPJKQY6M87aIBCO5slyXTHcl3eiCEqAKo=; b=ID8jA17eZdxAKxNBeNRvw98bGnKaDvHR/fnkhOdHZAEX2md6LqJDA31n6g1RecRp3x 6LUuc1Dx1WlmKf5yt7rapLrvk/pmazS+1DnwxV3eAot3C7y1z2Hgg0T1MRkzy5sGYTmy 79bsfq5XMUo+rnJALoKzuttShHbVA2fYr8VSiLiYc/GHEQZQGVOCgieG7rXL2bVemeKb 2fYry7uzc8z0J2C9YoSQwEjTzPHuUnwH6EioW7mxbaV60DOaojD09bpygKFDzQk5e+Kn I04qrsazOpTy3OFRle9Z91NAw+jniSdx1yMWYEcMympcLxAXTu5RMmQ99An7dZgGshdQ Y8Aw== X-Forwarded-Encrypted: i=1; AJvYcCVx+mUrwn3mQdC2620hjiRx0gynlhvBwsqDEiM/ZLHG29UQskIHnCbk1ZmYxy2cj079r7S9npm7bTaq@vger.kernel.org X-Gm-Message-State: AOJu0YyZDkZvC6tTzAzyMdADy1A1xrZrvoQzlDCInDPjgj3kfyvHTtt0 wA1Yt4DvuyYAkpPcCfiEth65/K/c9i6gF3AATm/U37qZL5UDfsdGGr+r X-Gm-Gg: ATEYQzyt/XY9wvp6234aTkAXfjSOgs/iSVhEVxNtGJlr4eQ7NnZxuSLWtE7JohtChID rGyo3IjDf1qbUWzOndDbM+wkptKDGtLVO2gXrZQDLSW+R2fBnCh/SDnQYBh9OVTiccERlJSSypt n2LxbmJ3nWTrNJ3fYt6EcP6QBDW4Z+Tb7DgT+GLcX6ul7KOKnKP750fjgr2GQwi2/p5j6hCu00q 0d3juWq88Nj2u8HDBc3R3wUWH1ERlJtY47KuAH33iUK6n81VgytlZWKgziWTx6vDS6nGAZhsQEa UQLiNQq2Yox4+LNu6gZWl1xCLKtq5ESXh/5KV0CEUOAWiiy1jtfWRrrQs6CaycftW2rK08sMOcz r5VSVQotXLRxQUy69W6uh53nX6fG3D1fz5hP3aoMqB/g4ipTZ0qpOKrvkB/8pf8oiDpeyKVpMRG L2INbi47WBt2wPgtkgihXspswLnmVXAnxWES0m41s= X-Received: by 2002:ac2:5694:0:b0:5a1:1de6:bc66 with SMTP id 2adb3069b0e04-5a13c93d9e3mr562049e87.18.1772793395649; Fri, 06 Mar 2026 02:36:35 -0800 (PST) Received: from gentoo.sknt.ru ([95.161.221.172]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5a13d03da54sm258243e87.40.2026.03.06.02.36.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Mar 2026 02:36:33 -0800 (PST) From: Alexander Shiyan To: linux-media@vger.kernel.org Cc: Isaac Scott , Dave Stevenson , Dongcheng Yan , devicetree@vger.kernel.org, Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sakari Ailus , Hans Verkuil , Hans de Goede , Vladimir Zapolskiy , Mehdi Djait , Laurent Pinchart , Benjamin Mugnier , Bryan O'Donoghue , Jingjing Xiong , Svyatoslav Ryhel , Alexander Shiyan Subject: [RFC PATCH v3 0/2] media: i2c: Add onsemi AR0234 camera sensor driver Date: Fri, 6 Mar 2026 13:36:12 +0300 Message-ID: <20260306103614.3208182-1-eagle.alexander923@gmail.com> X-Mailer: git-send-email 2.52.0 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This series adds a driver for the onsemi AR0234 CMOS image sensor. The AR0234 is a 1/2.6-inch global-shutter sensor with a 1940x1220 pixel array, capable of 1920x1200 resolution at up to 120 fps. It supports MIPI CSI-2 output with 1 to 4 data lanes, raw Bayer (8/10-bit) and monochrome formats, as well as DPCM 10->8 compression. The driver has been tested with 2 and 4 lanes on an ARM64 Rockchip RK3568 platform with a 27 MHz external clock. Both 8-bit and 10-bit raw Bayer modes are functional. Notes: - 1-lane mode is currently disabled; attempts to use it produced no valid image. Further investigation is needed. - The driver uses a private streaming flag to protect cropping changes during streaming. Is this the recommended approach, or should we rely solely on the subdev state? - The DPCM (10->8 compression) mode is included in the code but could not be tested due to lack of suitable hardware; any testing help would be appreciated. Changes since v2: - Added devicetree binding documentation for the onsemi AR0234 sensor. - Added support for 8-bit raw Bayer output (verified working). - Added DPCM 10->8 compression mode (untested, included for completeness). - Reworked mode handling: each mode now specifies input/output bpp, DPCM flag, MIPI data type, and link frequency index. - Reworked link frequency handling: the driver now accepts any valid link frequencies from the device tree. It expects two frequencies - one for 8-bit mode and one for 10-bit mode - but does not enforce a fixed set; frequencies are validated by attempting PLL calculation. This makes the driver compatible with a wider range of system configurations. - Updated ar0234_calculate_pll() to use a temporary structure and update cached PLL only on success. Changes since v1: - Improved error handling: use cci_write() with &ret chaining for sequential register writes, as suggested by Isaac Scott. - Refactored format and cropping support: Replaced static format list with dynamic cropping rectangle (struct v4l2_rect crop). Implemented get_selection and set_selection for V4L2_SEL_TGT_CROP, allowing runtime selection of the active sensor area. - Migrated to modern streaming model: replaced s_stream with enable_streams/disable_streams using v4l2_subdev_s_stream_helper. - Corrected blanking constants: replaced ambiguous AR0234_HBLANK_DEF with AR0234_LINE_LENGTH_PCK_MIN; updated min/max ranges. - Added ACPI match table (untested). - Style fixes. Any further comments or test results would be greatly appreciated. Alexander Shiyan (2): dt-bindings: media: i2c: Add onsemi AR0234 image sensor binding media: i2c: Add onsemi AR0234 image sensor driver .../bindings/media/i2c/onnn,ar0234.yaml | 109 ++ drivers/media/i2c/Kconfig | 12 + drivers/media/i2c/Makefile | 1 + drivers/media/i2c/ar0234.c | 1309 +++++++++++++++++ 4 files changed, 1431 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/i2c/onnn,ar0234.yaml create mode 100644 drivers/media/i2c/ar0234.c -- 2.52.0