From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751953AbdB0VgF (ORCPT ); Mon, 27 Feb 2017 16:36:05 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:60566 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751364AbdB0VgE (ORCPT ); Mon, 27 Feb 2017 16:36:04 -0500 Date: Mon, 27 Feb 2017 21:42:30 +0100 From: Boris Brezillon To: Alban Cc: linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, Cyrille Pitchen , Richard Weinberger , Marek Vasut , Brian Norris , David Woodhouse , Greg Kroah-Hartman , Moritz Fischer Subject: Re: [RFC 0/3] drivers: Add an API to read device specific config data Message-ID: <20170227214230.53f05677@bbrezillon> In-Reply-To: <1488227292-18906-1-git-send-email-albeu@free.fr> References: <1488227292-18906-1-git-send-email-albeu@free.fr> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +Moritz Hi Alban, On Mon, 27 Feb 2017 21:28:09 +0100 Alban wrote: > 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. What you're looking for already exists and it's called nvmem[1]. Some work has been done to expose MTD partitions as nvmem cells [2], but it's never been finished. Can you please finish Moritz implementation instead of creating a new API? Thanks, Boris [1]http://lxr.free-electrons.com/source/Documentation/nvmem/nvmem.txt [2]https://patchwork.ozlabs.org/patch/626460/