From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.thorsis.com (mail.thorsis.com [217.92.40.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EFB9933C1AC; Tue, 20 Jan 2026 16:46:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.92.40.78 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768927617; cv=none; b=JuCkOFVtKvhEkXpmfUfCkeMyFmUt+f9YscgGF9FzRwmXrkLcp353Bz3nlDZ5NO74N3/E6sZUvvRhYSdo8icFATed2Yfyjb6Tk39T4v95zbvHFXWo2Uwsx7FZd8nayc7cEAOeUo9PJnL5Kq4U0TiwssTh8q5pIN+wv/MDJj4cK/0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768927617; c=relaxed/simple; bh=0c3vh79p6gsm3uCGtnvAspS2ib7dhe2tFGNzDzCbccQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GlLa95M0ikqHEdeqwAQTTWueiOBrp9gxwIr1J+0ZOpVI7cys0QwYBKTuhNjBEs/iIu6wBhMMl0fhIu/aKBEjn52C3U8hDsSa7U/cdQnOIIhcDAeG782NXcFc2Nsx/9RCJbI42syLNVOt4BJrYNW/Q1akaunhcqakqtPJ7xQ3/B8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=thorsis.com; spf=pass smtp.mailfrom=thorsis.com; dkim=pass (2048-bit key) header.d=thorsis.com header.i=@thorsis.com header.b=lQSQpedZ; arc=none smtp.client-ip=217.92.40.78 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=thorsis.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=thorsis.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=thorsis.com header.i=@thorsis.com header.b="lQSQpedZ" Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 886631488638; Tue, 20 Jan 2026 17:46:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thorsis.com; s=dkim; t=1768927612; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=ulo77ylyJZMF+/aZjD30uG2oZc3o7QcUP3IHLM+BdQQ=; b=lQSQpedZYGaCXUVdPKEo+JbBJSbufqszB6YbOEuq3DXKqeMQV7KK9GcbUzcxRD67j05RZq FRDPg+GRczRx/4AXPhimI+R7nN8VpkEBdgoI4aEX9NbZiWyo6xu6mMQa4f49vm6dWnO0SV iR+57Otsj6/GMGkaI5Po3YR7dPOTHhjqYhebsb5snBrhYfyiBEG18kj9P8jTZdLMF3VwSd oGT0banOk3cEkTKBN+jPcF25sAQro2qzFTCJDKF1UD2sR17QCmNqX9bhrqHqbKCdSyNM3Y DJ4HUcLbCZMxuODvlseWE4Jyi9ndIGSADRTru8r20hLNTzUtj6ewRy11EYlRxA== 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 v3 13/19] nvmem: microchip-otpc: Enable necessary clocks Date: Tue, 20 Jan 2026 16:44:47 +0100 Message-ID: <20260120154502.1280938-7-ada@thorsis.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260120154502.1280938-1-ada@thorsis.com> References: <20260120143759.904013-1-ada@thorsis.com> <20260120154502.1280938-1-ada@thorsis.com> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 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. Link: https://lore.kernel.org/linux-clk/ec34efc2-2051-4b8a-b5d8-6e2fd5e08c28@microchip.com/T/#u Signed-off-by: Alexander Dahl --- Notes: 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 d39f2d57e5f5e..34c0d7611f3e4 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