All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC 0/3] drivers: Add an API to read device specific config data
@ 2017-02-27 20:28 Alban
  2017-02-27 20:28 ` [PATCH 1/3] " Alban
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Alban @ 2017-02-27 20:28 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-mtd, Cyrille Pitchen, Richard Weinberger, Marek Vasut,
	Boris Brezillon, Brian Norris, David Woodhouse,
	Greg Kroah-Hartman, Alban

Hi all,

while looking at adding OF support for the ath9k driver I had the problem of
reading the EEPROM data. On the SoC platforms this data is stored in an SPI
flash along with a few other things. In OpenWRT/LEDE this data is read from
the board init code using the fact that the flash is (normaly) readable from
a memory map. A bit too hackish for my taste.

This is just one example, there is various other similar cases, mostly with
MAC addresses. I thought it would be nicer if we had a clean API for this,
similar to the firmware API but per device instance instead of beeing per
driver. The device driver wouldn't have to care where the data is stored,
they just request it and the backend take care of reading the EEPROM, MTD
or whatever is used on the board.

This series implement such an API along with an implementation for MTD
devices and a use in the ath9k driver. As this is an RFC I didn't yet
write the OF binding documentation, that will come later if the feedback
is positive.

Alban Bedel (3):
  drivers: Add an API to read device specific config data
  mtd: Add support for reading device data out of MTD devices
  ath9k: ahb: Add OF support

 drivers/base/Kconfig                   |   6 +
 drivers/base/Makefile                  |   1 +
 drivers/base/devdata.c                 | 204 +++++++++++++++++++++++++++++++++
 drivers/mtd/Kconfig                    |   9 ++
 drivers/mtd/Makefile                   |   1 +
 drivers/mtd/devdata.c                  |  70 +++++++++++
 drivers/net/wireless/ath/ath9k/Kconfig |   1 +
 drivers/net/wireless/ath/ath9k/ahb.c   |  55 +++++++--
 drivers/net/wireless/ath/ath9k/init.c  |  41 ++++++-
 include/linux/devdata.h                |  79 +++++++++++++
 10 files changed, 459 insertions(+), 8 deletions(-)
 create mode 100644 drivers/base/devdata.c
 create mode 100644 drivers/mtd/devdata.c
 create mode 100644 include/linux/devdata.h

-- 
2.7.4

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

end of thread, other threads:[~2017-02-28 18:04 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-27 20:28 [RFC 0/3] drivers: Add an API to read device specific config data Alban
2017-02-27 20:28 ` [PATCH 1/3] " Alban
2017-02-27 20:28 ` [PATCH 2/3] mtd: Add support for reading device data out of MTD devices Alban
2017-02-27 20:28 ` [PATCH 3/3] ath9k: ahb: Add OF support Alban
2017-02-27 21:13   ` Rafał Miłecki
2017-02-27 22:48     ` Alban
2017-02-27 22:54       ` Rafał Miłecki
2017-02-27 22:54         ` Rafał Miłecki
2017-02-28 18:03   ` kbuild test robot
2017-02-27 20:42 ` [RFC 0/3] drivers: Add an API to read device specific config data Boris Brezillon
2017-02-27 22:26   ` Moritz Fischer
2017-02-27 22:41   ` Alban
2017-02-27 20:42 ` Marek Vasut

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.