All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] Creating an eeprom class
@ 2013-01-20 18:08 Thomas De Schampheleire
  2013-01-20 22:39 ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas De Schampheleire @ 2013-01-20 18:08 UTC (permalink / raw)
  To: linux-kernel, David Brownell, Wolfram Sang, Anatolij Gustschin,
	Frodo Looijaard, Philip Edelbrock, Greg Kroah-Hartman,
	Ben Gardner
  Cc: Ronny Meeus, Thomas De Schampheleire

[plaintext and fixed address of David Brownell]

Hi,

Several of the eeprom drivers that live in drivers/misc/eeprom export
a binary sysfs file 'eeprom'. If a userspace program or script wants
to access this file, it needs to know the full path, for example:

/sys/bus/spi/devices/spi32766.0/eeprom

The problem with this approach is that it requires knowledge about the
hardware configuration: is the eeprom on the SPI bus, the I2C bus, or
maybe memory mapped?

It would therefore be more interesting to have a bus-agnostic way to
access this eeprom file, for example:
/sys/class/eeprom/eeprom0/eeprom

Maybe it'd be even better to use a more generic class name than
'eeprom', since there are several types of eeprom-like devices that
you could export this way.

Or should we rather hook the eeprom code into the mtd subsystem?

What is your opinion?

Thanks,
Thomas

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC] Creating an eeprom class
  2013-01-20 18:08 [RFC] Creating an eeprom class Thomas De Schampheleire
@ 2013-01-20 22:39 ` Greg KH
  2013-01-21  7:25   ` Thomas De Schampheleire
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2013-01-20 22:39 UTC (permalink / raw)
  To: Thomas De Schampheleire
  Cc: linux-kernel, David Brownell, Wolfram Sang, Anatolij Gustschin,
	Frodo Looijaard, Philip Edelbrock, Ben Gardner, Ronny Meeus

On Sun, Jan 20, 2013 at 07:08:28PM +0100, Thomas De Schampheleire wrote:
> [plaintext and fixed address of David Brownell]

David passed away a year or so ago, so that's really not going to help :(

> Hi,
> 
> Several of the eeprom drivers that live in drivers/misc/eeprom export
> a binary sysfs file 'eeprom'. If a userspace program or script wants
> to access this file, it needs to know the full path, for example:
> 
> /sys/bus/spi/devices/spi32766.0/eeprom
> 
> The problem with this approach is that it requires knowledge about the
> hardware configuration: is the eeprom on the SPI bus, the I2C bus, or
> maybe memory mapped?
> 
> It would therefore be more interesting to have a bus-agnostic way to
> access this eeprom file, for example:
> /sys/class/eeprom/eeprom0/eeprom
> 
> Maybe it'd be even better to use a more generic class name than
> 'eeprom', since there are several types of eeprom-like devices that
> you could export this way.

Does all of the existing "eeprom" devices use the same userspace
interface?  If so, yes, having a "class" would make sense.

> Or should we rather hook the eeprom code into the mtd subsystem?

Why mtd?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC] Creating an eeprom class
  2013-01-20 22:39 ` Greg KH
@ 2013-01-21  7:25   ` Thomas De Schampheleire
  2013-01-22  0:14     ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas De Schampheleire @ 2013-01-21  7:25 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel, Wolfram Sang, Anatolij Gustschin, Frodo Looijaard,
	Philip Edelbrock, Ben Gardner, Ronny Meeus

On Sun, Jan 20, 2013 at 11:39 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Sun, Jan 20, 2013 at 07:08:28PM +0100, Thomas De Schampheleire wrote:
>> [plaintext and fixed address of David Brownell]
>
> David passed away a year or so ago, so that's really not going to help :(

So sorry to hear that, I was not aware...

>
>> Hi,
>>
>> Several of the eeprom drivers that live in drivers/misc/eeprom export
>> a binary sysfs file 'eeprom'. If a userspace program or script wants
>> to access this file, it needs to know the full path, for example:
>>
>> /sys/bus/spi/devices/spi32766.0/eeprom
>>
>> The problem with this approach is that it requires knowledge about the
>> hardware configuration: is the eeprom on the SPI bus, the I2C bus, or
>> maybe memory mapped?
>>
>> It would therefore be more interesting to have a bus-agnostic way to
>> access this eeprom file, for example:
>> /sys/class/eeprom/eeprom0/eeprom
>>
>> Maybe it'd be even better to use a more generic class name than
>> 'eeprom', since there are several types of eeprom-like devices that
>> you could export this way.
>
> Does all of the existing "eeprom" devices use the same userspace
> interface?  If so, yes, having a "class" would make sense.

All but one do. That one (eeprom_93cx6.c) exports its read/write
functions to other kernel code, and is used in several
wireless/ethernet drivers.

>
>> Or should we rather hook the eeprom code into the mtd subsystem?
>
> Why mtd?

Because an eeprom is a piece of memory. Maybe mtd is overkill in term
of the operations supported, but from a high-level perspective an
eeprom is a memory technology device, right?

Thanks,
Thomas

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC] Creating an eeprom class
  2013-01-21  7:25   ` Thomas De Schampheleire
@ 2013-01-22  0:14     ` Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2013-01-22  0:14 UTC (permalink / raw)
  To: Thomas De Schampheleire
  Cc: linux-kernel, Wolfram Sang, Anatolij Gustschin, Frodo Looijaard,
	Philip Edelbrock, Ben Gardner, Ronny Meeus

