Devicetree
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard@free-electrons.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: linux-media@vger.kernel.org, linux-leds@vger.kernel.org,
	devicetree@vger.kernel.org, sebastian.reichel@collabora.co.uk,
	robh@kernel.org, pavel@ucw.cz
Subject: Re: [PATCH 3/8] dt: bindings: Add a binding for referencing EEPROM from camera sensors
Date: Wed, 19 Jul 2017 13:18:43 +0200	[thread overview]
Message-ID: <20170719111843.kyoqtqonhdkyvrjz@flea> (raw)
In-Reply-To: <20170719092106.xqichkcd6yepchxy@kekkonen.localdomain>

[-- Attachment #1: Type: text/plain, Size: 4154 bytes --]

Hi Sakari,

On Wed, Jul 19, 2017 at 12:21:06PM +0300, Sakari Ailus wrote:
> On Wed, Jul 19, 2017 at 09:52:55AM +0200, Maxime Ripard wrote:
> > Hi Sakari,
> > 
> > On Wed, Jun 14, 2017 at 12:47:14PM +0300, Sakari Ailus wrote:
> > > 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 I2C interface. This property is to be used for devices where the
> > > EEPROM chip is accessed through a different I2C address than the sensor.
> > > 
> > > The intent is to later provide this information to the user space.
> > > 
> > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> > > Acked-by: Pavel Machek <pavel@ucw.cz>
> > > Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
> > > ---
> > >  Documentation/devicetree/bindings/media/video-interfaces.txt | 3 +++
> > >  1 file changed, 3 insertions(+)
> > > 
> > > diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt b/Documentation/devicetree/bindings/media/video-interfaces.txt
> > > index a18d9b2..ae259924 100644
> > > --- a/Documentation/devicetree/bindings/media/video-interfaces.txt
> > > +++ b/Documentation/devicetree/bindings/media/video-interfaces.txt
> > > @@ -76,6 +76,9 @@ Optional properties
> > >  
> > >  - lens-focus: A phandle to the node of the focus lens controller.
> > >  
> > > +- 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.
> > 
> > Wouldn't it makes sense (especially if you want to provide user space
> > access) to reuse what nvmem provides for this?
> 
> I wasn't aware of the nvmem bindings. Thanks for the pointer.
> 
> These are EEPROM chips that already have bindings documented under
> Documentation/devicetree/bindings/eeprom as well as existing drivers under
> drivers/misc/eeprom. Is there a reason why we have separate eeprom and
> nvmem devices? Do you see issues in adding nvmem support for the existing
> eeprom drivers, other than it misses using the nvmem framework?

As far as I know, the nvmem framework has superseeded the
drivers/misc/eeprom one, and both AT24 and AT25's bindings are still
respected by their respective drivers in nvmem.

> There's also a small issue (or a big one, depending on which part of it you
> consider) of the EEPROM content being parsed in the user space. The sensor
> drivers do not use that information nor the contents are specific to the
> sensor alone, it is ultimately up to the system integrator what to put to
> the EEPROM. The typical size of an EEPROM is in perhaps one or two
> kilobytes so that there's a lot of room for storing different individual
> settings there.
> 
> nvmem bindings require referring to individual data cells but it's rather
> the entire EEPROM contents that would be of interest here. I guess you
> could create a single node under the EEPROM chip that covers the entire
> chip. Or change the documentation to allow referring to the chip, rather
> than a node under it.

I'm not sure I really followed your thoughts here, but the fact that
the EEPROM are usually way larger than the data each and every driver
needs is indeed true. And this is exactly why we have cells, in order
to differentiate the camera calibration data, from the touchscreen
ones, and from the MAC address of the device.

I guess if you really need the whole EEPROM, yeah, a single big cell
would be the way to go I guess.

And there's currently a way to lockdown the EEPROM at the provider
level, I guess it would make sense to have the same kind of API for
the consumer too if the data are to be protected.

