Skip to contentSkip to conversation

Pinefeat cef168 lens control board driver

PATCH In review Aliaksandr Smirnou 2 participants 4 messages Aug 22, 2025 – Aug 24, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v4 cover Pinefeat cef168 lens control board driver

This patch series adds support for the Pinefeat adapter, which interfaces Canon EF and EF-S lenses to non-Canon camera bodies. The cef168 circuit control board provides an I2C interface for electronic focus and aperture control. The driver integrates with the V4L2 sub-device API.

For more information about the product, see:
https://github.com/pinefeat/cef168

Changes in v4:
- removed driver mention from the hardware documentation;
- added named email in commit signed-off-by;
- added select CRC8 in Kconfig;
- removed header file;
- moved variable declaration at the beginning of the function;
- removed kerneldoc from structures;
- removed control id check as the core handles this for us;
- removed Power Management Runtime (pm_runtime_*) calls as redundant;
- reserved v4l2 controls in linux header file;

Link to v3: https://lore.kernel.org/all/[email protected]/

Patches:
dt-bindings: Pinefeat cef168 lens control board
media: i2c: Pinefeat cef168 lens control board driver

 .../bindings/media/i2c/pinefeat,cef168.yaml   |  47 +++
 .../devicetree/bindings/vendor-prefixes.yaml  |   2 +
 MAINTAINERS                                   |   7 +
 drivers/media/i2c/Kconfig                     |   9 +
 drivers/media/i2c/Makefile                    |   1 +
 drivers/media/i2c/cef168.c                    | 331 ++++++++++++++++++
 include/uapi/linux/v4l2-controls.h            |   6 +
 7 files changed, 403 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/pinefeat,cef168.yaml
 create mode 100644 drivers/media/i2c/cef168.c

base-commit: 2b38afce25c4e1b8f943ff4f0a2b51d6c40f2ed2

Signature · 1 line
2.34.1
#1 lore raw

PATCH v4 1/2 dt-bindings: Pinefeat cef168 lens control board

Add the Device Tree schema and examples for the Pinefeat cef168 lens control board. This board interfaces Canon EF & EF-S lenses with non-Canon camera bodies, enabling electronic control of focus and aperture via V4L2.

Power supply is derived from fixed supplies via connector or GPIO header. Therefore, the driver does not manage any regulator, so representing any supply in the binding is redundant.

---
 .../bindings/media/i2c/pinefeat,cef168.yaml   | 47 +++++++++++++++++++
 .../devicetree/bindings/vendor-prefixes.yaml  |  2 +
 MAINTAINERS                                   |  6 +++
 3 files changed, 55 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/pinefeat,cef168.yaml
Documentation/devicetree/bindings/media/i2c/pinefeat,cef168.yaml new file +47 -0
new file mode 100644
index 000000000000..1295b1f4edeb
@@ -0,0 +1,47 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (c) 2025 Pinefeat LLP
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/i2c/pinefeat,cef168.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Pinefeat cef168 lens driver
+
+maintainers:
+  - Aliaksandr Smirnou <[email protected]>
+
+description: |
+  Pinefeat produces an adapter designed to interface between
+  Canon EF & EF-S lenses and non-Canon camera bodies, incorporating
+  features for electronic focus and aperture adjustment. The cef168
+  circuit board, included with the adapter, provides a software
+  programming interface that allows control of lens focus and
+  aperture positions.
+
+properties:
+  compatible:
+    enum:
+      - pinefeat,cef168
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        camera-lens@d {
+            compatible = "pinefeat,cef168";
+            reg = <0x0d>;
+        };
+    };
+
+...
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
index 77160cd47f54..dab27f769b0a 100644
@@ -1195,6 +1195,8 @@ patternProperties:
     description: Picochip Ltd
   "^pine64,.*":
     description: Pine64
+  "^pinefeat,.*":
+    description: Pinefeat LLP
   "^pineriver,.*":
     description: Shenzhen PineRiver Designs Co., Ltd.
   "^pixcir,.*":
MAINTAINERS +6 -0
index fe168477caa4..811c6a150029 100644
@@ -19985,6 +19985,12 @@ S:	Supported
 F:	Documentation/devicetree/bindings/input/pine64,pinephone-keyboard.yaml
 F:	drivers/input/keyboard/pinephone-keyboard.c
 
