From patchwork Fri Sep 7 10:07:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10592033 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 14E0514E0 for ; Fri, 7 Sep 2018 10:32:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 02C012AE03 for ; Fri, 7 Sep 2018 10:32:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E9C932AE24; Fri, 7 Sep 2018 10:31:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 858CA2AE03 for ; Fri, 7 Sep 2018 10:31:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=6rqIHAVz8dCEdzoedI9vEAJiPyDTyvIHPrjWfOPP8HY=; b=cPElrNYNLNl8xQdDhqyjSEzfJD HjAiGZUH2emhlgDwyAlyM7w/AhBirtNirNhY/AtGhy6gtRhV1TW7hN/Ds66mblRvVXpFPMnqhPwbL cOdISM/n0kQQKRVXvhEUcmJmG/60pgvVWyXdGRS/ab67pcxqyFawq6SRSMxDKWWc4JnHgNG6POQFF 59MHm3kq3r+vi6y7n1rzm29yIWW+Jl0Y6s0J43CBFSLUa55Si6R/pQSnlZwOgozlMMDJYaqGk1uRR rB2KSQsDwhHIY6YoUAWDuzkpzE1BTZhQGnkWu8yWvb8EGoM0fc+ENp4Ht2JWqaHG5y6fUkBDoB+h2 X+ftPHMA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fyE3H-00050s-Rs; Fri, 07 Sep 2018 10:31:47 +0000 Received: from casper.infradead.org ([85.118.1.10]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fyE2W-0004Pm-VB for linux-arm-kernel@bombadil.infradead.org; Fri, 07 Sep 2018 10:31:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=rjARCe3NpsJLpu+gwm8Y4x+0pJknacrTsP46NqsklWs=; b=SNb9S/KZwdNNYFYwBbzr7FWcp zo7yZ+wTv7RYAfERvfH2fsUmKPVQullxbjFZjW+0Nk47XujySRw01ZKxmDQwE5SSPMDU+mGc6m+IQ QDsHW196fTIQ1oR5SZFlwqXAtNiakyl70JWrp+SpfTPJP9ZmR6bigo845Enqnh14z2/8xIh8uDuqD b0CdeRskFNsDfanU6+BgpR77hoz3um0S5Qyq85Az5n5HzrIiOhgCpqMoSgmCDMjsNDgWAvQbB0XBy NxGNB+nRHXtuEONC2O20h+biT891bRyOSggFew/oycB8QZ/AxHK81UjrzQmmnZdtwti86jnaAFZ10 o8g4dFEXQ==; Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fyDi1-0005wi-8T for linux-arm-kernel@lists.infradead.org; Fri, 07 Sep 2018 10:09:50 +0000 Received: by mail-wm0-x242.google.com with SMTP id r1-v6so16528673wmh.0 for ; Fri, 07 Sep 2018 03:09: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=nOIHIN3Yaqb7Y4IFxc3x/sGk0Dg4uhNAdBHozFArd5ln8nr0eJeRbagbqC/3rGnBJT xO+/I7xa14JI+C8G2+/ZDqQ0kxbWWPpHjBnUbZY0P3lwVmjjEaGZA+yDfw4x+RN21C8u YduK3qQzNqWERwV7qvdRZX7r5qpr0ZZb8BJjpUAieLN0RRZdC7fIk7Lpwu3LLVccwzfy e9S6xNz+E1WxY0T3IXi2WKERDlZGxYcjB73cHeWxnjV6GyXGQ8zry99rKvPzBmBVargo 6ZT9MIUYtcDjg62hJRM6bS2w6xiie5KkLeQDSffheyz01h2AD9GmKZsJQXSHib0RiZ0M 67IA== X-Gm-Message-State: APzg51AwC1Pq/BbWb3JuiyH6Pmc/0fkOJEKRs5mm/frTCXxI2RAewlbj 19dj9QECmFpTplTTSzInaSG2MQ== X-Google-Smtp-Source: ANB0VdaeWAYzfcGsVF/mkA53G39QTZNQ9p4L/aP28vkS4LM/gh08yPlu9mL8Ht3+wc7ew+p2LpA12g== 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180907_110949_292130_AE5D19AB X-CRM114-Status: GOOD ( 16.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bartosz Golaszewski , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 +++++++++++++++