From patchwork Thu Jun 28 14:32:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10494151 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 63A5A603EE for ; Thu, 28 Jun 2018 14:38:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D8F42A0A4 for ; Thu, 28 Jun 2018 14:38:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 41E472A0BE; Thu, 28 Jun 2018 14:38:57 +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 DE43F2A0A4 for ; Thu, 28 Jun 2018 14:38:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966634AbeF1OdP (ORCPT ); Thu, 28 Jun 2018 10:33:15 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:50702 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966614AbeF1OdM (ORCPT ); Thu, 28 Jun 2018 10:33:12 -0400 Received: by mail-wm0-f65.google.com with SMTP id e16-v6so9934788wmd.0 for ; Thu, 28 Jun 2018 07:33:11 -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=g7UpIifBzzlHofhCVWyJaw6cfbiRR9ZhvkhoeVpGg5M=; b=gVdyASm30ArpJozKmUzNuCS5xPa3DEinEI1fRZlWr5AaRZovZ0v31zLxUbDBgm0RRM fMXsYziP0C5mH+m7NhoR0wWc7vy2n1MQw33PayAG3rGkVZi3BywV0jX/iof9nSlVYcal kRMW0ULXbt08cQyuhFt/NQmAD5T4ThoZ0fN+pvVitC8Jp5VUZcGZ6mlTdodoXULj2zfW VBC+BxIB95gQclaFtaWXMfqxkiH6N1p522wY5kQTEAVX82xTu09Xbhsu0rhiljf60cdY WHjvwZaAHYpfwbukNSTcez8OMYm+Xk8q6yuDEv0pggj7Af0mNTAG3uegGKbQKQYNB1Gs n4Mg== 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=g7UpIifBzzlHofhCVWyJaw6cfbiRR9ZhvkhoeVpGg5M=; b=O9mIQrHn1dmZIKZUeovy103MbDzpqel+k3y68IblUEhuFh82hqQhj83gvYBOsZ5Ggm KQw/FvhqupoU8jG3KB0OMgzb5YHqAe//1gztEHYU2oO/qIAcfGS3m0ODZk+Y2WoLLoEe Hcmpn/RpL2m0wU2uRvPQ9btL4YHUc2WPTqhblavawPRz78ljGAdXUy+arH0TZBdWPNOA 2milnCb82mciJP1PJmFqtYsObcYktIgLp58xGdfEvt3a5FzOKesNqsrcZA7X9Jiw6mrB ZIIQfHlmDZJ18+Fh0HO8WBzMq7+42y/FtjEHqzyvWSWhBZAxiTrA8zjgwbWproO/Amzr FAxg== X-Gm-Message-State: APt69E3J01YPQPbe9VLNNpEuMtaUQMaaI78mXCib8Qxr14XRdV3Fc1BP zophv0MJPOlYD2nA7UoIdL1hLQ== X-Google-Smtp-Source: AAOMgpdTEMBWoO1krAiLbVwisFuV3wHT7CWPj3omeQCBOn8xuuK7ky8KMrzXFboLx8ezS4SWgLUrEA== X-Received: by 2002:a1c:aa12:: with SMTP id t18-v6mr8180543wme.54.1530196391269; Thu, 28 Jun 2018 07:33:11 -0700 (PDT) Received: from brgl-bgdev.baylibre.local (AStLambert-681-1-87-41.w90-86.abo.wanadoo.fr. [90.86.29.41]) by smtp.gmail.com with ESMTPSA id 4-v6sm8037499wmh.14.2018.06.28.07.33.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jun 2018 07:33:10 -0700 (PDT) From: Bartosz Golaszewski To: Sekhar Nori , Kevin Hilman , Russell King , Grygorii Strashko , "David S . Miller" , Srinivas Kandagatla , Lukas Wunner , Rob Herring , Florian Fainelli , Dan Carpenter , Ivan Khoronzhuk , David Lechner , Greg Kroah-Hartman , Andrew Lunn , Jonathan Corbet Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, netdev@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH v3 02/18] Documentation: nvmem: document lookup entries Date: Thu, 28 Jun 2018 16:32:28 +0200 Message-Id: <20180628143244.4561-3-brgl@bgdev.pl> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180628143244.4561-1-brgl@bgdev.pl> References: <20180628143244.4561-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 +++++++++++++++