Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1604490imm; Fri, 7 Sep 2018 03:11:22 -0700 (PDT) X-Google-Smtp-Source: ANB0VdamFkxkSj39IhIDGBAFHfggAHwpwM6B00ZVTOZgOAXwB7+EaTJ7Eq2OC9idfOgkK2CBYjm+ X-Received: by 2002:a63:5b63:: with SMTP id l35-v6mr7483971pgm.50.1536315082912; Fri, 07 Sep 2018 03:11:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536315082; cv=none; d=google.com; s=arc-20160816; b=QmZyDH//grQmfzNqnFwexHA0IzykFHWM6eyYMFXYnJqBzKa4jWoPrr4x+zLu6mJdhs EK1btVbySx1p5TAh2LQr+KkwqytuqkfeaPmH3LzHvmYAEGAZEE9Oj35iH1yxaHrBD7tR P7Zqngfxr4F2kqiUo5nP9D8L7z6uRsjaV32OztmKbI724o9B/KBZGvrd1KUQmksYrj4E 36LoF1H/V4JP6rPCt0gUynMrKyRp52cto7yVV/YL/FJDaWSFmPa6Y0MjthAf8Clzi9nK Nvy+5qcvigzA/wkIc/ijJ+DCPMTG3bMwpYLNTRBIE49G6PqEXp6xemrJ3HtOaADE49Nj SaaQ== 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; bh=rjARCe3NpsJLpu+gwm8Y4x+0pJknacrTsP46NqsklWs=; b=nFnu5YlApaYHf6TqTDNsiCX0njj703MzmQb4nZASIUZuoWQQg2qAwhvm0EmG8LoBYU RAb4255mwVUJS8fkTcvJ9WucyK1MoZ1zAIYS9Q9Z90DXeREbFzft+m826bx8oiXmDrAE NQLrKXBWCK6K5R2pCXlWNzRK4gZjmW335Ms71K0C0IqwDt+5BWN6AXCWTsE7Bil9iBkJ JSzf+oigb1ODUi2FxKDgoy06CBuwQi4sSc+sNaTVVr8/N4PEfpLbFqH6Fa2aAl2hk2Dm 8UqbIdqVIUMW57LsK+oVhX0Zgbko93dwLK1326iMN34IYIyyWrHskoWa57HDMWfGPCJo p4mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=JGD+vdcz; 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 l5-v6si8402419pls.13.2018.09.07.03.11.05; Fri, 07 Sep 2018 03:11:22 -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=JGD+vdcz; 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 S1728867AbeIGOtH (ORCPT + 99 others); Fri, 7 Sep 2018 10:49:07 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:38093 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728769AbeIGOsv (ORCPT ); Fri, 7 Sep 2018 10:48:51 -0400 Received: by mail-wm0-f67.google.com with SMTP id t25-v6so14025874wmi.3 for ; Fri, 07 Sep 2018 03:08:37 -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=rjARCe3NpsJLpu+gwm8Y4x+0pJknacrTsP46NqsklWs=; b=JGD+vdczikrboApyovvWow0pnAnzkJz0ImUB1OKO7J6WzuO1DV32poJqARyVCHAT4W 9oJqnM42O2El0bVSTuFljdRfZZIjvgQmi+/hWuOUHYNv3wru2eluY4AmvJf6Jk1jdoTO m5Al/MYjbFknubjNUyjfSiW8IcaR5CKY1lWcAtc7UVUHVYFKUPR2A7zqJ3JKDHVB/pQZ i1+Cj4KCQLvusrX6PWxX/2YjqTAZilzQHWTmysLBMTnUDvBZdXOw+/NfjgRwEBoMFIUr T0KZAFPvSYxLE8hOYpryEJgbAWSG57sqr2etvyjPsj+lg+QngzHPPeV0q28GKHgJuBjw 8uWw== 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=rjARCe3NpsJLpu+gwm8Y4x+0pJknacrTsP46NqsklWs=; b=nWFSt5I6RpJhwJn5w3atuP3yAtbuwRYuRazv1iZsu2ZDaWTTjsa78MD6YSUOeJW87V zaAh6TpnDXThYcISC/h4SInWiGacn0BdHgD1wPt5RypWrb7qBHi46y5PP8w7+xQ2Dk0C YlZncR7qFv3LJkj9rJT2CPQcD3KL7hQV+LF04+7ITALwyzypok+aYhdknT2SAwHc83vm BLJf49Xb/Dt3Iirljrhxp9dx3VPg1eoNV63BM7VoSoduL8XGQeRBcTDRKL38DZNXNIXP sdXDvVrUs5WkwSBVVnZ4k1IE/MOmdsQOZGGYvphTNZyjv4sCFpR+aguQbXEAomJR3pn9 mkSQ== X-Gm-Message-State: APzg51CYxUcY0kWhsw57s1D7imgx6tDGadNmGIPC+qOfbDett4AOY+hr vUjr+YAYKL90uW2WhYSVZZimuA== X-Received: by 2002:a1c:7f93:: with SMTP id a141-v6mr4825953wmd.45.1536314916701; Fri, 07 Sep 2018 03:08:36 -0700 (PDT) Received: from brgl-bgdev.baylibre.local (AStLambert-681-1-83-232.w90-86.abo.wanadoo.fr. [90.86.25.232]) by smtp.gmail.com with ESMTPSA id 72-v6sm6631619wrb.48.2018.09.07.03.08.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Sep 2018 03:08:36 -0700 (PDT) From: Bartosz Golaszewski To: Srinivas Kandagatla , "David S . Miller" , Mauro Carvalho Chehab , Greg Kroah-Hartman , Andrew Morton , Arnd Bergmann , Jonathan Corbet , Sekhar Nori , Kevin Hilman , David Lechner , Boris Brezillon , Andrew Lunn , Alban Bedel , Maxime Ripard , Chen-Yu Tsai Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH v2 14/16] Documentation: nvmem: document cell tables and lookup entries Date: Fri, 7 Sep 2018 12:07:48 +0200 Message-Id: <20180907100750.14564-15-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180907100750.14564-1-brgl@bgdev.pl> References: <20180907100750.14564-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 Document the new nvmem kernel APIs. Signed-off-by: Bartosz Golaszewski --- Documentation/nvmem/nvmem.txt | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/Documentation/nvmem/nvmem.txt b/Documentation/nvmem/nvmem.txt index 8d8d8f58f96f..fc2fe4b18655 100644 --- a/Documentation/nvmem/nvmem.txt +++ b/Documentation/nvmem/nvmem.txt @@ -58,6 +58,37 @@ 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(). +Users of board files can define and register nvmem cells using the +nvmem_cell_table struct: + +static struct nvmem_cell_info foo_nvmem_cells[] = { + { + .name = "macaddr", + .offset = 0x7f00, + .bytes = ETH_ALEN, + } +}; + +static struct nvmem_cell_table foo_nvmem_cell_table = { + .nvmem_name = "i2c-eeprom", + .cells = foo_nvmem_cells, + .ncells = ARRAY_SIZE(foo_nvmem_cells), +}; + +nvmem_add_cell_table(&foo_nvmem_cell_table); + +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 foo_nvmem_lookup = { + .nvmem_name = "i2c-eeprom", + .cell_name = "macaddr", + .dev_id = "foo_mac.0", + .con_id = "mac-address", +}; + +nvmem_add_cell_lookups(&foo_nvmem_lookup, 1); + NVMEM Consumers +++++++++++++++ -- 2.18.0