Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp592145imm; Fri, 29 Jun 2018 03:10:25 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKTZ90lmnBs2vkECMY01FBeU/TgKzNZlvw5QK87B10pg8krOpKjDaUigUAE5AnTunVWSTIc X-Received: by 2002:a65:5304:: with SMTP id m4-v6mr11991318pgq.250.1530267024953; Fri, 29 Jun 2018 03:10:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530267024; cv=none; d=google.com; s=arc-20160816; b=utPckALicuaelYimEd2BXDit1Rh6jrIG/KF+Gkmiu6GdZhkSQOXlUrQylTZ9liWRoo r2kaiqidlayJpsQnDU1bneEgspAHfYYUOfQPegRnex73Gj0mkHBnMuUE5Dh9rf+oJ66z yUKma+fonAN8MZKgzy+Y1zOm+CGcKZOqRqCb1BKun+hXAZWUdlJmEH60Nc2ijy6nUr+q NYBTLmO2bVm+1BSo8VfILch3LWuCwBxwTx34u1YeM/SRG48t60FV3XuBuOJDX7OGqsUT kGw4Al6YhdvqVtOeunUM7iSEcG4uKuttkG5jWYvl4zOI636ZU4lX3FflJ6uoGvysSqGU JqmQ== 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=g7UpIifBzzlHofhCVWyJaw6cfbiRR9ZhvkhoeVpGg5M=; b=ZO4uSC5A29cf3dpESiqQXXR0/wPx/ouI5G30vYS5bBzB2h5udDWrK9szV6Jf103y0f Fdq++jJQi8dPBHV5QuUWSMu60gMZPI/mzk8Pfav6AWDpzFbRG5uab6g+EX2v64D0Gxk2 uGMcbEMXBRVQ9SzdCZMJoj9gJuXdYKDbJqfQcjn7T3/FsHtNUr+1gu5F1/fFySL5oiv6 Aj5CXRCH22x11L6zSJmg3hXwlFPEvo5j1zEhbR5Cnl480UOu9E8vjuTfz8jy9C7FR/32 V+u+JUxs4lhgfABVfjUk6Bm5gmJHNnrH9lholVppGt2w4nni1HF8UgZYX5B4WeWYHV5c Rn5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=0kpUEV03; 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 f6-v6si826498pgu.53.2018.06.29.03.10.10; Fri, 29 Jun 2018 03:10:24 -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=0kpUEV03; 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 S1754766AbeF2Jkw (ORCPT + 99 others); Fri, 29 Jun 2018 05:40:52 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:45982 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933615AbeF2Jkr (ORCPT ); Fri, 29 Jun 2018 05:40:47 -0400 Received: by mail-wr0-f196.google.com with SMTP id u7-v6so8202095wrn.12 for ; Fri, 29 Jun 2018 02:40:46 -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=g7UpIifBzzlHofhCVWyJaw6cfbiRR9ZhvkhoeVpGg5M=; b=0kpUEV03j1mvInFsLtalEfZMaWcGsUNYAnFPBd2wl1QyRfU1T7V0Mla0oSSs5bT9zL j25nhqT7ZLBhx3US3Q5RhpqbWxvVthWyc/zwhrvlMSzAZVaI5VRESDNml0VXUII/lrQm f4nVXFJcuVzbDtx6GbcGdzbzYr7szzd4/wFszze1ibYOnrIYM1beFAXfGc43c/rr4Atn 4B1R16gtjVjNiYr3oEnj73dr7amaEosgnlAtSqxq5U1lJvMO8JIaywZ7c4biMlZdqxsx eBcQI6WLv4nepN51hhIIonGxFJtGNbT0L83ivbYqKkjAAKiJCl+RdXDWGxjFWRp+lkV7 caLA== 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=g7UpIifBzzlHofhCVWyJaw6cfbiRR9ZhvkhoeVpGg5M=; b=B2wnyQHX6jKKQTDZ2xDyh4E6Cmltwvgnq+yc9rhZjqZAUlMZ1a0chEZx8vP41Qw4Ra PrtLJwbA0zpm4zPzpxr+XruP/W5fj1+KWCugKjmNNcoo9ZdLwr7FEBbbINKWNUiYHBJN 9NSKTJsx3uR2B+pRj9npaxNGHLExK6deaZSiG1YB99vnwqDIvpv2Mrdp5s1PDH/ngkJn YQPgJWBO71wztfLszNAv6RuyeDLeALB5hVlyB/QmX86EGpf2dqXTzSCglsqYfQZWS6xQ ezghZxVD6lti4pyCtCkd89tZ3LwactA5BOl4//9fu0bxVRQnndoygw8B5Ppi5Jv59f71 rdZQ== X-Gm-Message-State: APt69E2NLQkstSJmQtlAs9ZgC9ASR8m/ayil9SEiMDqUF7cKvDBjceZD zrCW0orr1X0kHRAntaZB+WCxtw== X-Received: by 2002:adf:f482:: with SMTP id l2-v6mr8685670wro.259.1530265246041; Fri, 29 Jun 2018 02:40:46 -0700 (PDT) Received: from brgl-bgdev.lan (LFbn-NIC-1-55-10.w2-15.abo.wanadoo.fr. [2.15.147.10]) by smtp.gmail.com with ESMTPSA id d102-v6sm1386394wma.10.2018.06.29.02.40.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Jun 2018 02:40:45 -0700 (PDT) From: Bartosz Golaszewski To: Sekhar Nori , Kevin Hilman , Russell King , Grygorii Strashko , "David S . Miller" , Srinivas Kandagatla , Lukas Wunner , Rob Herring , Florian Fainelli , Dan Carpenter , Ivan Khoronzhuk , David Lechner , Greg Kroah-Hartman , Andrew Lunn , Jonathan Corbet Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, netdev@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH v4 02/18] Documentation: nvmem: document lookup entries Date: Fri, 29 Jun 2018 11:40:23 +0200 Message-Id: <20180629094039.7543-3-brgl@bgdev.pl> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180629094039.7543-1-brgl@bgdev.pl> References: <20180629094039.7543-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.17.1