From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3BEDF404BFE for ; Tue, 9 Jun 2026 11:39:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781005191; cv=none; b=osOybvm+oAHyO1CQKrVPngLYcUNlaU3fTEC8n9Q7Ywh9h5B2ta6dxs4u2CEtarYTwn4HxuZhDvEcUbIOKXIqFx4AQzo2YMqFqQx6l3CKIRDOXifxdBfAaAehgrwtGk2kc3UY2YxDXs6k4q3zzUrmsw5MAlFE/P9nsIdOh7t7jso= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781005191; c=relaxed/simple; bh=nI5ECO865SLO/yR0Iz3efaPzhFXDP/Ze7Ooye8y662g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jvhzMhMNKfuwGXT+u9RwzAKZEPMQHw+XYQ7Pf0+mPDSgqMGxKamuRZt4Wnjd91Rjh05+JzaAnAObZMZE3pU8VqdeFGbWLwEwfYa4q/Ma7KRvz+7bkkiBVC7itSVHc5Mq/nitSU/0iezKazv4VgYpB0gtaREr1y/yXXj0t4eqQpI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SisWZCGk; arc=none smtp.client-ip=209.85.214.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SisWZCGk" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-2c0c2c7d45eso48493065ad.1 for ; Tue, 09 Jun 2026 04:39:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781005190; x=1781609990; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JZ/oe53fAvMnFVe28kFJYn/lJeWITuitrB7buiTdOTQ=; b=SisWZCGkRO0EKL/FIpqjtsu4ou3Gtsa3Sy0EYkuHKZtCHWqhNGFG0Vu5V+dVzrOHwI O5rSH2iuKw65eZMSg+uZTBWObfUR6AQY45gLLhjU2rrijKzKHtAxitnVWokz1gqP40Sw 9mC32DR/GNiHlNyQePfE+TXCmXuNIwI7UpZbUn3kbRePtePAr0J+pe4LnhmJ4Vs9hmBO WRSHrYwfyf8Meb3V0tB3FOvEaAh+M65Zd5LjDpHLphHRM0EmHDfJc0D+BbHTLGcoA7FR Te8990Z/LX5Lj5whR7nxM2CjETUuTtqEuVsAnFAwx6F1C1GI0F3/OB8Z9gLw/vurFwoL i7sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781005190; x=1781609990; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=JZ/oe53fAvMnFVe28kFJYn/lJeWITuitrB7buiTdOTQ=; b=P+Qpsp7kDYcps2QvvnzCDCWT+7gcf5LCoivm+3kNdqVDk2B+5ULccQyo8TUwil+jgI JZZ3SN4F42v5SLf3EVDG4MDWWgdRIi7qRkXSqv2uoyno/DkGJ8chVWAgshUKhIequBlE 8O76Ja0oBkFc+U0Ows9ddpVasns0XorcwaQ4R5Kag9KgxElkAzA4WKOOjmFWVgiaoCH2 xH9XYiO9p4kirCBozCJH5UwoIBoVRdZMf6yRZ9Y27K4tfn69kQTt4RodNiNZ6MOCKnVB kLEdLVXuqkSwzZPobHnMRiPvzf7uqIrnL/ZQVNwfvkl7vKolAGPDKPRxIrvuDTFvCNuu 78fw== X-Forwarded-Encrypted: i=1; AFNElJ8ryZdGnl1h99ySBBmcNk4WwfgmxixjAw4HbhlRPxAL1Lzl8dXj9NcC/O52yqvYyiRBpnUUXf3op8QCaNI=@vger.kernel.org X-Gm-Message-State: AOJu0YxNcOvkg8m547wBWPtmgoSSvihYm9GtLlLIZVMROmZPx6/VG/dh wgL31s33qDsf/xd03FUMfzwvxlW1M8/lVIjeIehoLs4CTIxIfki4v6Nn X-Gm-Gg: Acq92OGFpYmmzwoIr2/phqf/0CUGOyaOwsxgz094dpS2A3N+e6yCTiPYNJ8IGCxmIjS r6h2NDrEeH8EzYsd8HK+JZz/jD5cAKV3/S2ncXkuIqgpL6nHsgEvPISjUm5bj57nonyajLPSfYT 7WeAOQjyk30T8vYzzTD7gtGSyiK235yxVwsdVDw/YYAyC3Oi0wi+kRT9mMf436z8z7OBS78/gmA mjwp7P9h52lEgJYK+qQTB/ZvxPtQ4iBR+JPLteb7K+W8TQWqZFWgJIRHEPJHtqHAtyAQIQqgA7r Kn4D9hTdv67VxgUVwx631i8RVLc+jBOrg5gyaypac7KykjPikDLXmDU45X1TI9ZtQUkJGl+C9CZ nARPrVYbl8hHEqc05/sF2j3sXob7Wmaj8Xz7yep0KrdHXXM2huDyKjRlUyFae6T+YSmdryMj42w QtqsS+vM5NJT4XrRqDq9TI4dO5c7EahGsg0S7T7u82sodwgMunCkgq4mTQz1+3OZfmv0zP X-Received: by 2002:a17:903:3885:b0:2c2:245a:3368 with SMTP id d9443c01a7336-2c2245a3649mr194770575ad.14.1781005189646; Tue, 09 Jun 2026 04:39:49 -0700 (PDT) Received: from phuc-desktop.. ([183.91.15.56]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2c164f70660sm210755635ad.11.2026.06.09.04.39.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2026 04:39:49 -0700 (PDT) From: phucduc.bui@gmail.com To: Kuninori Morimoto , Mark Brown , Geert Uytterhoeven Cc: Liam Girdwood , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Magnus Damm , Jaroslav Kysela , Takashi Iwai , linux-sound@vger.kernel.org, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, bui duc phuc Subject: [PATCH v6 11/11] ASoC: renesas: fsi: Add SPU clock control in hw_startup/shutdown Date: Tue, 9 Jun 2026 18:38:36 +0700 Message-ID: <20260609113836.45079-12-phucduc.bui@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260609113836.45079-1-phucduc.bui@gmail.com> References: <20260609113836.45079-1-phucduc.bui@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: bui duc phuc Enable and disable the SPU clock in fsi_hw_startup() and fsi_hw_shutdown() to ensure the clock is active while the driver accesses hardware registers. Acked-by: Kuninori Morimoto Suggested-by: Kuninori Morimoto Signed-off-by: bui duc phuc --- Changes in v6: - Add Acked-by tag from Kuninori Morimoto. - Minor refactor in clock enable/disable paths. Changes in v5: - Drop spu_count and rely on the clk core for clock reference counting. sound/soc/renesas/fsi.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/sound/soc/renesas/fsi.c b/sound/soc/renesas/fsi.c index e26f39dfe059..b72396b5de7d 100644 --- a/sound/soc/renesas/fsi.c +++ b/sound/soc/renesas/fsi.c @@ -1560,6 +1560,11 @@ static int fsi_hw_startup(struct fsi_priv *fsi, struct device *dev) { u32 data = 0; + int ret; + /* enable spu bus bridge clock */ + ret = clk_enable(fsi->master->clk_spu); + if (ret) + return ret; /* clock setting */ if (fsi_is_clk_master(fsi)) @@ -1605,8 +1610,13 @@ static int fsi_hw_startup(struct fsi_priv *fsi, fsi_fifo_init(fsi, io, dev); /* start master clock */ - if (fsi_is_clk_master(fsi)) - return fsi_clk_enable(dev, fsi); + if (fsi_is_clk_master(fsi)) { + ret = fsi_clk_enable(dev, fsi); + if (ret) { + clk_disable(fsi->master->clk_spu); + return ret; + } + } return 0; } @@ -1614,9 +1624,15 @@ static int fsi_hw_startup(struct fsi_priv *fsi, static int fsi_hw_shutdown(struct fsi_priv *fsi, struct device *dev) { + int ret; /* stop master clock */ - if (fsi_is_clk_master(fsi)) - return fsi_clk_disable(dev, fsi); + if (fsi_is_clk_master(fsi)) { + ret = fsi_clk_disable(dev, fsi); + if (ret) + return ret; + } + /* stop spu bus bridge clock */ + clk_disable(fsi->master->clk_spu); return 0; } -- 2.43.0