From patchwork Wed Aug 8 15:31:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10560261 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 C20A315A6 for ; Wed, 8 Aug 2018 15:37:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AAAF02864B for ; Wed, 8 Aug 2018 15:37:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9C95528574; Wed, 8 Aug 2018 15:37:50 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EDC3A2A9C3 for ; Wed, 8 Aug 2018 15:37:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727554AbeHHR57 (ORCPT ); Wed, 8 Aug 2018 13:57:59 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:44857 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727573AbeHHRxk (ORCPT ); Wed, 8 Aug 2018 13:53:40 -0400 Received: by mail-wr1-f66.google.com with SMTP id r16-v6so2382144wrt.11 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=peINgKXOSVretkUX2v5uqUIKvyCB/ZAzZBkQWI+BDtx98C4PvId4ceMiWC4UHUo9lj wDMCPFI4IPp0joE7qoErlXgtBTo5UlDv5O5S2IkRn1TlOu6i2GlZrLTEW+Qs7SEO/Evp eBEIzXFG9xChbuowq2zbbnMEAJ+y+Fyg1veB6cuBE8PSIjFpP3mU9GQYiAKijGx7BNqC 0/MI05K+N7z/RMbmqMVd0H6UvYSDjaWBZRRzvAfMy5K3+4kTi14wFMNve7Z895HrfU5X 3OfjMF1Pg9L5zyaNiRCJPafU6EtWWoYcm97wkiJFN44KG5uiw81XzTG2VCEq5+gB+an9 tksQ== X-Gm-Message-State: AOUpUlGo6MEFIAlIEbajY9kzkjlfZhdeTAfmTOKTmciN8VqdZ4BzalZz zJGGwn03DVjGlpbmG6b2NYlW6A== X-Google-Smtp-Source: AA+uWPzXSa//8V3H1avfMZTefmddl6h0FyaPd0yH7CY96wAZDwMdcsR62BaE3h96tK/j1eDfbq7FHA== 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-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 +++++++++++++++