Skip to contentSkip to conversation

Document bindings for camera modules and associated flash devices

RFC Superseded Sakari Ailus 6 participants 11 messages May 2, 2017 – May 5, 2017 2 messages not in the archive

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Document bindings for camera modules and associated flash devices

Hi folks,

This RFC patchset documents properties commonly required by camera modules and associated camera flash devices.

The camera module is essentially a package consisting of an image sensor, a lens, possibly a voice coil to move the lens and a number of other things that at least the drivers need not to know of. All the devices in a camera module are declared separately in the system and as such the fact that they come in a single package isn't generally very useful to driver software.

I'm sending the set as RFC as there's no driver implementation, and a dependency to the V4L2 async changes:

<URL:http://www.spinics.net/lists/linux-media/msg114915.html>

Signature · 7 lines
Regards,
Sakari

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw

RFC 1/3 dt: bindings: Add a binding for flash devices associated to a sensor

In reply to a message not in the archive

Camera flash drivers (and LEDs) are separate from the sensor devices in DT. In order to make an association between the two, provide the association information to the software.

---
 Documentation/devicetree/bindings/media/video-interfaces.txt | 11 +++++++++++
 1 file changed, 11 insertions(+)
Documentation/devicetree/bindings/media/video-interfaces.txt +11 -0
index 9cd2a36..d6c62bc 100644
@@ -67,6 +67,17 @@ are required in a relevant parent node:
 		    identifier, should be 1.
  - #size-cells    : should be zero.
 
+
+Optional properties
+-------------------
+
+- flash: An array of phandles that refer to the flash light sources
+  related to an image sensor. These could be e.g. LEDs. In case the LED
+  driver drives more than a single LED, then the phandles here refer to
+  the child nodes of the LED driver describing individual LEDs. Only
+  valid for device nodes that are related to an image sensor.
+
+
 Optional endpoint properties
 ----------------------------
 
Signature · 6 lines
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#6 lore raw

RFC 2/3 dt: bindings: Add lens-focus binding for image sensors

In reply to a message not in the archive

The lens-focus property contains a phandle to the lens voice coil driver that is associated to the sensor; typically both are contained in the same camera module.

---
 Documentation/devicetree/bindings/media/video-interfaces.txt | 3 +++
 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/media/video-interfaces.txt +3 -0
index d6c62bc..e52aefc 100644
@@ -77,6 +77,9 @@ Optional properties
   the child nodes of the LED driver describing individual LEDs. Only
   valid for device nodes that are related to an image sensor.
 
+- lens-focus: A phandle to the node of the lens. Only valid for device
+  nodes that are related to an image sensor.
+
 
 Optional endpoint properties
 ----------------------------
Signature · 6 lines
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#8 lore raw

RFC 3/3 dt: bindings: Add a binding for referencing EEPROM from camera sensors

In reply to a message not in the archive

Many camera sensor devices contain EEPROM chips that describe the properties of a given unit --- the data is specific to a given unit can thus is not stored e.g. in user space or the driver.

Some sensors embed the EEPROM chip and it can be accessed through the sensor's I²C interface. This property is to be used for devices where the EEPROM chip is accessed through a different I²C address than the sensor.

The intent is to later provide this information to the user space.

---
 Documentation/devicetree/bindings/media/video-interfaces.txt | 3 +++
 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/media/video-interfaces.txt +3 -0
index e52aefc..9bd2005 100644
@@ -80,6 +80,9 @@ Optional properties
 - lens-focus: A phandle to the node of the lens. Only valid for device
   nodes that are related to an image sensor.
 
+- eeprom: A phandle to the node of the related EEPROM. Only valid for
+  device nodes that are related to an image sensor.
+
 
 Optional endpoint properties
 ----------------------------
Signature · 6 lines
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reviewed-by on v1 1/3
#3 lore raw

Re: [RFC 1/3] dt: bindings: Add a binding for flash devices associated to a sensor

In reply to Sakari Ailus

Hi Sakari,

Quoted 16 lines · Sakari Ailus

Camera flash drivers (and LEDs) are separate from the sensor devices in DT. In order to make an association between the two, provide the association information to the software.

---
 Documentation/devicetree/bindings/media/video-interfaces.txt | 11 +++++++++++
 1 file changed, 11 insertions(+)
Documentation/devicetree/bindings/media/video-interfaces.txt +0 -0
index 9cd2a36..d6c62bc 100644
@@ -67,6 +67,17 @@ are required in a relevant parent node:
 		    identifier, should be 1.
  - #size-cells    : should be zero.

Documentation/devicetree/bindings/media/video-interfaces.txt are required in a relevant parent node: · line 78

Quoted 10 lines
Documentation/devicetree/bindings/media/video-interfaces.txt +9 -0
 
