From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D001C606D81A for ; Thu, 5 Nov 2026 13:11:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=kNZElhNQ; dkim=pass (2048-bit key, unprotected) header.d=thorsis.com header.i=@thorsis.com header.a=rsa-sha256 header.s=dkim header.b=ZWv03Xks DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post: List-Owner; bh=K1eZUXnvIe9BgiUSgLvU7tBvXR94fQjJ10/PgyPe++Y=; b=kNZElhNQQNbnV4 H4K495w6b4p/LdN6IZEXqkCZofKep7TKCZWUm6xmZ8w7b04W9jqI4PtRE22SCydSczaQ8YwnHAzxw E8xCqhzG7+1IzI/jKnRdS1X5Vu8Hi6NqSUMpW8bOcTdFs44EPGsoVeHJ2qf6uAjcFAZvtqjjkAy4f Jws/WuVxU87tP7qSWFmErPHHJ5hsnuDPjrETPWNcQVeJgEj/KkI1BGV2V74p+qRLOXd31oa/l5F3H KDp9dS4+0IepXerLDRqM8oRUaUcHjb++oDgpdlWmf8K2xCxGp7S2cbx79udGJUDRYG1lKIdIrOYbI Ia4ciPBNEAeshzM5Wx7A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xOxFI-0000000957e-22Jn; Thu, 05 Nov 2026 13:11:12 +0000 Received: from mail.thorsis.com ([2003:a:e28:26e4::10]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xOxFF-0000000955p-1Zx5 for linux-arm-kernel@lists.infradead.org; Thu, 05 Nov 2026 13:11:10 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 6538614966D0; Thu, 05 Nov 2026 14:11:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thorsis.com; s=dkim; t=1793884302; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=K1eZUXnvIe9BgiUSgLvU7tBvXR94fQjJ10/PgyPe++Y=; b=ZWv03XksS5RMtIpZp76Cs5dyR4dnRiktzAQ/OCvrPA7UzhQNo7bSeyJmRkXBNbTcR2Tyvu mxULv/iEyFjBJVKIiIqNvZA/pDbZ8N4zhoIp16snok6HymHFka9NFFWcDm+sWLyJWCoTP/ unaTRd6MclSO1OZoyfuUK8bkgcuuPiUR4CQnuv3DADR8CbT15IYzeuhDpNBtRG2hoZGcIR vGjdYE4zulfTosxhqG8na6zNp0WU4gov7LErA7Pq+JhR+nJ5I8q1NCdLHKIyNWeLCv2eL1 w2XqMI4+NL1gcte3izGDl0nk6YldiKPhb4kTmXUJXm85QO/2u4b5UGPoM5n9Gg== From: Alexander Dahl To: Claudiu Beznea Cc: Nicolas Ferre , Alexandre Belloni , Ryan Wanner , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH v4 10/16] nvmem: microchip-otpc: Enable necessary clocks Date: Thu, 5 Nov 2026 12:06:46 +0100 Message-ID: <20261105110715.2486432-11-ada@thorsis.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261105110715.2486432-1-ada@thorsis.com> References: <20261105110715.2486432-1-ada@thorsis.com> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261105_051109_596485_18990446 X-CRM114-Status: GOOD ( 12.51 ) X-Spam-Score: -2.1 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-18.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, 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=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Without enabling the main rc clock, initializing the packet list leads to a read timeout on the first packet, at least on sam9x60. According to SAM9X60 datasheet (DS60001579G) section "23.4 Product Dependencies" the clock must be enabled for reading and writing. Tested on sam9x60-curiosity board. Reviewed-by: Claudiu Beznea Signed-off-by: Alexander Dahl --- Notes: v4: - Removed link from commit message and added Reviewed-by (thanks Claudiu) v3: - Rewrap lines v2: - Rewrite to enable _all_ clocks defined in dts drivers/nvmem/microchip-otpc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/nvmem/microchip-otpc.c b/drivers/nvmem/microchip-otpc.c index bf7e5167152cb..4286365686563 100644 --- a/drivers/nvmem/microchip-otpc.c +++ b/drivers/nvmem/microchip-otpc.c @@ -8,6 +8,7 @@ */ #include +#include #include #include #include @@ -241,6 +242,7 @@ static struct nvmem_config mchp_nvmem_config = { static int mchp_otpc_probe(struct platform_device *pdev) { struct nvmem_device *nvmem; + struct clk_bulk_data *clks; struct mchp_otpc *otpc; u32 size; int ret; @@ -253,6 +255,10 @@ static int mchp_otpc_probe(struct platform_device *pdev) if (IS_ERR(otpc->base)) return PTR_ERR(otpc->base); + ret = devm_clk_bulk_get_all_enabled(&pdev->dev, &clks); + if (ret < 0) + return dev_err_probe(&pdev->dev, ret, "Error getting clocks!\n"); + otpc->dev = &pdev->dev; ret = mchp_otpc_init_packets_list(otpc, &size); if (ret) -- 2.47.3