Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp166598iob; Mon, 2 May 2022 16:06:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwydE/eIS3QLM2Vc+vbvsNfSZni32S5ydecYIDQupCgwS+T5CuMMKMj/hsc8xH+EgGmxDUF X-Received: by 2002:a62:3848:0:b0:50d:376e:57ed with SMTP id f69-20020a623848000000b0050d376e57edmr13239969pfa.71.1651532768822; Mon, 02 May 2022 16:06:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651532768; cv=none; d=google.com; s=arc-20160816; b=RlMO6peLwIIXVwlKWRb/WFSIglW0fyXIzkRHnKtB+o/FoLGC6YSJHk84e0Q3VZ/KM0 UeJyp0NLF11mOB4FQtFEJYaGrrshY2oamryLVDaQWFqCa442mpTs5itIdEQGt0UnXqZV XCy1tGitz981gzkE25Otzk3eauQkBpJ6F8yYMblJvyE+XskERZO/qWDp9tYS+QoQslxJ ecqAuUM4whl3vuFAIA89bS9M6Nx3lRrQTuBP7RJZ5Ecrz4aLegJ5DU+M9rI26LlHuuuT as3rl7cctulOlET1xC9ZqtAC+GkK7LRGcf2pdSygulrcPqsetsM6zgW3BdVv7DDd0RpE qSBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=e6ar+XxU37QB2aFpX4f2hjgRwMYzw0bu5owiNbvSfoc=; b=Y4P3FCU1dduIeVf39P/IOzth9t/iao6soR8dOj4Cbp6B8SF9j2fmBlw+NKfG4F7UrH 0ZweI314mb8sXx+Bp3hZpiBP0xnlxow/dvT3PKzGe6bmxJyD3oOuSTUZq4l88awk40Hz Uh4iqy5Z4TVVWqXQkYd82x4kiFOnGjbCX4xCfr58TNvkywqO66TdEZ2KJyEMN4YWwNkp xScU8hJe0Om4/dmAJHDjHE3P6+INdz/ejdGf4GKOhlgBYeQ/9A3zHZwSyu+aiz2yVhs6 zYoXMH3EBE3lw/nsIbyjaR1ytAsVhGKeIBuHOyFZHednS0YVQd7HUPfQCThFNSkd6Lws OqWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KlZ2rvfk; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id a2-20020a63e842000000b003c14249f5a1si15366114pgk.410.2022.05.02.16.06.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 16:06:08 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KlZ2rvfk; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BA4CD28E39; Mon, 2 May 2022 16:06:01 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379105AbiD2QbP (ORCPT + 99 others); Fri, 29 Apr 2022 12:31:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379075AbiD2QbN (ORCPT ); Fri, 29 Apr 2022 12:31:13 -0400 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 593B3D8920 for ; Fri, 29 Apr 2022 09:27:54 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id p189so4911059wmp.3 for ; Fri, 29 Apr 2022 09:27:54 -0700 (PDT) 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=e6ar+XxU37QB2aFpX4f2hjgRwMYzw0bu5owiNbvSfoc=; b=KlZ2rvfkJgWC93f3WJwVGdP8EGPjxUTY3rfCaXPI2f5fgeAfcAwEIpyqZrDrWZMlch N8xBUihznzsPwrQMKQuxJpxzWRuhJgsfAZcpPk6m17lX1fMtrcyn1sV+YpEPY3Wt6k48 SPPsD5t7bibF974GFTzffC2YBWwJvXpXBkx8jWoTLURwu1exc84aQ6k2UwKULTv/Xmhz fb9EfybB408F2mL59umYxMG1DaDjSqNGaG892YUgtZbsW6A5Wfl/aRzhDkfYk8UsX0ro cNHM59yMuehH+vopkCdR5MCxGHzjtEzOHB927Q2/Dk0Mb6AA7i+LDYKWKiP9Sqxdhln+ PdjA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=e6ar+XxU37QB2aFpX4f2hjgRwMYzw0bu5owiNbvSfoc=; b=JNv9SKIObov4KptnX4OCWI7rDzpA9dvJeopXIzxv79yMNHIAdsA3IuSgDVa6MtNgiw EWSVbdNCgmOq37vH9j+2CpYUw+u7XFqiRdRFK+xf43U2Hxfq+mhJiTlRJijt1mGnp2wK 9JUR9oWaTBX8u0VryJKUDZzO1oQInb4UaSYjPNCkfGbhrTLjtPDnguTmDLZHTEknZU9y ZimGidf9c6tj/QBvuXBp6WBfXZ3k/1sc/+lvWyKfOYGuRVWSDX+NfgR3Pln2fUF+q4ug WW+lqUbgnf9b8qj2GGZOb4wQFwLuypw6/IG6UF05Z6Kp0LX4sLTWtaTReERoaAsg+PdS eJjA== X-Gm-Message-State: AOAM5320p9TB5BSIrDmGk3/8ukGlwlQsZ3VGI8yI9xh9ipNhBAqElg14 PWREqOuzyKQdK8n1ZAKAx/F5HiKedMczDw== X-Received: by 2002:a1c:7416:0:b0:38e:b8b7:e271 with SMTP id p22-20020a1c7416000000b0038eb8b7e271mr3869552wmc.7.1651249672960; Fri, 29 Apr 2022 09:27:52 -0700 (PDT) Received: from srini-hackbox.lan (cpc90716-aztw32-2-0-cust825.18-1.cable.virginm.net. [86.26.103.58]) by smtp.gmail.com with ESMTPSA id b5-20020adff905000000b0020a8781be70sm2781801wrr.12.2022.04.29.09.27.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Apr 2022 09:27:52 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , Srinivas Kandagatla Subject: [PATCH 01/16] nvmem: core: support passing DT node in cell info Date: Fri, 29 Apr 2022 17:26:46 +0100 Message-Id: <20220429162701.2222-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20220429162701.2222-1-srinivas.kandagatla@linaro.org> References: <20220429162701.2222-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 Signed-off-by: Srinivas Kandagatla --- 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 f58d9bc7aa08..1e3c754efd0d 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; }; /** -- 2.21.0