I'm not that involved in nvmem anymore, so the maintainer might have a
different opinion though :)

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

  reply	other threads:[~2017-07-19 11:18 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-14  9:47 [PATCH 0/8] Support registering lens, flash and EEPROM devices Sakari Ailus
2017-06-14  9:47 ` [PATCH 1/8] dt: bindings: Add a binding for flash devices associated to a sensor Sakari Ailus
2017-06-14 15:19   ` Rob Herring
     [not found]   ` <1497433639-13101-2-git-send-email-sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-06-15  9:11     ` Pavel Machek
2017-06-15  9:21   ` Sebastian Reichel
2017-06-14  9:47 ` [PATCH 2/8] dt: bindings: Add lens-focus binding for image sensors Sakari Ailus
2017-06-14 15:20   ` Rob Herring
2017-06-14  9:47 ` [PATCH 3/8] dt: bindings: Add a binding for referencing EEPROM from camera sensors Sakari Ailus
2017-06-18 14:05   ` Rob Herring
     [not found]   ` <1497433639-13101-4-git-send-email-sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-07-19  7:52     ` Maxime Ripard
2017-07-19  9:21       ` Sakari Ailus
2017-07-19 11:18         ` Maxime Ripard [this message]
2017-07-21 11:14           ` Sakari Ailus
     [not found] ` <1497433639-13101-1-git-send-email-sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-06-14  9:47   ` [PATCH 4/8] v4l2-flash: Use led_classdev instead of led_classdev_flash for indicator Sakari Ailus
2017-06-14 21:13     ` Jacek Anaszewski
2017-06-15  6:31     ` kbuild test robot
2017-06-15 10:45     ` Sebastian Reichel
2017-06-14  9:47   ` [PATCH 5/8] v4l2-flash: Flash ops aren't mandatory Sakari Ailus
2017-06-14 21:14     ` Jacek Anaszewski
     [not found]       ` <3e0a8823-a8b4-3f78-25e0-22d8cb8ad090-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-06-14 21:19         ` Sakari Ailus
     [not found]           ` <20170614211939.GR12407-S+BSfZ9RZZmRSg0ZkenSGLdO1Tsj/99ntUK59QYPAWc@public.gmane.org>
2017-06-15 12:08             ` Jacek Anaszewski
2017-06-15  9:24     ` Sebastian Reichel
2017-06-15 12:32       ` Sakari Ailus
     [not found]         ` <20170615123209.GD12407-S+BSfZ9RZZmRSg0ZkenSGLdO1Tsj/99ntUK59QYPAWc@public.gmane.org>
2017-06-15 12:51           ` Sebastian Reichel
2017-07-18 17:36     ` [PATCH v1.1 1/1] " Sakari Ailus
2017-07-19 11:53       ` Pavel Machek
2017-06-14  9:47   ` [PATCH 6/8] leds: as3645a: Add LED flash class driver Sakari Ailus
2017-06-14 21:15     ` Jacek Anaszewski
2017-06-14 22:10       ` Sakari Ailus
     [not found]         ` <20170614221028.GS12407-S+BSfZ9RZZmRSg0ZkenSGLdO1Tsj/99ntUK59QYPAWc@public.gmane.org>
2017-06-15 13:01           ` Jacek Anaszewski
2017-06-15 13:34             ` Sakari Ailus
     [not found]               ` <20170615133404.GF12407-S+BSfZ9RZZmRSg0ZkenSGLdO1Tsj/99ntUK59QYPAWc@public.gmane.org>
2017-06-15 13:47                 ` Jacek Anaszewski
2017-06-14 21:39     ` Pavel Machek
2017-06-14 22:21       ` Sakari Ailus
2017-06-14 22:28         ` Pavel Machek
2017-06-14 22:43           ` Sakari Ailus
2017-06-15 10:43             ` Pavel Machek
2017-06-14  9:47 ` [PATCH 7/8] smiapp: Add support for flash, lens and EEPROM devices Sakari Ailus
2017-06-15  1:50   ` kbuild test robot
2017-06-16 12:07   ` Pavel Machek
2017-06-16 12:26     ` Sakari Ailus
     [not found]       ` <20170616122629.GL15419-z7MJbOB4PBP+e+fPlCVrcFDQ4js95KgL@public.gmane.org>
2017-06-16 13:10         ` Pavel Machek
2017-06-16 12:42   ` Pavel Machek
2017-06-16 12:45     ` Sakari Ailus
     [not found]       ` <20170616124526.GM15419-z7MJbOB4PBP+e+fPlCVrcFDQ4js95KgL@public.gmane.org>
2017-06-17  9:19         ` Pavel Machek
2017-06-17 12:59       ` Pavel Machek
2017-06-17 21:12         ` Pavel Machek
     [not found]   ` <1497433639-13101-8-git-send-email-sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-06-17 12:17     ` Pavel Machek
2017-06-14  9:47 ` [PATCH 8/8] arm: dts: omap3: N9/N950: Add AS3645A camera flash Sakari Ailus
2017-06-15 10:15   ` Sebastian Reichel
2017-06-14  9:53 ` [PATCH 0/8] Support registering lens, flash and EEPROM devices Sakari Ailus

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=20170719111843.kyoqtqonhdkyvrjz@flea \
    --to=maxime.ripard@free-electrons.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=robh@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=sebastian.reichel@collabora.co.uk \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox