[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20140407090908.GE3926@lukather>
Date: Mon, 7 Apr 2014 11:09:08 +0200
From: Maxime Ripard <maxime.ripard@...e-electrons.com>
To: Curt Brune <curt@...ulusnetworks.com>
Cc: Wolfram Sang <wsa@...-dreams.de>, Laszlo Papp <lpapp@....org>,
Thomas De Schampheleire <patrickdepinguin@...il.com>,
gregkh@...uxfoundation.org,
Shrijeet Mukherjee <shm@...ulusnetworks.com>,
linux-i2c@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 1/2] Create eeprom_dev hardware class for EEPROM
devices
Hi,
On Thu, Jan 23, 2014 at 11:16:01AM -0800, Curt Brune wrote:
> Create a new hardware class under /sys/class/eeprom_dev
>
> EEPROM drivers can register their devices with the eeprom_dev class
> during instantiation.
>
> The registered devices show up as:
>
> /sys/class/eeprom_dev/eeprom0
> /sys/class/eeprom_dev/eeprom1
> ...
> /sys/class/eeprom_dev/eeprom[N]
>
> Each member of the eeprom class exports a sysfs file called "label",
> containing the label property from the corresponding device tree node.
>
> Example:
>
> /sys/class/eeprom_dev/eeprom0/label
>
> If the device tree node property "label" does not exist the value
> "unknown" is used.
>
> Note: The class cannot be called 'eeprom' as that is the name of the
> I/O file created by the driver. The class name appears as a
> sub-directory within the main device directory. Hence the class name
> 'eeprom_dev'.
>
> Userspace can use the label to identify what the EEPROM is for.
>
> The real device is available from the class device via the "device"
> link:
>
> /sys/class/eeprom_dev/eeprom0/device
Sorry for stepping up this late, but I've been working on an eeprom
framework recently to move all the duplication that exists in the
eeprom drivers (such as sysfs file creation, in kernel accessors) to
common code. And part of that work was to create a eeprom class.
The only feature that's missing from your code is the label, but I
guess it can easily be added, and makes sense.
I'm not quite fond of some of the API yet, particularly on the in
kernel side, but I guess I can post what I have so far as an RFC and
get the discussion started.
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists