From patchwork Mon Feb 28 09:33:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 12762610 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 766DEC433F5 for ; Mon, 28 Feb 2022 09:35:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Llm8bdJ0/3+M0b4AAof4q805ric+Y1oqGvYyYfIoLcg=; b=fhkeJ1M93c6+bf F+wSRv9KJfplySpNM202JCTXC/noh4mUfNRV/ktgedwI4XqnZUBukrz06MThmDgonLHrKi+Uk0Dn0 9Duv19E1YpCddl8C/BGg7E5GVtkkaXCgC3dsRyfIbvGglslQ7CHXkjSj2uXR3SKHkI9aNL3nCMJs+ 9oqMeEQJvakJNwdC73qgSd0eqD85w79tWhC4yyqaDnpPwAnQ6w13GZMxR012nFTitoh/bWapzeWsu A9JiDxBV5H+B8iakfVd/MoQcLojF8FS1ZEM4wOJvjcPtzuvlw9L5dHp5JmYpl/f2uJckqxIhHLThD bj+wFrOEQN1P2Uo2X+Sg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOcPy-00BGxz-RB; Mon, 28 Feb 2022 09:34:11 +0000 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOcPv-00BGwW-LY for linux-arm-kernel@lists.infradead.org; Mon, 28 Feb 2022 09:34:09 +0000 Received: by mail-lf1-x12f.google.com with SMTP id m14so20274438lfu.4 for ; Mon, 28 Feb 2022 01:34:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=fyLAwYBTvyuqO87oNdeuHQ7QKOeWMlrnczfuq8lDfy0=; b=MAlC1PXvtBS4kESMFqvatJNemhkHIuJ8yqRgVhJGf32Vign6qvkBQuS3Kt5YPi4CwD Y67GrQ7yIdxljqpHi8DzBVgQf0TFQP3Pt8BVKv9d2rCEhK5m7lCvz8GhZbDuNz174bqO lYwBwdEioZYMRF9Ob6o4oBZifqogVhCu2WwtonGxFvdGCyH01FdXhz3vU3O9Lk2x7Iqz XIakM6YZK3ibXdACUqOi6J2Ajlqv7n9WvtZRgmtRGAtaOKEL3Fj8vKLOqbaWAqlB1oRJ cQNb5cGsoYsqQVNF9lUeq7ZX8jb8EXXO462z31eC9ZcrYbGCPURE17/w4Ss2fvtW5oHk L4jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=fyLAwYBTvyuqO87oNdeuHQ7QKOeWMlrnczfuq8lDfy0=; b=KEcwPjKbvZgIPJNojlQYR2RHcItYy+rLCOR1k7BAzJaNdXQGzxSSNWd7Q2j/3EENVM R4ZSfAyTQke2zpQPE7hHMhdl6dAtvLcfLDQ1HdY8cdlmznvDzn4p/2lyr/pfkk0lOGx+ yVPUInpxTwS64FD0KWeMJN8E/NuFU8OiZF/YtZaTYlOfXqklZ8ai4w9swjIOgV4EDc5e OkxBQP+JuOUgmsZcUJyJv2JkWWe0ZB5KKpTEUWaXpUFiiM1VXVeVoXztkWIndNmAlbMR eE0lmlqApJiuB+bNNzgfxQCYnCIgchqCGIiL/TDMO7uHvA8iIfK9x/2Wxso7l9cEvQ3c OBnQ== X-Gm-Message-State: AOAM530oKBaxexV8s9m4cWPkhL8hC5RTsLQvFMEuybu+vSjOrwDIM05M M3WYjpNsETmOhrds1LTXNFM= X-Google-Smtp-Source: ABdhPJxB4BVjo7DczKxRbvgCnl/C/wzdu7aovyg1ZYnL7+qqSH8ER4BnqbnPUYMofKizf2NvG1B4Sw== X-Received: by 2002:ac2:5dfb:0:b0:443:7baa:aee6 with SMTP id z27-20020ac25dfb000000b004437baaaee6mr12229114lfq.324.1646040844785; Mon, 28 Feb 2022 01:34:04 -0800 (PST) Received: from localhost.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id k7-20020a0565123d8700b00443cec880e5sm876184lfv.4.2022.02.28.01.34.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 01:34:04 -0800 (PST) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Srinivas Kandagatla Cc: Rob Herring , Krzysztof Kozlowski , Florian Fainelli , Hauke Mehrtens , bcm-kernel-feedback-list@broadcom.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH 1/2] nvmem: core: support passing DT node in cell info Date: Mon, 28 Feb 2022 10:33:50 +0100 Message-Id: <20220228093351.28162-1-zajec5@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220228_013407_734398_5B1C2D57 X-CRM114-Status: GOOD ( 12.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Rafał Miłecki Some hardware may have NVMEM cells described in Device Tree using individual nodes. Let drivers pass such nodes to the NVMEM subsystem so they can be later used by NVMEM consumers. Signed-off-by: Rafał Miłecki --- drivers/nvmem/core.c | 1 + include/linux/nvmem-consumer.h | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 6d5702e715d6..5fcf2793b599 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -467,6 +467,7 @@ static int nvmem_cell_info_to_nvmem_cell_entry_nodup(struct nvmem_device *nvmem, cell->bit_offset = info->bit_offset; cell->nbits = info->nbits; + cell->np = info->np; if (cell->nbits) cell->bytes = DIV_ROUND_UP(cell->nbits + cell->bit_offset, diff --git a/include/linux/nvmem-consumer.h b/include/linux/nvmem-consumer.h index c0c0cefc3b92..980f9c9ac0bc 100644 --- a/include/linux/nvmem-consumer.h +++ b/include/linux/nvmem-consumer.h @@ -25,6 +25,7 @@ struct nvmem_cell_info { unsigned int bytes; unsigned int bit_offset; unsigned int nbits; + struct device_node *np; }; /**