Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3604602imm; Wed, 5 Sep 2018 03:00:00 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbHWti8Qv84mDfb4RbLCLUGCUBU3fdoP4xq2rFikCAXkV4Yk8APjHbPiyudb122mnqy+V3f X-Received: by 2002:a17:902:694a:: with SMTP id k10-v6mr37467076plt.166.1536141600772; Wed, 05 Sep 2018 03:00:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536141600; cv=none; d=google.com; s=arc-20160816; b=qYt9s/eECjKTvqBu/tu0vpEIgSfXfTnm5fu0rFmQfrAelLeQZHH6ciXKn00myL5OJs Q+iTX7YSeuSD6K6Px7dVI/xEoPezz9lAtc02uUui1iqwbeor4x1vh/ZB6fcAxLoyrkA7 v5jRMbatkpZmKiRBWii9hjZU4lb0Er63KKCwusjKrRybDw+J7kEOAZ7DlQ3zqK3YZmJy BGIknh01BCrwa0YMXHuoerj1ZZDq3pYh0za0vifiuxO6az7DLcY30YabP//hYSKzKcEF ZgFlwEtVrOtOP3+ssg/gM3IAq+ibx1Gz8DUULuKmJcY/Q1B1Fz0edMQKewwqPypSFYEp 5DNA== 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=u/vGnWPAfFIzYEkGzNSLnF1qQXU18MToxRtfXu+i8Lw=; b=gKQ/qPF874JSNMKxEqIk0nj38eM6UMtLxrJvhAamYJl8/g11/2FNJ0MWgdoj4pp+SK gw17n+uDWPvE8r4GtVXcp86CHwZ3hU1hWGGu7rt+5N34+0icDNZWgF9zN+GjBHbhXrUB u9kZ1/epeEMjdQhl0vwFm+SDgd/RKM+458u+PMQgcKW0OiJ0BdJxvbzuarKDJt/RZ17b fGA5DvbcA/xS608xXN87xgPHQMkZl3ZINadVjLHlRe55PNP3vVloryKd1kaZ34Fr9COy h0d4iBzOZlpq+jk+jiCT78+Zm85nsmc8UDxXNNmdAG+rqltpW6kfsr8oanVwG1YDgzy9 ynrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=AFOtynpe; 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 r29-v6si1692606pff.24.2018.09.05.02.59.45; Wed, 05 Sep 2018 03:00:00 -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=AFOtynpe; 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 S1728423AbeIEO1t (ORCPT + 99 others); Wed, 5 Sep 2018 10:27:49 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:40632 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728160AbeIEO1s (ORCPT ); Wed, 5 Sep 2018 10:27:48 -0400 Received: by mail-wm0-f67.google.com with SMTP id 207-v6so7001087wme.5 for ; Wed, 05 Sep 2018 02:58:20 -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=u/vGnWPAfFIzYEkGzNSLnF1qQXU18MToxRtfXu+i8Lw=; b=AFOtynpeAfIILSknYGLsIURIbLtuFfq7vbabvPnCn/wydhZu/7W8BGrhhByinYP73M C8VRgtcJpZpKXlVbJdXTS2qmVbsiAal52V9xvIE+cd+5Ktc8pvjvHpA+/KOYzUTjoTUY eVVGdrSLj3WbqnGU626M6qDY2KcPJI38TQnECU8SFaO/GRqgc7iCXLqEz9qcefveH7FG V06HKBeWJbIIZWUcMyS2OoyiUkG1r0BcvlMluWq6T4EzjbxXDL+RwdqamI9mVmyus6CJ 94hLZdJX5rFYPNivyAetTVBjAaoAoCXHJJzIdBrlJ52LaB9ULjq0Y+cVmgsuwCirsNWf M/vw== 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=u/vGnWPAfFIzYEkGzNSLnF1qQXU18MToxRtfXu+i8Lw=; b=sLGXXtXh4cH2KaHE3p00YbokDhncx8lzTl0+fBRmEN2nMkv3kOdIVfYc5gW/FVqRS4 kXJ7ABzS0fn8fGi8jVb/CWXXamTqxUYAVlEmgTEaPlf5DCUVgo1q/tYSo59ZJ6H5lrlM 5wnDxWFYX3LsfaQ9kan0X2OXlNTr67NTSnX6O8u4h8SbapP0zBNCsRB038mC8RtDY0K0 uQ+7+1t/UagiE4dxH3yvT5FazPU4EvQXGafoTo0fvfKmTBvdSSe6n5d14qVM9Y5i91xW 9JdqmXbOvDVHPgNUa3e5MZMBI5qUvxPtFW8K/eME3c8Rou2M+dJGZn7Jnszox3ENfczx fQJA== X-Gm-Message-State: APzg51DrHafXdZc3QPHZCf6YimAuF/K6+6WKbKU3ZagvIE9lSBgBxBQL w6c9bb9FUmg6y6aSJs0QVU7X6Q== X-Received: by 2002:a1c:578a:: with SMTP id l132-v6mr5296997wmb.16.1536141499343; Wed, 05 Sep 2018 02:58:19 -0700 (PDT) Received: from brgl-bgdev.baylibre.local (AStLambert-681-1-33-235.w90-86.abo.wanadoo.fr. [90.86.152.235]) by smtp.gmail.com with ESMTPSA id l12-v6sm2127815wrv.29.2018.09.05.02.58.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Sep 2018 02:58:18 -0700 (PDT) From: Bartosz Golaszewski To: Srinivas Kandagatla , Joachim Eastwood , "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 Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH 12/13] Documentation: nvmem: document cell tables and lookup entries Date: Wed, 5 Sep 2018 11:57:37 +0200 Message-Id: <20180905095738.26406-13-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180905095738.26406-1-brgl@bgdev.pl> References: <20180905095738.26406-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 | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Documentation/nvmem/nvmem.txt b/Documentation/nvmem/nvmem.txt index 8d8d8f58f96f..2cb01cdf87c8 100644 --- a/Documentation/nvmem/nvmem.txt +++ b/Documentation/nvmem/nvmem.txt @@ -58,6 +58,36 @@ 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 = "mac-address", + .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", + .dev_id = "foo_mac.0", + .cell_id = "mac-address", +}; + +nvmem_add_cell_lookups(&foo_nvmem_lookup, 1); + NVMEM Consumers +++++++++++++++ -- 2.18.0