+PINEFEAT CEF168 LENS DRIVER
+M:	Aliaksandr Smirnou <[email protected]>
+L:	[email protected]
+S:	Supported
+F:	Documentation/devicetree/bindings/media/i2c/pinefeat,cef168.yaml
+
 PLANTOWER PMS7003 AIR POLLUTION SENSOR DRIVER
 M:	Tomasz Duszynski <[email protected]>
 S:	Maintained
Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH v4 1/2] dt-bindings: Pinefeat cef168 lens control board

Quoted 10 lines · Aliaksandr Smirnou

Add the Device Tree schema and examples for the Pinefeat cef168 lens control board. This board interfaces Canon EF & EF-S lenses with non-Canon camera bodies, enabling electronic control of focus and aperture via V4L2.

Power supply is derived from fixed supplies via connector or GPIO header. Therefore, the driver does not manage any regulator, so representing any supply in the binding is redundant.

From/SoB mismatch.

Best regards,
Krzysztof

#3 lore raw

PATCH v4 2/2 media: i2c: Pinefeat cef168 lens control board driver

In reply to Aliaksandr Smirnou

Add support for the Pinefeat cef168 lens control board that provides electronic focus and aperture control for Canon EF & EF-S lenses on non-Canon camera bodies.

---
 MAINTAINERS                        |   1 +
 drivers/media/i2c/Kconfig          |   9 +
 drivers/media/i2c/Makefile         |   1 +
 drivers/media/i2c/cef168.c         | 331 +++++++++++++++++++++++++++++
 include/uapi/linux/v4l2-controls.h |   6 +
 5 files changed, 348 insertions(+)
 create mode 100644 drivers/media/i2c/cef168.c
MAINTAINERS +1 -0
index 811c6a150029..a531fb05faa4 100644
@@ -19990,6 +19990,7 @@ M:	Aliaksandr Smirnou <[email protected]>
 L:	[email protected]
 S:	Supported
 F:	Documentation/devicetree/bindings/media/i2c/pinefeat,cef168.yaml
+F:	drivers/media/i2c/cef168.c
 
 PLANTOWER PMS7003 AIR POLLUTION SENSOR DRIVER
 M:	Tomasz Duszynski <[email protected]>
drivers/media/i2c/Kconfig +9 -0
index 6237fe804a5c..df2b33f03ab7 100644
@@ -791,6 +791,15 @@ config VIDEO_AK7375
 	  capability. This is designed for linear control of
 	  voice coil motors, controlled via I2C serial interface.
 
+config VIDEO_CEF168
+	tristate "CEF168 lens control support"
+	select CRC8
+	help
+	  This is a driver for the CEF168 lens control board.
+	  The board provides an I2C interface for electronic focus
+	  and aperture control of EF and EF-S lenses. The driver
+	  integrates with the V4L2 sub-device API.
+
 config VIDEO_DW9714
 	tristate "DW9714 lens voice coil support"
 	depends on GPIOLIB
drivers/media/i2c/Makefile +1 -0
index 5873d29433ee..75a95f850f18 100644
@@ -25,6 +25,7 @@ obj-$(CONFIG_VIDEO_BT856) += bt856.o
 obj-$(CONFIG_VIDEO_BT866) += bt866.o
 obj-$(CONFIG_VIDEO_CCS) += ccs/
 obj-$(CONFIG_VIDEO_CCS_PLL) += ccs-pll.o
+obj-$(CONFIG_VIDEO_CEF168) += cef168.o
 obj-$(CONFIG_VIDEO_CS3308) += cs3308.o
 obj-$(CONFIG_VIDEO_CS5345) += cs5345.o
 obj-$(CONFIG_VIDEO_CS53L32A) += cs53l32a.o
drivers/media/i2c/cef168.c new file +331 -0

331 lines not on this page · raw message

include/uapi/linux/v4l2-controls.h +6 -0
index f836512e9deb..7d6d026ef2ea 100644
@@ -228,6 +228,12 @@ enum v4l2_colorfx {
  */
 #define V4L2_CID_USER_RKISP1_BASE		(V4L2_CID_USER_BASE + 0x1220)
 
+/*
+ * The base for Pinefeat CEF168 driver controls.
+ * We reserve 16 controls for this driver.
+ */
+#define V4L2_CID_USER_CEF168_BASE		(V4L2_CID_USER_BASE + 0x1230)
+
 /* MPEG-class control IDs */
 /* The MPEG controls are applicable to all codec controls
  * and the 'MPEG' part of the define is historical */
Signature · 1 line
2.34.1