Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp344448pxj; Wed, 2 Jun 2021 00:08:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7cgF9iOdeS7Nji4rigamaf0oeKCe1mIjbXFRimcHggp4BJ4qzZAnWlUqWWuhUL1NxbxwH X-Received: by 2002:a17:907:3e1a:: with SMTP id hp26mr6721803ejc.77.1622617710885; Wed, 02 Jun 2021 00:08:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622617710; cv=none; d=google.com; s=arc-20160816; b=d4Hq4BVIqrsfMw7TBoJSL1BX2Zx/Aup7oYqbQjn3ByhDnI29uvUA2L/VF6cDWqSKJj edy3i3jdiQznZM7FVcGqPh17plEqMuYDirGCimkk5F93+MsfH89RefHeAwPu5SMHStct Wn1GHaoJa97vj5BRW0qi9J4zXykX/y+TS6Gp0H0f/vvNMtf7tOs0zbL5Y3WQRxQe4d+z QsV8DdpRDWflLaGGn/Zvv6TL8mKYPE2C3tH+kow7mdI8fs9x8PA5ZgHFbZ/vjRHkCX2o aoHCGp6K8O+OYjFjL5PGFj/i+w747Hy1sBP3WNNeTD0BMCUsV+KFzNmScfHgnnzlKQa6 xb8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:message-id:date:to:cc:from:subject :references:in-reply-to:content-transfer-encoding:mime-version :dkim-signature; bh=rv4GklsIqVHt3XDxHzZjFBMd0X1/rR3V+wz+AmB56as=; b=vVNUQ01CUlFtes3UQJl9mfO3LFQdNp6dOY2jOGuVUCaGOBY0jqS9r9E73Idv5IFCU2 N/yRGBNhgzf8Tr1cFz5KP+IRHzr2beHaEdU6h+75Q0btM6xAY0u/qIGuRb7b9xHi94Ud JS92QlCD7gXLJUpeyjivcLDvNa0DI2Fxs/gZ5zZ/ABLG+nlw4d6pGY92aFdf0exl/w7Z 3q6txOHFDKJ/5bvY6vgPYMVpoJrSkuk7An0HRSulrYu0hmHZeJ6uJe/Ltn2A+dzpoCIK Ymr2XqrYbLP82vK5IGMBwjRZ7ZgKRf5zc52B3fd2NTctdkQ4MW9WOnW8gP9PMiPG0uJ4 n+4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=d04Gz8co; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f6si18118415ejk.677.2021.06.02.00.08.07; Wed, 02 Jun 2021 00:08:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=d04Gz8co; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230228AbhFBHIa (ORCPT + 99 others); Wed, 2 Jun 2021 03:08:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:47896 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229753AbhFBHI2 (ORCPT ); Wed, 2 Jun 2021 03:08:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3B6E760FF3; Wed, 2 Jun 2021 07:06:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622617606; bh=lquQN/jlE/0WNJ9FMxm7Amdcp89k6AsKIIqlAAppnSM=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=d04Gz8cosorzMIhGRraoB+oDV6DOT+lbEY6Fejjl/rPsqylApRBOQPYuMpfoxYjpw nIovEktjAp6TjrOgS5+X2lv8DcXLqaBwTQwNRZlF10OR2vbPIcAIjIesDuuyXt3Bto qMg5wOxCxGlxiLCyGXTKAjkhqXGpqhDg2Zs1T2jL37oPzSb6QKxTfdr4gaTbVw9qOZ hlZ9tXFb2txJV0RvX0XczhUX43C2Q7/UI01zpcAYinS0zGdRF1dI+/OauKdo3K9/Gg TX+rWDpMJJ+7lMprY9tGhIGLp7F2tn8b1kzuGm/gLyhVkR4Blhe7sOGyw66nzIkc7Z TaSr3umLuJ1Mg== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <1619519590-3019-7-git-send-email-tdas@codeaurora.org> References: <1619519590-3019-1-git-send-email-tdas@codeaurora.org> <1619519590-3019-7-git-send-email-tdas@codeaurora.org> Subject: Re: [PATCH v2 6/6] clk: qcom: Add video clock controller driver for SC7280 From: Stephen Boyd Cc: Rajendra Nayak , linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, robh@kernel.org, robh+dt@kernel.org, Taniya Das To: Michael Turquette , Taniya Das Date: Wed, 02 Jun 2021 00:06:44 -0700 Message-ID: <162261760498.4130789.12499425999582046146@swboyd.mtv.corp.google.com> User-Agent: alot/0.9.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Taniya Das (2021-04-27 03:33:10) > diff --git a/drivers/clk/qcom/videocc-sc7280.c b/drivers/clk/qcom/videocc= -sc7280.c > new file mode 100644 > index 0000000..3387154 > --- /dev/null > +++ b/drivers/clk/qcom/videocc-sc7280.c > @@ -0,0 +1,372 @@ > +// SPDX-License-Identifier: GPL-2.0-only > +/* > + * Copyright (c) 2021, The Linux Foundation. All rights reserved. > + */ > + > +#include > +#include > +#include > +#include > + > +#include > + > +#include "clk-alpha-pll.h" > +#include "clk-branch.h" > +#include "clk-rcg.h" > +#include "common.h" > +#include "reset.h" > +#include "gdsc.h" > + > +enum { > + P_BI_TCXO, > + P_SLEEP_CLK, > + P_VIDEO_PLL0_OUT_EVEN, > +}; > + > +static struct pll_vco lucid_vco[] =3D { const? > + { 249600000, 2000000000, 0 }, > +}; > + [...] > + > +static const struct parent_map video_cc_parent_map_0[] =3D { > + { P_BI_TCXO, 0 }, > + { P_VIDEO_PLL0_OUT_EVEN, 3 }, > +}; > + > +static const struct clk_parent_data video_cc_parent_data_0[] =3D { > + { .fw_name =3D "bi_tcxo" }, > + { .hw =3D &video_pll0.clkr.hw }, > +}; > + > +static const struct parent_map video_cc_parent_map_1[] =3D { > + { P_SLEEP_CLK, 0 }, > +}; > + > +static const struct clk_parent_data video_cc_parent_data_1[] =3D { > + { .fw_name =3D "sleep_clk" }, > +}; > + > +static const struct parent_map video_cc_parent_map_2[] =3D { > + { P_BI_TCXO, 0 }, > +}; > + > +static const struct clk_parent_data video_cc_parent_data_2_ao[] =3D { > + { .fw_name =3D "bi_tcxo_ao" }, This is new. Why would we want the video clk parent state to turn off when the CPU is off? Does the video engine keep XO enabled for itself? Can you please add some comment into the code explaining why it's ok to use the ao clk here? > +}; > + > +static const struct freq_tbl ftbl_video_cc_iris_clk_src[] =3D { > + F(133333333, P_VIDEO_PLL0_OUT_EVEN, 3, 0, 0), > + F(240000000, P_VIDEO_PLL0_OUT_EVEN, 2, 0, 0), > + F(335000000, P_VIDEO_PLL0_OUT_EVEN, 2, 0, 0), > + F(424000000, P_VIDEO_PLL0_OUT_EVEN, 2, 0, 0), > + F(460000000, P_VIDEO_PLL0_OUT_EVEN, 2, 0, 0), > + { } > +}; [...] > + > +static struct clk_branch video_cc_xo_clk =3D { > + .halt_reg =3D 0x7018, > + .halt_check =3D BRANCH_HALT, > + .clkr =3D { > + .enable_reg =3D 0x7018, > + .enable_mask =3D BIT(0), > + .hw.init =3D &(struct clk_init_data){ > + .name =3D "video_cc_xo_clk", > + .parent_hws =3D (const struct clk_hw*[]){ > + &video_cc_xo_clk_src.clkr.hw, > + }, > + .num_parents =3D 1, > + .flags =3D CLK_IS_CRITICAL | CLK_SET_RATE_PARENT, Please add a comment why it is critical. > + .ops =3D &clk_branch2_ops, > + }, > + }, > +}; > +