+
+Optional properties
+-------------------
+
+- flash: An array of phandles that refer to the flash light sources
+  related to an image sensor. These could be e.g. LEDs. In case the LED
+  driver drives more than a single LED, then the phandles here refer to
+  the child nodes of the LED driver describing individual LEDs. Only
+  valid for device nodes that are related to an image sensor.

s/driver/controller/g - DT describes HW. Otherwise

-- Sebastian

#7 lore raw

Re: [RFC 2/3] dt: bindings: Add lens-focus binding for image sensors

In reply to Sakari Ailus

Hi,

Quoted 14 lines · Sakari Ailus

The lens-focus property contains a phandle to the lens voice coil driver that is associated to the sensor; typically both are contained in the same camera module.

---
 Documentation/devicetree/bindings/media/video-interfaces.txt | 3 +++
 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/media/video-interfaces.txt +0 -0
index d6c62bc..e52aefc 100644

Documentation/devicetree/bindings/media/video-interfaces.txt Optional properties · line 81

Quoted 5 lines
Documentation/devicetree/bindings/media/video-interfaces.txt +2 -0
@@ -77,6 +77,9 @@ Optional properties
   the child nodes of the LED driver describing individual LEDs. Only
   valid for device nodes that are related to an image sensor.
 
+- lens-focus: A phandle to the node of the lens. Only valid for device
+  nodes that are related to an image sensor.

s/of the lens/of the focus lens controller/

Also I wonder about the second sentence. That sentence could basically be added to every property, so can't we just drop it?

-- Sebastian

#10 lore raw

Re: [RFC 3/3] dt: bindings: Add a binding for referencing EEPROM from camera sensors

In reply to a message not in the archive

Hi,

Quoted 20 lines · Sakari Ailus

Many camera sensor devices contain EEPROM chips that describe the properties of a given unit --- the data is specific to a given unit can thus is not stored e.g. in user space or the driver.

Some sensors embed the EEPROM chip and it can be accessed through the sensor's I²C interface. This property is to be used for devices where the EEPROM chip is accessed through a different I²C address than the sensor.

The intent is to later provide this information to the user space.

---
 Documentation/devicetree/bindings/media/video-interfaces.txt | 3 +++
 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/media/video-interfaces.txt +0 -0
index e52aefc..9bd2005 100644

Documentation/devicetree/bindings/media/video-interfaces.txt Optional properties · line 84

Quoted 5 lines
Documentation/devicetree/bindings/media/video-interfaces.txt +2 -0
@@ -80,6 +80,9 @@ Optional properties
 - lens-focus: A phandle to the node of the lens. Only valid for device
   nodes that are related to an image sensor.
 
+- eeprom: A phandle to the node of the related EEPROM. Only valid for
+  device nodes that are related to an image sensor.

Here it's even more obvious, that the second sentence is redundant. The requirement is already in the first sentence :) Instead it should be mentioned, that this is to be used by devices not having their own embedded eeprom. How about:

eeprom: A phandle to the node of the EEPROM describing the camera sensor (i.e. device specific calibration data), in case it differs from the sensor node.

-- Sebastian

Acked-by
#12 lore raw
In reply to a message not in the archive

Hi!

Quoted 10 lines

This RFC patchset documents properties commonly required by camera modules and associated camera flash devices.

The camera module is essentially a package consisting of an image sensor, a lens, possibly a voice coil to move the lens and a number of other things that at least the drivers need not to know of. All the devices in a camera module are declared separately in the system and as such the fact that they come in a single package isn't generally very useful to driver software.

Quoted 4 lines

I'm sending the set as RFC as there's no driver implementation, and a dependency to the V4L2 async changes:

<URL:http://www.spinics.net/lists/linux-media/msg114915.html>

For the series,

In 3/3, I'd avoid using strange characters in the changelog. Just write it as I2C... If someone ever tries to grep the changelogs, this could bite them.

Thanks,
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#4 lore raw

Re: [RFC 1/3] dt: bindings: Add a binding for flash devices associated to a sensor

In reply to Sebastian Reichel

Hi Sebastian,

Quoted 20 lines · Sebastian Reichel

Hi Sakari,

Quoted 17 lines · Sakari Ailus

Camera flash drivers (and LEDs) are separate from the sensor devices in DT. In order to make an association between the two, provide the association information to the software.

---
 Documentation/devicetree/bindings/media/video-interfaces.txt | 11 +++++++++++
 1 file changed, 11 insertions(+)
Documentation/devicetree/bindings/media/video-interfaces.txt +0 -0
index 9cd2a36..d6c62bc 100644
@@ -67,6 +67,17 @@ are required in a relevant parent node:
 		    identifier, should be 1.
  - #size-cells    : should be zero.
 
Quoted 11 lines

