Received: by 10.213.65.68 with SMTP id h4csp139804imn; Sat, 24 Mar 2018 16:26:54 -0700 (PDT) X-Google-Smtp-Source: AG47ELtLRhEgPiyD7OBF3jF9TYF1yMDIWIyieAg9wTHU644Ds5KO6teI05jYzrLIZo404CbhtMFY X-Received: by 10.101.91.3 with SMTP id y3mr24081890pgq.299.1521934014262; Sat, 24 Mar 2018 16:26:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521934014; cv=none; d=google.com; s=arc-20160816; b=rZ6eE3+L/N1gNNT/7jfJu++JEgP7+NksbuhTiatmgut0dwGBibnBaz6fLLWLuftJ9h Mu2v+f1fPiU4ipgTatKmsf0SYsPe+5vJ5dWxVjtzoWHshqx8ZaDbMV7HeJFt+xwqjcdC xMmmbK1CvFyAz4wVGfJH/CikDL/JDRdDGHIvqet3HJ1fy17bOFFtMRjvOkc4ktZOYNK1 GI77IZnHEM3c8HxbpqfCrIX1d+As/YWLwbzyzh5jwY0N8dTaSulCWrtsziJBO1dWgq/n UL+vZ8nRHHUeCBnGzSVswByhPsuKnWwkP2Fyhr/FE+Fr28NF8XtK+nxTio9rtqZUUHg7 IBpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=vS6I2mrYQ0hG3PJyftJXBRl4e/8k8AA7WCGfFRZqYBA=; b=Vj71OEbmY81Fn75R1puSECWoO26flQUl7BZdDgJL0cqYngQliob4QoOuShIUb61Aps jrpkjQEX5knvwb6JxrrOQ5Ob+kSlBAiUYAqwiRXVzE65elGnVshf/LIQdbeHyM3sUz3V oenFwGfI+vf3fLW3WAKVEcf2NKW2oEFEoV3RabuBs0+gj6Iz29obsZW/3/o4FsNMEkft npKJYe1+1fhZAugoGIT08/uiobVsZao5TfWXUV1arK5zt9EaZA6WCIm9XrSS247ll4jm /T4t203cAMaGnJrX6AiJlDmz8t/FdMUVSxb/UI2A1JfPU04pgZvgY+C4bKkKDjsXojXw KhgA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k22-v6si11267694pls.182.2018.03.24.16.26.40; Sat, 24 Mar 2018 16:26:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752945AbeCXXZt (ORCPT + 99 others); Sat, 24 Mar 2018 19:25:49 -0400 Received: from smtp4-g21.free.fr ([212.27.42.4]:59738 "EHLO smtp4-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752856AbeCXXZs (ORCPT ); Sat, 24 Mar 2018 19:25:48 -0400 Received: from tock.home (unknown [IPv6:2a02:8108:4740:3978:85fa:b641:9ec1:a586]) (Authenticated sender: albeu) by smtp4-g21.free.fr (Postfix) with ESMTPA id 0728819F574; Sun, 25 Mar 2018 00:25:16 +0100 (CET) From: Alban Bedel To: linux-kernel@vger.kernel.org Cc: Alban Bedel , Srinivas Kandagatla , Rob Herring , Mark Rutland , David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Richard Weinberger , Cyrille Pitchen , devicetree@vger.kernel.org, linux-mtd@lists.infradead.org Subject: [PATCH v3 0/3] mtd: Add support for reading MTD devices via the nvmem API Date: Sun, 25 Mar 2018 00:24:56 +0100 Message-Id: <1521933899-362-1-git-send-email-albeu@free.fr> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, this series add support for reading MTD devices via the nvmem API, this is mostly needed on embedded devices where things like MAC address and calibration data is often stored in a partition on the main flash device. Adding support for the nvmem API to the MTD core is trivial, however there is a clash in the OF binding used by both subsystems. The current nvmem binding expect nvmem cell to be subnode of the nvmem device, without any compatible string. But MTD devices used a similar scheme for partition in the past, so a subnode from an MTD device could be a partition using the old binding or an nvmem cell. To avoid this problem we update the nvmem cell binding to use a 'nvmem-cells' subnode with compatible string to hold the list of nvmem cells. This new binding make sure that any kind of device can be used as nvmem provider. Alban Bedel (3): nvmem: Update the OF binding to use a subnode for the cells list doc: bindings: Add bindings documentation for mtd nvmem mtd: Add support for reading MTD devices via the nvmem API .../devicetree/bindings/nvmem/mtd-nvmem.txt | 27 ++++++++++ Documentation/devicetree/bindings/nvmem/nvmem.txt | 55 +++++++++++++------- drivers/mtd/Kconfig | 1 + drivers/mtd/mtdcore.c | 59 ++++++++++++++++++++++ drivers/nvmem/core.c | 10 ++++ include/linux/mtd/mtd.h | 2 + 6 files changed, 137 insertions(+), 17 deletions(-) create mode 100644 Documentation/devicetree/bindings/nvmem/mtd-nvmem.txt -- 2.7.4