Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CA09FCD690A for ; Tue, 10 Oct 2023 08:53:25 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B365186DA8; Tue, 10 Oct 2023 10:52:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=rock-chips.com header.i=@rock-chips.com header.b="bTmsQct9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4BD4F86DC7; Tue, 10 Oct 2023 10:52:57 +0200 (CEST) Received: from mail-m15573.qiye.163.com (mail-m15573.qiye.163.com [101.71.155.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4C22086D9C for ; Tue, 10 Oct 2023 10:52:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=zhangqing@rock-chips.com DKIM-Signature: a=rsa-sha256; b=bTmsQct971LMCRbOzpNcRL/g1No0HB+EEdQg4GJB+KVfR1R3N2G64oVinwbpsBxqwARFjkXJZMsf/VF1Uuf/d7XYKv6y1lXut6WxNUTOe+bKztlVtbol2dHIWu57w1AXC8a305cbFH1gxVb9remXz3o2WWxC4WO+2LUjmTUNsMs=; c=relaxed/relaxed; s=default; d=rock-chips.com; v=1; bh=R7Sa2PBRjwI4NBZ/6I+TVAci4fcnkPMkKY+jo9Ps2Lk=; h=date:mime-version:subject:message-id:from; Received: from localhost.localdomain (unknown [58.22.7.114]) by mail-m11877.qiye.163.com (Hmail) with ESMTPA id CF7964003EF; Tue, 10 Oct 2023 16:52:08 +0800 (CST) From: Elaine Zhang To: lukma@denx.de, seanga2@gmail.com, philipp.tomsich@vrull.eu, sjg@chromium.org, kever.yang@rock-chips.com Cc: u-boot@lists.denx.de, chenjh@rock-chips.com, Elaine Zhang Subject: [PATCH v1 3/7] clk: rockchip: rk3568: support dclk_vop select more parent clks Date: Tue, 10 Oct 2023 16:51:51 +0800 Message-Id: <20231010085155.31027-4-zhangqing@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231010085155.31027-1-zhangqing@rock-chips.com> References: <20231010085155.31027-1-zhangqing@rock-chips.com> X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFDSUNOT01LS0k3V1ktWUFJV1kPCRoVCBIfWUFZQ0kaGFZJHx9IGUkdSEMdHkhVEwETFh oSFyQUDg9ZV1kYEgtZQVlOQ1VJSVVMVUpKT1lXWRYaDxIVHRRZQVlPS0hVSk1PSU5JVUpLS1VKQl kG X-HM-Tid: 0a8b18c952bb2eb3kusncf7964003ef X-HM-MType: 1 X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6MAw6Dhw*Vjw*UREUGREILyoW AkhPFC5VSlVKTUJNQklMQklCTEtCVTMWGhIXVQETGhUcChIVHDsJFBgQVhgTEgsIVRgUFkVZV1kS C1lBWU5DVUlJVUxVSkpPWVdZCAFZQUlNT043Bg++ X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Change-Id: Ib823620ff7940f8d62e78010817ca9b5f06995dd Signed-off-by: Elaine Zhang --- drivers/clk/rockchip/clk_rk3568.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/clk/rockchip/clk_rk3568.c b/drivers/clk/rockchip/clk_rk3568.c index 469014439be4..7b9035acdb0f 100644 --- a/drivers/clk/rockchip/clk_rk3568.c +++ b/drivers/clk/rockchip/clk_rk3568.c @@ -1839,7 +1839,7 @@ static ulong rk3568_dclk_vop_set_clk(struct rk3568_clk_priv *priv, rockchip_pll_set_rate(&rk3568_pll_clks[VPLL], priv->cru, VPLL, div * rate); } else { - for (i = 0; i <= DCLK_VOP_SEL_CPLL; i++) { + for (i = sel; i <= DCLK_VOP_SEL_CPLL; i++) { switch (i) { case DCLK_VOP_SEL_GPLL: pll_rate = priv->gpll_hz; @@ -2964,9 +2964,15 @@ static int rk3568_dclk_vop_set_parent(struct clk *clk, struct clk *parent) if (parent->id == PLL_VPLL) { rk_clrsetreg(&cru->clksel_con[con_id], DCLK0_VOP_SEL_MASK, DCLK_VOP_SEL_VPLL << DCLK0_VOP_SEL_SHIFT); - } else { + } else if (parent->id == PLL_HPLL) { rk_clrsetreg(&cru->clksel_con[con_id], DCLK0_VOP_SEL_MASK, DCLK_VOP_SEL_HPLL << DCLK0_VOP_SEL_SHIFT); + } else if (parent->id == PLL_CPLL) { + rk_clrsetreg(&cru->clksel_con[con_id], DCLK0_VOP_SEL_MASK, + DCLK_VOP_SEL_CPLL << DCLK0_VOP_SEL_SHIFT); + } else { + rk_clrsetreg(&cru->clksel_con[con_id], DCLK0_VOP_SEL_MASK, + DCLK_VOP_SEL_GPLL << DCLK0_VOP_SEL_SHIFT); } return 0; -- 2.17.1