From patchwork Fri Nov 30 11:53:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 152533 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3562754ljp; Fri, 30 Nov 2018 03:53:49 -0800 (PST) X-Google-Smtp-Source: AFSGD/Xf8iQff4vQ0sVySqLvxlU64T48ucjtIXQn1I+gWu/9HiQQ1B1uHAGtWkKkJuzNcULIN6Md X-Received: by 2002:a62:1c06:: with SMTP id c6mr5203126pfc.157.1543578829282; Fri, 30 Nov 2018 03:53:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543578829; cv=none; d=google.com; s=arc-20160816; b=xVSi1zGktqA2lcPu0uovjPymn0LVejTOdykSGKH85eKIXKfwDLqXIMHvlubrsX3Rnz A7v1ZLRQ7mBpccZxDQNmxDlkyS1XfYrKDWf9MnhnKfmgxfVAmPTjB/ZfJnd56k54Ozuk lxf787XS23+Xf2irxcSxdMo0PSegGQRgEu0FqU78pSToJH9oZLB7PHkHwR6sTOw2Ax2K CwPInY8aDQPBkVNEko0LzrWsLfElPH/PQ9Vi67JipJVfVZDJnsdGNG2OePkG17c/ixYc Ct8SCyInC61WThWZ03eW/UTOFP6qju8pm8gakELgQUK7MgVlbjL8NsF6uUPg+shm32D/ OSzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Uj1/fNKFSJQYG76kuDm1FhuBMKBVCAd9YSvKr8WrTa4=; b=p/AhP9/iKFWG0xyhGcGCaZnbDQnJP5AVLQZjv/uBrzTL3E83oiUfK7UAnWDmMaFWrK ivlYC5rZVxUQFd8nAzCaBpMyrp+KO9R9S6H9XMcuAvJ6KRlMllGg5K94542bxlO6DU3U V3bVlumI+ZFkqA1KLFai6TFUhxqmwgBvMXvEKDwTu0jPzeiOOIC0PUUHG1cm8xd3U+1L STeMCaVjrps8hmwvBmHEuFmvjLQVksTkEhpTTOdoF+VEHaAbNpYUHXLRRqOx4yHR2XQ0 u/H/h0wGq2Chje+71bJGNuGGQETJcssmwfnHcjItZfxBZFMMD0wLbZMNuaN4hKdr7/3Q ILrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iGi6bGe9; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si5244625plo.195.2018.11.30.03.53.48; Fri, 30 Nov 2018 03:53:49 -0800 (PST) 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=@linaro.org header.s=google header.b=iGi6bGe9; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727159AbeK3XCs (ORCPT + 32 others); Fri, 30 Nov 2018 18:02:48 -0500 Received: from mail-ed1-f67.google.com ([209.85.208.67]:37013 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726572AbeK3XCr (ORCPT ); Fri, 30 Nov 2018 18:02:47 -0500 Received: by mail-ed1-f67.google.com with SMTP id h15so4617823edb.4 for ; Fri, 30 Nov 2018 03:53:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Uj1/fNKFSJQYG76kuDm1FhuBMKBVCAd9YSvKr8WrTa4=; b=iGi6bGe9CChIjYcRzSpisHvA43kjJnB48BH0bQ/6M4hwHFGilDwB9KPDp3etl5AVpu 9nakJgnDfy9X2r86z9ncUSuhKONAlFwARHER2mF0UFxI0+wkv4li56tGRR1ixi9tN0Nr kEulfebILV24arikfS4nhFXI7AqsjqP4I1i54= 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:mime-version:content-transfer-encoding; bh=Uj1/fNKFSJQYG76kuDm1FhuBMKBVCAd9YSvKr8WrTa4=; b=KydOMvz5MNGgVMEnOVXDlfiXOSgUNPMgoxPZ9pTQ+dHs1ncGIpLLWJFNsGJS8rRfnN 4H1WT6Gb8CwByf7VEZXZyUiRX+u1HoELTGnUgE9GpL3GlBw1uCMyHUqPds+BxmDTAE3h wZfpNIy+FXDNlmlDGlnot151dk2D5lxiMiPig3A52tQKtikgDIw+ea+Ws4l/L21+L9HW lT8k3F3OjltfSRBoH9D2DXPIcmZo9uhZsjxDNyp/A/YcIY8wY+DxsYwW1suk99iAvwqK zvkgJKHzXikDHxcart6WKFigMDNUSJGz0LmTpl0Xv+RHdQBtfnorBkuywnxRcVa8631E R0FQ== X-Gm-Message-State: AA+aEWbMgaALYvAzFBiIBX68tBwLIwqP7mVMLbKZ1ZZn6hqUnd2QP9Be cVjX+HaSVSgAG78G9JS7kihU4g== X-Received: by 2002:a17:906:154c:: with SMTP id c12-v6mr4477480ejd.69.1543578824107; Fri, 30 Nov 2018 03:53:44 -0800 (PST) Received: from srini-hackbox.lan (cpc89974-aztw32-2-0-cust43.18-1.cable.virginm.net. [86.30.250.44]) by smtp.gmail.com with ESMTPSA id t10-v6sm767932ejg.41.2018.11.30.03.53.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 30 Nov 2018 03:53:43 -0800 (PST) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Bartosz Golaszewski , Srinivas Kandagatla Subject: [PATCH 6/6] nvmem: add new config option Date: Fri, 30 Nov 2018 11:53:25 +0000 Message-Id: <20181130115325.16539-7-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181130115325.16539-1-srinivas.kandagatla@linaro.org> References: <20181130115325.16539-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bartosz Golaszewski We want to add nvmem support for MTD. TI DaVinci is the first platform that will be using it, but only in non-DT mode. In order not to introduce any new interface to supporting of which we would have to commit - add a new config option that tells nvmem not to use the DT node of the parent device. This way we won't be creating nvmem devices corresponding with MTD partitions defined in device tree. By default MTD will set this new field to true. Once a set of bindings for MTD nvmem cells is agreed upon, we'll be able to remove this option. Signed-off-by: Bartosz Golaszewski Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/core.c | 3 ++- include/linux/nvmem-provider.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) -- 2.19.2 diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 22345e65a301..f7301bb4ef3b 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -635,7 +635,8 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) nvmem->type = config->type; nvmem->reg_read = config->reg_read; nvmem->reg_write = config->reg_write; - nvmem->dev.of_node = config->dev->of_node; + if (!config->no_of_node) + nvmem->dev.of_node = config->dev->of_node; if (config->id == -1 && config->name) { dev_set_name(&nvmem->dev, "%s", config->name); diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h index 5b2dd0a987d2..fe051323be0a 100644 --- a/include/linux/nvmem-provider.h +++ b/include/linux/nvmem-provider.h @@ -38,6 +38,7 @@ enum nvmem_type { * @type: Type of the nvmem storage * @read_only: Device is read-only. * @root_only: Device is accessibly to root only. + * @no_of_node: Device should not use the parent's of_node even if it's !NULL. * @reg_read: Callback to read data. * @reg_write: Callback to write data. * @size: Device size. @@ -62,6 +63,7 @@ struct nvmem_config { enum nvmem_type type; bool read_only; bool root_only; + bool no_of_node; nvmem_reg_read_t reg_read; nvmem_reg_write_t reg_write; int size;