Documentation/devicetree/bindings/media/video-interfaces.txt are required in a relevant parent node: · line 78

Quoted 9 lines
Documentation/devicetree/bindings/media/video-interfaces.txt +9 -0
+
+Optional properties
+-------------------
+
+- flash: An array of phandles that refer to the flash light sources
+  related to an image sensor. These could be e.g. LEDs. In case the LED
+  driver drives more than a single LED, then the phandles here refer to
+  the child nodes of the LED driver describing individual LEDs. Only
+  valid for device nodes that are related to an image sensor.

s/driver/controller/g - DT describes HW. Otherwise

Driver is hardware in this case. :-) The chip that acts as a current sink or source for the LED is the driver. E.g. the adp1653 documentation describes the chip as "Compact, High Efficiency, High Power, Flash/Torch LED Driver with Dual Interface".

It might be still possible to improve the wording. Software oriented folks are more likely to misunderstand the meaning of driver here, but controller might seem ambiguous for hardware oriented people.

How about:

- flash: An array of phandles that refer to the flash light sources related to an image sensor. These could be e.g. LEDs. In case the LED driver (current sink or source chip for the LED(s)) drives more than a single LED, then the phandles here refer to the child nodes of the LED driver describing individual LEDs. Only valid for device nodes that are related to an image sensor.

Signature · 4 lines
Regards,

Sakari Ailus
[email protected]
Reviewed-by
#5 lore raw

Re: [RFC 1/3] dt: bindings: Add a binding for flash devices associated to a sensor

Hi,

Quoted 19 lines · Sakari Ailus
Quoted 8 lines · Sebastian Reichel

Documentation/devicetree/bindings/media/video-interfaces.txt are required in a relevant parent node: · line 78

Quoted 5 lines · Sakari Ailus

+- flash: An array of phandles that refer to the flash light sources

Documentation/devicetree/bindings/media/video-interfaces.txt +4 -0
+  related to an image sensor. These could be e.g. LEDs. In case the LED
+  driver drives more than a single LED, then the phandles here refer to
+  the child nodes of the LED driver describing individual LEDs. Only
+  valid for device nodes that are related to an image sensor.

s/driver/controller/g - DT describes HW. Otherwise

Driver is hardware in this case. :-) The chip that acts as a current sink or source for the LED is the driver. E.g. the adp1653 documentation describes the chip as "Compact, High Efficiency, High Power, Flash/Torch LED Driver with Dual Interface".

It might be still possible to improve the wording. Software oriented folks are more likely to misunderstand the meaning of driver here, but controller might seem ambiguous for hardware oriented people.

Quoted 8 lines

How about:

- flash: An array of phandles that refer to the flash light sources related to an image sensor. These could be e.g. LEDs. In case the LED driver (current sink or source chip for the LED(s)) drives more than a single LED, then the phandles here refer to the child nodes of the LED driver describing individual LEDs. Only valid for device nodes that are related to an image sensor.

Maybe drop the last sentence? The requirement is already in the first one. Otherwise:

-- Sebastian

#11 lore raw

Re: [RFC 3/3] dt: bindings: Add a binding for referencing EEPROM from camera sensors

In reply to Sebastian Reichel
Quoted 34 lines · Sebastian Reichel

Hi,

Quoted 20 lines · Sakari Ailus

Many camera sensor devices contain EEPROM chips that describe the properties of a given unit --- the data is specific to a given unit can thus is not stored e.g. in user space or the driver.

Some sensors embed the EEPROM chip and it can be accessed through the sensor's I²C interface. This property is to be used for devices where the EEPROM chip is accessed through a different I²C address than the sensor.

The intent is to later provide this information to the user space.

---
 Documentation/devicetree/bindings/media/video-interfaces.txt | 3 +++
 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/media/video-interfaces.txt +0 -0
index e52aefc..9bd2005 100644

Documentation/devicetree/bindings/media/video-interfaces.txt Optional properties · line 84

Quoted 5 lines
Documentation/devicetree/bindings/media/video-interfaces.txt +2 -0
@@ -80,6 +80,9 @@ Optional properties
 - lens-focus: A phandle to the node of the lens. Only valid for device
   nodes that are related to an image sensor.
 
+- eeprom: A phandle to the node of the related EEPROM. Only valid for
+  device nodes that are related to an image sensor.

Here it's even more obvious, that the second sentence is redundant. The requirement is already in the first sentence :) Instead it should be mentioned, that this is to be used by devices not having their own embedded eeprom. How about:

Quoted 3 lines

eeprom: A phandle to the node of the EEPROM describing the camera sensor (i.e. device specific calibration data), in case it differs from the sensor node.

Ack. I addressed the rest of the feedback, too, and posted RFC v2.

Signature · 2 lines
Sakari Ailus
e-mail: [email protected]	XMPP: [email protected]