All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	jacek.anaszewski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Cc: linux-leds-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH 1/1] dt: bindings: Add a binding for flash devices associated to a sensor
Date: Fri, 18 Aug 2017 15:58:57 +0300	[thread overview]
Message-ID: <20170818125857.13430-1-sakari.ailus@linux.intel.com> (raw)

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.

Signed-off-by: Sakari Ailus <sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
---
Hi Rob and Jacek, others,

I know I've submitted previous versions of this patch that I have changed
since getting your acks... that's bad. I realised there will be problems
due to the vague referencing in the old version.

Instead of referring to the flash LED controller itself, the references are
now suggested to be made to the LEDs explicitly.

While most of the time all LEDs are associated to the same camera sensor,
there's nothing that suggests that this will always be the case. This will
work rather nicely with this change to the V4L2 flash class:

<URL:https://git.linuxtv.org/sailus/media_tree.git/commit/?h=flash&id=ef62781f4468d93ba8328caf7db629add453e01d>

An alternative to this could be to refer to the LEDs using the LED
controller node and integer arguments. That would require e.g. #led-cells
property to tell how many arguments there are. The actual LEDs also have
device nodes already so I thought using them would probably be a good idea
so we continue to have a single way to refer to LEDs.

Let me know your thoughts / if you're ok with the patch.

 Documentation/devicetree/bindings/media/video-interfaces.txt | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt b/Documentation/devicetree/bindings/media/video-interfaces.txt
index 852041a7480c..fee73cf2a714 100644
--- a/Documentation/devicetree/bindings/media/video-interfaces.txt
+++ b/Documentation/devicetree/bindings/media/video-interfaces.txt
@@ -67,6 +67,14 @@ are required in a relevant parent node:
 		    identifier, should be 1.
  - #size-cells    : should be zero.
 
+
+Optional properties
+-------------------
+
+- flash: An array of phandles referring to the flash LED, a sub-node
+  of the LED driver device node.
+
+
 Optional endpoint properties
 ----------------------------
 
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: linux-media@vger.kernel.org, robh@kernel.org, jacek.anaszewski@gmail.com
Cc: linux-leds@vger.kernel.org, devicetree@vger.kernel.org
Subject: [PATCH 1/1] dt: bindings: Add a binding for flash devices associated to a sensor
Date: Fri, 18 Aug 2017 15:58:57 +0300	[thread overview]
Message-ID: <20170818125857.13430-1-sakari.ailus@linux.intel.com> (raw)

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.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
Hi Rob and Jacek, others,

I know I've submitted previous versions of this patch that I have changed
since getting your acks... that's bad. I realised there will be problems
due to the vague referencing in the old version.

Instead of referring to the flash LED controller itself, the references are
now suggested to be made to the LEDs explicitly.

While most of the time all LEDs are associated to the same camera sensor,
there's nothing that suggests that this will always be the case. This will
work rather nicely with this change to the V4L2 flash class:

<URL:https://git.linuxtv.org/sailus/media_tree.git/commit/?h=flash&id=ef62781f4468d93ba8328caf7db629add453e01d>

An alternative to this could be to refer to the LEDs using the LED
controller node and integer arguments. That would require e.g. #led-cells
property to tell how many arguments there are. The actual LEDs also have
device nodes already so I thought using them would probably be a good idea
so we continue to have a single way to refer to LEDs.

Let me know your thoughts / if you're ok with the patch.

 Documentation/devicetree/bindings/media/video-interfaces.txt | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt b/Documentation/devicetree/bindings/media/video-interfaces.txt
index 852041a7480c..fee73cf2a714 100644
--- a/Documentation/devicetree/bindings/media/video-interfaces.txt
+++ b/Documentation/devicetree/bindings/media/video-interfaces.txt
@@ -67,6 +67,14 @@ are required in a relevant parent node:
 		    identifier, should be 1.
  - #size-cells    : should be zero.
 
+
+Optional properties
+-------------------
+
+- flash: An array of phandles referring to the flash LED, a sub-node
+  of the LED driver device node.
+
+
 Optional endpoint properties
 ----------------------------
 
-- 
2.11.0

             reply	other threads:[~2017-08-18 12:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-18 12:58 Sakari Ailus [this message]
2017-08-18 12:58 ` [PATCH 1/1] dt: bindings: Add a binding for flash devices associated to a sensor Sakari Ailus
2017-08-29 16:43 ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170818125857.13430-1-sakari.ailus@linux.intel.com \
    --to=sakari.ailus-vuqaysv1563yd54fqh9/ca@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=jacek.anaszewski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-leds-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.