On Mon, Jan 21, 2013 at 08:25:59AM +0100, Thomas De Schampheleire wrote:
> On Sun, Jan 20, 2013 at 11:39 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> > On Sun, Jan 20, 2013 at 07:08:28PM +0100, Thomas De Schampheleire wrote:
> >> [plaintext and fixed address of David Brownell]
> >
> > David passed away a year or so ago, so that's really not going to help :(
> 
> So sorry to hear that, I was not aware...
> 
> >
> >> Hi,
> >>
> >> Several of the eeprom drivers that live in drivers/misc/eeprom export
> >> a binary sysfs file 'eeprom'. If a userspace program or script wants
> >> to access this file, it needs to know the full path, for example:
> >>
> >> /sys/bus/spi/devices/spi32766.0/eeprom
> >>
> >> The problem with this approach is that it requires knowledge about the
> >> hardware configuration: is the eeprom on the SPI bus, the I2C bus, or
> >> maybe memory mapped?
> >>
> >> It would therefore be more interesting to have a bus-agnostic way to
> >> access this eeprom file, for example:
> >> /sys/class/eeprom/eeprom0/eeprom
> >>
> >> Maybe it'd be even better to use a more generic class name than
> >> 'eeprom', since there are several types of eeprom-like devices that
> >> you could export this way.
> >
> > Does all of the existing "eeprom" devices use the same userspace
> > interface?  If so, yes, having a "class" would make sense.
> 
> All but one do. That one (eeprom_93cx6.c) exports its read/write
> functions to other kernel code, and is used in several
> wireless/ethernet drivers.

Then it shouldn't be used here, right?

> >> Or should we rather hook the eeprom code into the mtd subsystem?
> >
> > Why mtd?
> 
> Because an eeprom is a piece of memory. Maybe mtd is overkill in term
> of the operations supported, but from a high-level perspective an
> eeprom is a memory technology device, right?

Everything is a memory device in the end :)

Feel free to send patches, but I don't think this is really a big deal
that deserves this type of change at the moment.  Feel free to prove me
wrong though.

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC] Creating an eeprom class
  2014-01-22 13:25 Laszlo Papp
@ 2014-01-22 17:18 ` Curt Brune
  0 siblings, 0 replies; 6+ messages in thread
From: Curt Brune @ 2014-01-22 17:18 UTC (permalink / raw)
  To: Laszlo Papp; +Cc: LKML, patrickdepinguin, gregkh, linux-i2c

Hi Laszlo,

On Wed Jan 22 13:25, Laszlo Papp wrote:
> 
> Was there any progress done? I saw the following thread, too, so
> including CC in the loop:
> http://www.spinics.net/lists/linux-i2c/msg13141.html
> 

I have patches that adds a "eeprom_dev" class that I described in the
above thread.  The patches also show how to register the at24 driver
with the EEPROM class.

We have been using the patch in production for almost a year now, with
good success.

I will send the patches to linux-i2c@vget.kernel.org shortly.

Cheers,
Curt

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC] Creating an eeprom class
@ 2014-01-22 13:25 Laszlo Papp
  2014-01-22 17:18 ` Curt Brune
  0 siblings, 1 reply; 6+ messages in thread
From: Laszlo Papp @ 2014-01-22 13:25 UTC (permalink / raw)
  To: LKML; +Cc: patrickdepinguin, gregkh, linux-i2c, curt

> On Sun, Jan 20, 2013 at 07:08:28PM +0100, Thomas De Schampheleire wrote:
>> [plaintext and fixed address of David Brownell]
>
> David passed away a year or so ago, so that's really not going to help :(
>
>> Hi,
>>
>> Several of the eeprom drivers that live in drivers/misc/eeprom export
>> a binary sysfs file 'eeprom'. If a userspace program or script wants
>> to access this file, it needs to know the full path, for example:
>>
>> /sys/bus/spi/devices/spi32766.0/eeprom
>>
>> The problem with this approach is that it requires knowledge about the
>> hardware configuration: is the eeprom on the SPI bus, the I2C bus, or
>> maybe memory mapped?
>>
>> It would therefore be more interesting to have a bus-agnostic way to
>> access this eeprom file, for example:
>> /sys/class/eeprom/eeprom0/eeprom
>>
>> Maybe it'd be even better to use a more generic class name than
>> 'eeprom', since there are several types of eeprom-like devices that
>> you could export this way.
>
> Does all of the existing "eeprom" devices use the same userspace
> interface?  If so, yes, having a "class" would make sense.

Was there any progress done? I saw the following thread, too, so
including CC in the loop:
http://www.spinics.net/lists/linux-i2c/msg13141.html

Needless to say that I am writing this email because I would also be
interested in a handy and convenient class interface - as opposed to
the raw bus specific path -, similarly to hwmon, gpio, leds, etc.

I could probably even try to volunteer, with very limited resources
admittedly, to get some driver done for our EEPROM if that is needed.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-01-22 17:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-20 18:08 [RFC] Creating an eeprom class Thomas De Schampheleire
2013-01-20 22:39 ` Greg KH
2013-01-21  7:25   ` Thomas De Schampheleire
2013-01-22  0:14     ` Greg KH
2014-01-22 13:25 Laszlo Papp
2014-01-22 17:18 ` Curt Brune

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.