From patchwork Fri Aug 10 08:04:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10562425 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 D2DA090E3 for ; Fri, 10 Aug 2018 08:11:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C1B222B72B for ; Fri, 10 Aug 2018 08:11:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BEBF42B7F4; Fri, 10 Aug 2018 08:11:20 +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 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 552372B820 for ; Fri, 10 Aug 2018 08:11:20 +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=VLJ4iuMfi3bwjq1ox+IhPquwVE+OIz/5K7him4h4NCQ=; b=Lbp+agc0u23ZKgZvo+J3h0mmSg yN42Q3/mfH9ycgOXPDY7rrhzHCPsYUqUBATUlHagtn9LcNdKU/BLKyP8yEnvFUpoh8Q2V+Pxsw9qU kCDciEwA6whRtIYoe8YM3IuMFCY5yIo5ur7vw4Io9XzyU82iKRj9Hy65BDd+QwB+0puXfwGw1Y62a mCMzMwuz9ZEytpqhV59ZdOl/an+a3uD6Yj5IWqPetiusTEja+BvKMcJKcVjNtRu28thqyGjWR1H8p 3cZ7d0SoWjbwLfJrAskxbPS+R7FKpy20JlFF7b6TmoVNroy2Tz8niLndFsrIkc/+9l3tNapkQbABs 9ZsNQaNg==; 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 1fo2Vx-0000zb-Sj; Fri, 10 Aug 2018 08:11:17 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2Qe-0002Ar-FV for linux-arm-kernel@lists.infradead.org; Fri, 10 Aug 2018 08:05:51 +0000 Received: by mail-wr1-x443.google.com with SMTP id b15-v6so7446120wrv.10 for ; Fri, 10 Aug 2018 01:05: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=auDnQ2msgcUIg2cR1NJaWEIgp9qglPcIziHCsh4zH4c=; b=hyVrD2uPCuDfG/SIVDF3sBQ3x5jPiEIiYfLhv4zCCwnLblKSqKqaAzB+653FJmrvzf 0e7bBYw1HAepWkf2U4LVpYgUjfZrKoVVh4FsuGcBMtiS+/SWcQle/y6aNI/rL+0drHQg jcV8QsqKTyRZoOsyt22VpaW9vTwkAFYZTn1EnN/IUhBp0W1GI+T7fDyIzwF8CX0/JejB qn+I0si68PVnhgSRuSUiRLU6KdgC6+/mrYiJiPtsG7TV+4jK228jLAs+oFZgJk5AfIKU lxIvEZrz9jOSA4FcAwwpvSafLhEQSuDJiaUTmMC9+byu6RvzOqCz0+7HA0qUPdS3cEax mGZA== 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=He4vYb0/3/ANGBPa4qPsUKkP3d7uaJCvKNlHzS5qLoKKfZndw2/3tjr98iJHrHwX8O mGnzqhb9gBpeH9CfPZmtQkMFhZsRhdbDD/Fb2cbIk5zI+zVr87GDcVLWbNjtkTgUdcE1 eNwiOZe0dTwz7OBEIrJ1/bs/DikO0XzgJ/Bx9xuCYQyqo8sMsN4UGo9mEEt2kwTMia8b 5oeWdVukqd/H5bZeS5mW9hzdFMTZp/S1rt47g/f/fhlFqpcoQeNf+6cKoh3vBl16LFbw 3QWzFdA19igt/+gSE0gf3d0RrdO0DzQEMMPvMZG5tgGomlAaokOkttPj+BPYuAevD7yu leLw== X-Gm-Message-State: AOUpUlGb7N+wXRvY0BtMGlHtDXQSktlX/vtpwzVNQfaEfrJcKXzb3xeR jC0qx1SG2ZqNKCqVjiji20yB1A== X-Google-Smtp-Source: AA+uWPymFzn6I/ZI2lEGyhAt132NMNyj5wgE/WcirkCrpDDb/X28TuLJrG8472LzrmsGj41RTdm2uw== X-Received: by 2002:adf:c78e:: with SMTP id l14-v6mr3521076wrg.230.1533888335767; Fri, 10 Aug 2018 01:05:35 -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 h7-v6sm9546405wrs.8.2018.08.10.01.05.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 01:05:35 -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 Subject: [PATCH v2 02/29] Documentation: nvmem: document lookup entries Date: Fri, 10 Aug 2018 10:04:59 +0200 Message-Id: <20180810080526.27207-3-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180810080526.27207-1-brgl@bgdev.pl> References: <20180810080526.27207-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180810_010548_545456_6F0A2FA4 X-CRM114-Status: GOOD ( 18.25 ) 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: linux-doc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.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 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 +++++++++++++++