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

Alexander Smirnov posted 2 patches 1 month, 3 weeks ago
There is a newer version of this series
[PATCH v2 1/2] dt-bindings: Pinefeat cef168 lens control board
Posted by Alexander Smirnov 1 month, 3 weeks ago
From: Aliaksandr Smirnou <support@pinefeat.co.uk>

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.

Signed-off-by: Aliaksandr Smirnou <support@pinefeat.co.uk>
---
 .../bindings/media/i2c/pinefeat,cef168.yaml   | 52 +++++++++++++++++++
 .../devicetree/bindings/vendor-prefixes.yaml  |  2 +
 MAINTAINERS                                   |  6 +++
 3 files changed, 60 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/pinefeat,cef168.yaml

diff --git a/Documentation/devicetree/bindings/media/i2c/pinefeat,cef168.yaml b/Documentation/devicetree/bindings/media/i2c/pinefeat,cef168.yaml
new file mode 100644
index 000000000000..3563fb1d46db
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/i2c/pinefeat,cef168.yaml
@@ -0,0 +1,52 @@
+# 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 <support@pinefeat.co.uk>
+
+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. This driver enables controlling the lens
+  focus and aperture via the V4L2 (Video4Linux2) API.
+
+properties:
+  compatible:
+    enum:
+      - pinefeat,cef168
+
+  reg:
+    maxItems: 1
+
+  vcc-supply:
+    description: VDD 3v3 power supply
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        camera-lens@d {
+            compatible = "pinefeat,cef168";
+            reg = <0x0d>;
+            vcc-supply = <&vdd_3v3_reg>;
+        };
+    };
+
+...
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml
index 77160cd47f54..dab27f769b0a 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -1195,6 +1195,8 @@ patternProperties:
     description: Picochip Ltd
   "^pine64,.*":
     description: Pine64
+  "^pinefeat,.*":
+    description: Pinefeat LLP
   "^pineriver,.*":
     description: Shenzhen PineRiver Designs Co., Ltd.
   "^pixcir,.*":
diff --git a/MAINTAINERS b/MAINTAINERS
index fe168477caa4..811c6a150029 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -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 <support@pinefeat.co.uk>
+L:	linux-media@vger.kernel.org
+S:	Supported
+F:	Documentation/devicetree/bindings/media/i2c/pinefeat,cef168.yaml
+
 PLANTOWER PMS7003 AIR POLLUTION SENSOR DRIVER
 M:	Tomasz Duszynski <tduszyns@gmail.com>
 S:	Maintained
-- 
2.34.1
Re: [PATCH v2 1/2] dt-bindings: Pinefeat cef168 lens control board
Posted by Krzysztof Kozlowski 1 month, 3 weeks ago
On Mon, Aug 11, 2025 at 10:31:01PM +0100, Alexander Smirnov wrote:
> From: Aliaksandr Smirnou <support@pinefeat.co.uk>
> 
> Add the Device Tree schema and examples for the Pinefeat cef168 lens
>  control board. This board interfaces Canon EF & EF-S lenses with

Also, some stray indent is here.

>  non-Canon camera bodies, enabling electronic control of focus and
>  aperture via V4L2.
> 
> Signed-off-by: Aliaksandr Smirnou <support@pinefeat.co.uk>

Best regards,
Krzysztof
Re: [PATCH v2 1/2] dt-bindings: Pinefeat cef168 lens control board
Posted by Krzysztof Kozlowski 1 month, 3 weeks ago
On 11/08/2025 23:31, Alexander Smirnov wrote:
> +

Subject: missing media prefix.

See also:
https://elixir.bootlin.com/linux/v6.7-rc8/source/Documentation/devicetree/bindings/submitting-patches.rst#L18


> +properties:
> +  compatible:
> +    enum:
> +      - pinefeat,cef168
> +
> +  reg:
> +    maxItems: 1
> +
> +  vcc-supply:
> +    description: VDD 3v3 power supply


Property says VCC, description says VDD, datasheet says 5V (not 3.3V).

I guess this should be for the 5V case, no? If that's true, then I think
that 5V pin is not a controllable supply ever, because this product is
purely for RPi which has 5V pins directly tied to main power supply.


Best regards,
Krzysztof
[PATCH v2 1/2] dt-bindings: Pinefeat cef168 lens control board
Posted by Aliaksandr Smirnou 1 month, 3 weeks ago
On Tue, 12 Aug 2025 09:13:22 +0200, Krzysztof Kozlowski wrote:
> Property says VCC, description says VDD, datasheet says 5V (not 3.3V).
>
> I guess this should be for the 5V case, no?

Thank you following up.

