Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5395621imu; Tue, 13 Nov 2018 06:02:58 -0800 (PST) X-Google-Smtp-Source: AJdET5c3eSKeHvvaTmQFYQVOuYfOG2ZIvTbfwq29vnbiwK5pM56VV9jos5rsalN/lM8ONodeAZjp X-Received: by 2002:a62:2741:: with SMTP id n62-v6mr5356538pfn.138.1542117778266; Tue, 13 Nov 2018 06:02:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542117778; cv=none; d=google.com; s=arc-20160816; b=Ioo50hMkcaGTxzZu3/uLWZAvtw+YMB4sozgVULUysh9MMpBQ1kn3Us76Q27F4pWNls OW0UGidietYYwpYTJtKEUWYuimWdXnU1+wrFmYVtQ/byGxTtRa3B8OMUBa8LMbrUs2ZN 4z5xHhqnu29mZW0Iy68g+UfE46F4ujsUHLDorxnC2V9cYTaiu8BEVv340+iIa9yr3OeB 5afdKYu4ety5HSecbYONJ/wPXalbZQjcBp5sUAVYpy9YVe8knpjxkWUt3kYfrXervNEW HQ6R2uQxU4n9mGoEqbCEco6sepUUPtizmViHYA3tfQgTj5i4mGMSUntB4n7GtvLp5xcs yNnA== 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=0uqZU8gDHiv/neEGi/hrgDK8MU/UOgRvLZjvxfNOd/I=; b=MJt5byjSvZ8BAIhACsSR5AYGmQtSGD/dRvTuv1zmNyFRG0jcnFysjOQSlYAVcy52ix x0vmlbv6orxmK5rLNXbbjhUECp1fuM/lD0d1MHw8yLLNo7Ixsrs2iqqE3yKuDO67SWCo 7I7Q5QmUBmHHmGeUfuRBpGAmQzN1KqhpWxzkDlXi8YuOwlngP4Ezg6FSM1YiP71Qb4fs eNgIpVyMraR3UnrjhjIaUWoUA4e3UchpMoiXBIaECqMMRO09bhiAeG0xeP+fOch3lVA6 KpjczIvNMVZsfXP5JOyJ3Z6dFjyYazI74caC4Fzpxh1r1obvcvsgLjThd0v6La8wYwVg uqVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=pXLEyYVi; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h33-v6si16941242plh.390.2018.11.13.06.02.31; Tue, 13 Nov 2018 06:02:58 -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=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=pXLEyYVi; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387681AbeKNAAO (ORCPT + 99 others); Tue, 13 Nov 2018 19:00:14 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:36543 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387583AbeKNAAN (ORCPT ); Tue, 13 Nov 2018 19:00:13 -0500 Received: by mail-wm1-f68.google.com with SMTP id s11so2180370wmh.1 for ; Tue, 13 Nov 2018 06:01:55 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=0uqZU8gDHiv/neEGi/hrgDK8MU/UOgRvLZjvxfNOd/I=; b=pXLEyYVi7xk0SDGCkD5Y1ijc20sYg43PO7FF5Ii9S7OMZMW80DFLiF+kCgRmUqxyiR o3bcuXYEa54fs2rggnBxWAa6iAM1kzvQVzhkWPUHnelnFzHhILejvVhWx3g3manDZ4xt Gfnhk0eLmrS2IAfQOJzCRBqP0kv1oT19u8VW0XkrHrnp+fob5e5aBYD4fbbBooLGPnOR a+0gn4pB9BDdohjzrBwvryRKmanWXkSSMBqmskFsDMAD2SaaseafMiaCt4zHSYjLLWbc C67jmWgjPFs5Lw0Css3+YkWBhQHRvMdQbfWwM99LWk0Y0ZB1eZg4dXVgb1y4EvJWfVEf fG8Q== 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=0uqZU8gDHiv/neEGi/hrgDK8MU/UOgRvLZjvxfNOd/I=; b=Bvq1y5ZJ+aINeVvRwtkZFq31diaFUMNK+yU6/ZY5QMVJIWbddJVw4m7o/JLLJud23E mbhqR1WAp0rUamS+faWpihTaSn76simu8vxO197gGfS/HALjEw+B4xvY6iNDOpVwMCzI 26ll6mIJ7W/1BaQGKosgya/FVoYj2xEKOQnJHW+DQNRn2SlZQjWP8+lOE5x61rKcOUCZ G1bWpudR9u3MCtT7/s9tEbR6f5jTkQhcU+OFQE1kr93KPqhfBTYp94ivzLBKnmqOzTnA lqmqvF8yUobHipxJ1mhlHVUtIYe2p159BWER/RlrFc9kDuAi8g05w/gXwgUuS+xdVlpP 6q8A== X-Gm-Message-State: AGRZ1gKVawUf8gEvOcA6zsQAM3tedglVhu4AQn82xYMn7nyk8q8qEgqE Y741/73AH8m27+TC8qRHjPHe5A== X-Received: by 2002:a1c:7fc1:: with SMTP id a184mr1113108wmd.55.1542117715063; Tue, 13 Nov 2018 06:01:55 -0800 (PST) Received: from debian-brgl.home ([2a01:cb1d:af:5b00:6d6c:8493:1ab5:dad7]) by smtp.gmail.com with ESMTPSA id m69-v6sm16604122wmb.8.2018.11.13.06.01.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Nov 2018 06:01:54 -0800 (PST) From: Bartosz Golaszewski To: Sekhar Nori , Kevin Hilman , Russell King , Arnd Bergmann , Greg Kroah-Hartman , David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Richard Weinberger , Nicolas Ferre , "David S . Miller" , Grygorii Strashko , Srinivas Kandagatla , Andrew Lunn , Florian Fainelli , Rob Herring , Frank Rowand , Wolfram Sang Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-mtd@lists.infradead.org, netdev@vger.kernel.org, linux-omap@vger.kernel.org, devicetree@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH v2 01/25] nvmem: add new config option Date: Tue, 13 Nov 2018 15:01:09 +0100 Message-Id: <20181113140133.17385-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181113140133.17385-1-brgl@bgdev.pl> References: <20181113140133.17385-1-brgl@bgdev.pl> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- drivers/nvmem/core.c | 3 ++- include/linux/nvmem-provider.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 9b18ce90f907..ac7971e8154e 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -604,7 +604,8 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) nvmem->priv = config->priv; 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 1e3283c2af77..e53545e9852b 100644 --- a/include/linux/nvmem-provider.h +++ b/include/linux/nvmem-provider.h @@ -30,6 +30,7 @@ typedef int (*nvmem_reg_write_t)(void *priv, unsigned int offset, * @ncells: Number of elements in cells. * @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. @@ -53,6 +54,7 @@ struct nvmem_config { int ncells; bool read_only; bool root_only; + bool no_of_node; nvmem_reg_read_t reg_read; nvmem_reg_write_t reg_write; int size; -- 2.19.1