From patchwork Fri Mar 12 06:28:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 398927 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00, DATE_IN_PAST_06_12, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB1F6C433E0 for ; Fri, 12 Mar 2021 12:45:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 79E4564FE0 for ; Fri, 12 Mar 2021 12:45:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229505AbhCLMou (ORCPT ); Fri, 12 Mar 2021 07:44:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231698AbhCLMoa (ORCPT ); Fri, 12 Mar 2021 07:44:30 -0500 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56FACC061574; Fri, 12 Mar 2021 04:44:30 -0800 (PST) Received: by mail-wr1-x42d.google.com with SMTP id b18so4728403wrn.6; Fri, 12 Mar 2021 04:44:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=VI13v7WXCHyV5J1x9UibDqjD7a10mhiWIB5IsHD7pqI=; b=o5XPui/gukKRgc7PwBjmedNbk1silTZsSMBrZFwN59+1UnRqSRTHgMrsho3JGLL21s 1LXij9Esxn7wFm+eYTFhyiQzfwMxisfmrVzm7yr9JrBBVuRni6wuKmkOJ7XcXjCPck99 YHpI/i2s0vP5B0FVBlI4umrK9GTH5NW5uOQz2XngcxGQSHfob5nye5O/M7dZAhRk0r3W hf4rDf7trLqUmXy5acCE/3zMaOIbGvzR863EMS2BKJ1DiBGc66CC47HxCaNhGBOtukgw +t1cPmmjvY05uvE/MKWY6E7l/n1qjrSdkY+KHZaGJz0LLMoJ8PJQay5bqGgWCrvJ/kai Dn5A== 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:mime-version :content-transfer-encoding; bh=VI13v7WXCHyV5J1x9UibDqjD7a10mhiWIB5IsHD7pqI=; b=pXW5yU//uC1TCIq6UedRrtkBOTtFNUESUrOvRWNxFZwkzNK248R0HEDEb80FWLGBwQ dsR5JHZChlTbqjAUYN/HNDvG9Hdc9ZW/Elk+nZHMt4eGMF4LsdRljnXho88/F9pdvWr6 OL+P5TEO73v1NqErQfbAi8YPXjlqUXSVREQ2nHm4PyIbReidilGvTi8RBtMJ2vOLYX/3 oC9nVp12OAVlZ4KPkxZ9pQRVzRQZtw0gu8dJMI5KGfybgY+taRbumvI0rcrxQMRrVWsk cVtnWgk37cW3Nw8gGNTy4SLjUD4oxF3SY63BTSv30oY9FTPXEPmzCca4msUUTEqnzOf+ D1Dw== X-Gm-Message-State: AOAM533urRQCSttacOmkROArlJMDOTRCqQh8HPDCyEHBKKPMwnOsq+xu fv9q3zhCW2DR77o/8jlICZOSZUnliXs= X-Google-Smtp-Source: ABdhPJxM6NNpxowCaT6kxszVSN/rPkxCB9XCQ9dzbhnd8x3OlG4E0ebpRadAVgbmMVBfJ6FPU6/siQ== X-Received: by 2002:adf:fa08:: with SMTP id m8mr13984426wrr.12.1615553068908; Fri, 12 Mar 2021 04:44:28 -0800 (PST) Received: from Ansuel-xps.localdomain (93-35-189-2.ip56.fastwebnet.it. [93.35.189.2]) by smtp.googlemail.com with ESMTPSA id 36sm8213414wrh.94.2021.03.12.04.44.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 04:44:28 -0800 (PST) From: Ansuel Smith To: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Cc: Ansuel Smith , =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Srinivas Kandagatla , linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 1/3] mtd: core: add nvmem-cells compatible to parse mtd as nvmem cells Date: Fri, 12 Mar 2021 07:28:19 +0100 Message-Id: <20210312062830.20548-1-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Partitions that contains the nvmem-cells compatible will register their direct subonodes as nvmem cells and the node will be treated as a nvmem provider. Signed-off-by: Ansuel Smith Tested-by: Rafał Miłecki --- drivers/mtd/mtdcore.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 2d6423d89a17..ac1b4f176a17 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c @@ -531,6 +531,7 @@ static int mtd_nvmem_reg_read(void *priv, unsigned int offset, static int mtd_nvmem_add(struct mtd_info *mtd) { + struct device_node *node = mtd_get_of_node(mtd); struct nvmem_config config = {}; config.id = -1; @@ -543,7 +544,7 @@ static int mtd_nvmem_add(struct mtd_info *mtd) config.stride = 1; config.read_only = true; config.root_only = true; - config.no_of_node = true; + config.no_of_node = !of_device_is_compatible(node, "nvmem-cells"); config.priv = mtd; mtd->nvmem = nvmem_register(&config); From patchwork Fri Mar 12 06:28:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 398926 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00, DATE_IN_PAST_06_12, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 060F2C433E9 for ; Fri, 12 Mar 2021 12:45:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CDE5164FE0 for ; Fri, 12 Mar 2021 12:45:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231679AbhCLMou (ORCPT ); Fri, 12 Mar 2021 07:44:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229799AbhCLMog (ORCPT ); Fri, 12 Mar 2021 07:44:36 -0500 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6845EC061574; Fri, 12 Mar 2021 04:44:36 -0800 (PST) Received: by mail-wr1-x42c.google.com with SMTP id e9so1700142wrw.10; Fri, 12 Mar 2021 04:44:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0SX53bYeJpoRn/Rj8EJYnn/yWlrMIeX4TZ6gWcrZofc=; b=jKu8KqJ0S9Ti0089FwYbzp6PseVn8UWEuGVbAk2j8DJU7dQ52Xp1Ke51Tb+vGopIWC NmGxDUqN4/27ko7EM+tj4gS/Mmahh8EAKL+MV+CI7gKgsgW3LgjefxbPmvX/8rYjE3em 2M82od3nx6sLLXzceyi+BgkU2K81kkyyetjgZ185s7zYXZZcvKKOkLz68xyy3LTnjGXK wWeg/Gbg1eq7Yd6CzoPgizHJ+KYkusD2V7+KxXslWFXW+t33KR7SS4O6ghqH27gSmH55 6lmcaDGKvA5QDHhwQgGKxhrLgfvi3tqnvlLSVkiEIngWKX7VdNmflmqQAAdSrmfEflDO fRpQ== 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=0SX53bYeJpoRn/Rj8EJYnn/yWlrMIeX4TZ6gWcrZofc=; b=mh7ewHrbSYwbo2/iUShF/KvEGR6BBA4uIzoYx1pJvFCFHGdGJ00t0NMJVFkmImUzMy Og3Yyen+9rqnkEc0gwcYYTE8F7SbVi0ZUDL86jc0+WaUZSdQMu4EKrppoUBdpplYGQOk uGJymsh4FRBEDO73/DIN5cMt0lN7juwlSb7oyVg8U7dnVhZKt69urhpULFdW7APFInXZ SHIDSMhLrDQme6ooCV1ys+EX+wLepn3+YVpd62VmFaCGg3kH2gCw1SCKnqiKGN1E6G3Y hMI2eQ0QbBK8I771JUTB9mR3d4FfAielt+TkGtvU65wxJtPdM9XyU2xrKVK2y6KGVlT8 bf+w== X-Gm-Message-State: AOAM5312kQ+BllOZ6H9cCQfci69Z8T19WG2GEfTrLeCpjxTWTD6DxlYs Bz4F/sw0SNimll1en6FEVVU= X-Google-Smtp-Source: ABdhPJzrmsxMYLLRKM+pCC+tNbUyIbddF/llb1BgF89xo2TU++Xf8VCyIXJFgdHYoz16BqflKtnbMA== X-Received: by 2002:a05:6000:1363:: with SMTP id q3mr13859141wrz.74.1615553074983; Fri, 12 Mar 2021 04:44:34 -0800 (PST) Received: from Ansuel-xps.localdomain (93-35-189-2.ip56.fastwebnet.it. [93.35.189.2]) by smtp.googlemail.com with ESMTPSA id 36sm8213414wrh.94.2021.03.12.04.44.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 04:44:33 -0800 (PST) From: Ansuel Smith To: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Cc: Ansuel Smith , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Srinivas Kandagatla , linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 2/3] devicetree: nvmem: nvmem: drop $nodename restriction Date: Fri, 12 Mar 2021 07:28:20 +0100 Message-Id: <20210312062830.20548-2-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210312062830.20548-1-ansuelsmth@gmail.com> References: <20210312062830.20548-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Drop $nodename restriction as now mtd partition can also be used as nvmem provider. Signed-off-by: Ansuel Smith --- Documentation/devicetree/bindings/nvmem/nvmem.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/Documentation/devicetree/bindings/nvmem/nvmem.yaml b/Documentation/devicetree/bindings/nvmem/nvmem.yaml index 7481a9e48f19..b8dc3d2b6e92 100644 --- a/Documentation/devicetree/bindings/nvmem/nvmem.yaml +++ b/Documentation/devicetree/bindings/nvmem/nvmem.yaml @@ -20,9 +20,6 @@ description: | storage device. properties: - $nodename: - pattern: "^(eeprom|efuse|nvram)(@.*|-[0-9a-f])*$" - "#address-cells": const: 1