The 5V line is used exclusively to power the lens motor (through the
power switch). This 5V supply can come from the Raspberry Pi GPIO
header, a battery, or other sources. Importantly, this power source
is independent of the board’s MCU and its kernel driver.

Additionally, the board does not include any voltage regulators.
The MCU operates at 3.3V, which is supplied either via the CSI connector
or the serial connector directly from the Raspberry Pi GPIO 3.3V rail.
Therefore, the driver does not manage any regulator, which is why the
“vcc-supply” property was absent in the binding.

Would you like me to remove the “vcc-supply” property as it was
originally?
Re: [PATCH v2 1/2] dt-bindings: Pinefeat cef168 lens control board
Posted by Krzysztof Kozlowski 1 month, 3 weeks ago
On Tue, Aug 12, 2025 at 08:37:22PM +0100, Aliaksandr Smirnou wrote:
> On Tue, 12 Aug 2025 09:13:22 +0200, Krzysztof Kozlowski wrote:
> > Property says VCC, description says VDD, datasheet says 5V (not 3.3V).
> >
> > I guess this should be for the 5V case, no?
> 
> Thank you following up.
> 
> The 5V line is used exclusively to power the lens motor (through the
> power switch). This 5V supply can come from the Raspberry Pi GPIO
> header, a battery, or other sources. Importantly, this power source
> is independent of the board’s MCU and its kernel driver.

You describe here the entire board, not the MCU only or lens motor
only...

> 
> Additionally, the board does not include any voltage regulators.
> The MCU operates at 3.3V, which is supplied either via the CSI connector
> or the serial connector directly from the Raspberry Pi GPIO 3.3V rail.
> Therefore, the driver does not manage any regulator, which is why the
> “vcc-supply” property was absent in the binding.
> 
> Would you like me to remove the “vcc-supply” property as it was
> originally?

Can the board be used outside of above setup? I understand so far this
is only for Rpi where both above supplies - 3.3 V and 5 V - are coming
from the header pins, so supplies would be totally redundant.

Best regards,
Krzysztof
Re: [PATCH v2 1/2] dt-bindings: Pinefeat cef168 lens control board
Posted by Aliaksandr Smirnou 1 month, 3 weeks ago
On Thu, 14 Aug 2025 11:04:10 +0200, Krzysztof Kozlowski wrote:
> You describe here the entire board, not the MCU only or lens motor
> only...

Since you asked about 5 V, I was explaining that this power source is not
relevant for the driver.

> Can the board be used outside of above setup? I understand so far this
> is only for Rpi where both above supplies - 3.3 V and 5 V - are coming
> from the header pins, so supplies would be totally redundant.

There are several variants of the board, differing only in physical size
and type of CSI connector, targeting different cameras. The board should
be compatible with any single-board computer that uses a similar CSI
connector pinout and MIPI signal lane assignment. For example, the NVIDIA
Jetson series replicates the Raspberry Pi camera and GPIO header pinout.
So yes, the board can be used outside of a Raspberry Pi setup.

As noted above, these supplies are redundant and were not included in the
driver description. Given that, is it acceptable to remove the vcc-supply
property?
Re: [PATCH v2 1/2] dt-bindings: Pinefeat cef168 lens control board
Posted by Krzysztof Kozlowski 1 month, 2 weeks ago
On 14/08/2025 22:10, Aliaksandr Smirnou wrote:
> On Thu, 14 Aug 2025 11:04:10 +0200, Krzysztof Kozlowski wrote:
>> You describe here the entire board, not the MCU only or lens motor
>> only...
> 
> Since you asked about 5 V, I was explaining that this power source is not
> relevant for the driver.
> 
>> Can the board be used outside of above setup? I understand so far this
>> is only for Rpi where both above supplies - 3.3 V and 5 V - are coming
>> from the header pins, so supplies would be totally redundant.
> 
> There are several variants of the board, differing only in physical size
> and type of CSI connector, targeting different cameras. The board should
> be compatible with any single-board computer that uses a similar CSI
> connector pinout and MIPI signal lane assignment. For example, the NVIDIA
> Jetson series replicates the Raspberry Pi camera and GPIO header pinout.
> So yes, the board can be used outside of a Raspberry Pi setup.

If they replicate also power coming from the header and CSI line, then
it's fine, but if the do not, then you would need a controllable
regulator supply.

> 
> As noted above, these supplies are redundant and were not included in the
> driver description. Given that, is it acceptable to remove the vcc-supply
> property?

Yeah, for simplicity. Please mention this rationale in the commit msg -
power supply is derived from fixed supplies (connector/header on RPi),
so representing it is redundant.


Best regards,
Krzysztof