From patchwork Tue Feb 20 10:43:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13563862 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 108EA62160; Tue, 20 Feb 2024 10:43:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708425837; cv=none; b=rxZTyTbfO2zZQJYhqTFq/U0kYzqCOd1sFV0m85LIO5FMzguK8ZIV+oDxVUgYRm1DsezpDBmTSJjE7dNpP1ugQG3GGqXV7zMsIdH2s6qVP/uZq9Qm/cVPtajUMxh+8bFsF1lKIyszMy3ls0d3ESMes6MwNsjBUHdI3SNzUKz2s2s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708425837; c=relaxed/simple; bh=hk+SwYEtbz1YbuLnMcYcZXEyiHG0rluyq/cy+FSA2hA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rdnXgl+4AI+YCMsfqpqxvmx4tBkJgBT/wOT2FQWEXGgDwXokJyk25Ceqt4xOmlTN/x13EzH1zfJ+qfj9ytkaAgtvkW6ijw0QKx4kFDILzSzN/yJzGh9oTsBffQfliATCvIpLW8rMvDcC4ykiOz27p33TauYqqKH1XYt78MdQATA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=bp.renesas.com; spf=pass smtp.mailfrom=bp.renesas.com; arc=none smtp.client-ip=210.160.252.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=bp.renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bp.renesas.com X-IronPort-AV: E=Sophos;i="6.06,172,1705330800"; d="scan'208";a="194579423" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 20 Feb 2024 19:43:55 +0900 Received: from localhost.localdomain (unknown [10.226.92.246]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id AD77D4004BD4; Tue, 20 Feb 2024 19:43:51 +0900 (JST) From: Biju Das To: Mauro Carvalho Chehab Cc: Biju Das , Hans Verkuil , Sakari Ailus , Stephen Boyd , Laurent Pinchart , Lad Prabhakar , Rob Herring , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , linux-media@vger.kernel.org, Geert Uytterhoeven , Biju Das , linux-renesas-soc@vger.kernel.org Subject: [PATCH v2 3/3] media: platform: rzg2l-cru: rzg2l-video: Use clk_poll_disable_unprepare() Date: Tue, 20 Feb 2024 10:43:36 +0000 Message-Id: <20240220104336.260194-4-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240220104336.260194-1-biju.das.jz@bp.renesas.com> References: <20240220104336.260194-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Use the clk_poll_disable_unprepare() for synchronizing clk gating in rzg2l_csi2_mipi_link_enable(). Signed-off-by: Biju Das --- v1->v2: * Replaced clk_disable_unprepare_sync()-->clk_poll_disable_unprepare() and the error propagated to the caller. --- drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c index e68fcdaea207..986435bd85c1 100644 --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c @@ -366,6 +366,7 @@ static int rzg2l_csi2_mipi_link_enable(struct rzg2l_csi2 *csi2) { unsigned long vclk_rate = csi2->vclk_rate / HZ_PER_MHZ; u32 frrskw, frrclk, frrskw_coeff, frrclk_coeff; + int ret; /* Select data lanes */ rzg2l_csi2_write(csi2, CSI2nMCT0, CSI2nMCT0_VDLN(csi2->lanes)); @@ -387,7 +388,9 @@ static int rzg2l_csi2_mipi_link_enable(struct rzg2l_csi2 *csi2) rzg2l_csi2_write(csi2, CSI2nDTEL, 0xf778ff0f); rzg2l_csi2_write(csi2, CSI2nDTEH, 0x00ffff1f); - clk_disable_unprepare(csi2->vclk); + ret = clk_poll_disable_unprepare(csi2->vclk, 10, 10000); + if (ret) + return ret; /* Enable LINK reception */ rzg2l_csi2_write(csi2, CSI2nMCT3, CSI2nMCT3_RXEN);