Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp966506imm; Wed, 8 Aug 2018 08:34:49 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzDdj73uYnff10Ny9mnX9h1sB/hxgEoAoYNlYes00yg4plY8H8Aj/GsRjlyS7W/F0d+Y23l X-Received: by 2002:a62:8d84:: with SMTP id p4-v6mr3537345pfk.251.1533742489087; Wed, 08 Aug 2018 08:34:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533742489; cv=none; d=google.com; s=arc-20160816; b=IRH63My0L0gyXSnG3lvt6D7aMQ4+Bf7nSY6SaWp+4qS9WlUHyxFGCk4XJi0PzanzOq f0BqYltHeCTaqMziOLzLKyKF3+12N7UZy9sAxDcjuVhUTMQUBthl/GucDEDpTfVHzvbN 8tmJ3arlZ4WJ/6xjKrzVP+D4nMJqfI9bo7GYsKNRBH3LyLusQtY5TFYBdUWKtY8E3Z4S zhM6WKNdEL03u+K862M4FoDccD+YU1kXVxz5ddj9qREQ/Owf6GODS8zc7SqienxaMFwg wW55TKIgcKkMLhjz/GhJj6/lxYZjuTRez1tChI2hYTG09G6fwt72VCkRfxeD4cXFjBo6 nruQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=auDnQ2msgcUIg2cR1NJaWEIgp9qglPcIziHCsh4zH4c=; b=iyFulaxZ94rB4bYjA4S+PUHXkZjxOf9OZH5l+hVl9C0cY+Ht7UKAO949rvitoIQnti CB78zRQy+WgpQJF57P4IETt5YUBGggXJSQCTlVL4UaqmcafHs88QOoI5/gYh6bL1h4jd b9c1/CddwSXJelpESpVhShyKlcsxnx0A6aKW4mJYErPbqnhmVNGWB/6MIWMfgyDd6Tsm Yk2B1vpd/ub4EYWtp8kQam/Zpzq7CIZZZZhbngjIcH8/gHxorsHwkSr5fWTSPR6lZbeO aiWQQZ3PrO4+ff1Phbq8kEVGaL3Q3DoTDl+fuls2kjReaMG5sYeNTuQSYPpKrAQQCsVv P+HA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=i0TceG1l; 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 g12-v6si3625490pll.384.2018.08.08.08.34.34; Wed, 08 Aug 2018 08:34:49 -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; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=i0TceG1l; 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 S1727539AbeHHRxm (ORCPT + 99 others); Wed, 8 Aug 2018 13:53:42 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:33664 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727554AbeHHRxl (ORCPT ); Wed, 8 Aug 2018 13:53:41 -0400 Received: by mail-wr1-f65.google.com with SMTP id g6-v6so2425386wrp.0 for ; Wed, 08 Aug 2018 08:33:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=auDnQ2msgcUIg2cR1NJaWEIgp9qglPcIziHCsh4zH4c=; b=i0TceG1lfus+3BKletcKWO3nK/kouvjNQ7m41aqTlvkDGShVKicbJizZHKDcw3Xqt+ HPr21z1eaCC7xAYrE6QY5AYgYSjdpdncEKSuTuYtGsJMlOxdr1Xs06f0jThoaM5E5FPt RDoXE6k+MkI0htttCqe3Z533KoWRVj+IGT1KP/BBWIUee236jV5xzx3s/WuaxDl0jp05 XCNQAg3Rv3YvBaDXWZKo4rYHxI8zIBvMJI6UUfP5/mVir7hVqVimhQlrXmh2SFn1dkzK 6WoaZtFaMc8ktSCQafPsfjp+uQWjcGeBBFPjxiDX0PsUVROXEtmgSb5yWl9ElgSrCvZm HUfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=auDnQ2msgcUIg2cR1NJaWEIgp9qglPcIziHCsh4zH4c=; b=swfBq+aDX0nVnMsgi/5DWIjBv5xWJLLe12BvhXDBpoEC02e+c7fEzZmVzDkMTfPFG0 89AyrKlOknKFecBnmx5aHuzrIQGZIqG0Yu841gdBoPaJWC2NezGdHhtSTnehEyvR2vdc GRtFmTw/3tUref98NghCQP4LoayPdhtfHIVRLlRCQUFShJHxdQIgA+fiCQM6OP3CSAn5 6HtlwCALVY332FFtKGPrKadobAQC1k5joBy9ShZVcuvq99bfjWsk5yyaps0hyybYruNz 4bOQANCC4YADQ6ZSRm/DPD8lykBu1G5xljq5OEJkf9GDnr7wiHCMBe+pTwj0wtuEREzj d36g== X-Gm-Message-State: AOUpUlHgnFqHHD8SYNYSwSak0rZWYD912ssoXiUGA3llE2inA2bmbX1V Or0AIy+foE4PXffzJ4U+g16BSw== X-Received: by 2002:adf:eec9:: with SMTP id a9-v6mr2368667wrp.21.1533742409371; Wed, 08 Aug 2018 08:33:29 -0700 (PDT) Received: from brgl-bgdev.lan (LFbn-MAR-1-609-89.w90-118.abo.wanadoo.fr. [90.118.185.89]) by smtp.gmail.com with ESMTPSA id s2-v6sm5240915wrw.52.2018.08.08.08.33.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Aug 2018 08:33:28 -0700 (PDT) From: Bartosz Golaszewski To: Jonathan Corbet , Sekhar Nori , Kevin Hilman , Russell King , Arnd Bergmann , Greg Kroah-Hartman , David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Richard Weinberger , Grygorii Strashko , "David S . Miller" , Srinivas Kandagatla , Naren , Mauro Carvalho Chehab , Andrew Morton , Lukas Wunner , Dan Carpenter , Florian Fainelli , Ivan Khoronzhuk , Sven Van Asbroeck , Paolo Abeni , Alban Bedel , Rob Herring , David Lechner , Andrew Lunn Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-mtd@lists.infradead.org, linux-omap@vger.kernel.org, netdev@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 02/28] Documentation: nvmem: document lookup entries Date: Wed, 8 Aug 2018 17:31:24 +0200 Message-Id: <20180808153150.23444-3-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180808153150.23444-1-brgl@bgdev.pl> References: <20180808153150.23444-1-brgl@bgdev.pl> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bartosz Golaszewski Describe the usage of nvmem cell lookup tables. Signed-off-by: Bartosz Golaszewski --- Documentation/nvmem/nvmem.txt | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Documentation/nvmem/nvmem.txt b/Documentation/nvmem/nvmem.txt index 8d8d8f58f96f..9d5e3ca2b4f3 100644 --- a/Documentation/nvmem/nvmem.txt +++ b/Documentation/nvmem/nvmem.txt @@ -58,6 +58,34 @@ static int qfprom_probe(struct platform_device *pdev) It is mandatory that the NVMEM provider has a regmap associated with its struct device. Failure to do would return error code from nvmem_register(). +Additionally it is possible to create nvmem cell lookup entries and register +them with the nvmem framework from machine code as shown in the example below: + +static struct nvmem_cell_lookup foobar_lookup = { + .info = { + .name = "mac-address", + .offset = 0xd000, + .bytes = ERH_ALEN, + }, + .nvmem_name = "foobar", +}; + +static void foobar_register(void) +{ + ... + nvmem_add_lookup_table(&foobar_lookup, 1); + ... +} + +A lookup entry table can be later removed if needed: + +static void foobar_fini(void) +{ + ... + nvmem_del_lookup_table(&foobar_lookup, 1); + ... +} + NVMEM Consumers +++++++++++++++ -- 2.18.0