From patchwork Wed Feb 2 17:42:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taniya Das X-Patchwork-Id: 539648 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FC62C433EF for ; Wed, 2 Feb 2022 17:42:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346312AbiBBRm3 (ORCPT ); Wed, 2 Feb 2022 12:42:29 -0500 Received: from so254-9.mailgun.net ([198.61.254.9]:13423 "EHLO so254-9.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346314AbiBBRm0 (ORCPT ); Wed, 2 Feb 2022 12:42:26 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1643823746; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=J3gQ6FNwmU8yLWv/91sOqrR3jHTVMWZ635ED0cGWAYw=; b=ILMr/ME4HfjksmvlmwV6nAOIvHHQDMwRBovDwjl9oXiXo4cLy1N2OIoZwRPF4UR7FHTzl2c1 b3um8wuv4MMyRohrIl+0PayjLPDggrd+EvomZwHj6s/iXnqz4eZJ0F1GQnYOtDGzv3WVlpc1 BTt1TV++Umz0dSw2k6Asemj0wJU= X-Mailgun-Sending-Ip: 198.61.254.9 X-Mailgun-Sid: WyI1MzIzYiIsICJsaW51eC1hcm0tbXNtQHZnZXIua2VybmVsLm9yZyIsICJiZTllNGEiXQ== Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n01.prod.us-west-2.postgun.com with SMTP id 61fac28154b2901ff1cb770f (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 02 Feb 2022 17:42:25 GMT Sender: tdas=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 49F27C43616; Wed, 2 Feb 2022 17:42:25 +0000 (UTC) Received: from hu-tdas-hyd.qualcomm.com (unknown [202.46.22.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: tdas) by smtp.codeaurora.org (Postfix) with ESMTPSA id 76DEAC4338F; Wed, 2 Feb 2022 17:42:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 smtp.codeaurora.org 76DEAC4338F Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=codeaurora.org From: Taniya Das To: Stephen Boyd , =?utf-8?q?Michael_Turquette_=C2=A0?= 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, Taniya Das Subject: [PATCH v2 1/2] clk: qcom: clk-rcg2: Update the calc_rate logic to handle determine rate Date: Wed, 2 Feb 2022 23:12:12 +0530 Message-Id: <20220202174213.21259-1-tdas@codeaurora.org> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org In the cases where the RCG parent implements the determine rate ops, the calc_rate needs to be updated the calculate the rate. Fixes: bcd61c0f535a0 ("clk: qcom: Add support for root clock generators (RCGs)") Signed-off-by: Taniya Das --- * Split the patch for PLL and RCG. * Update the Fixes tag. drivers/clk/qcom/clk-rcg2.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- Qualcomm INDIA, on behalf of Qualcomm Innovation Center, Inc.is a member of the Code Aurora Forum, hosted by the Linux Foundation. diff --git a/drivers/clk/qcom/clk-rcg2.c b/drivers/clk/qcom/clk-rcg2.c index e1b1b426fae4..2e120a6dd19a 100644 --- a/drivers/clk/qcom/clk-rcg2.c +++ b/drivers/clk/qcom/clk-rcg2.c @@ -147,19 +147,19 @@ static int clk_rcg2_set_parent(struct clk_hw *hw, u8 index) static unsigned long calc_rate(unsigned long rate, u32 m, u32 n, u32 mode, u32 hid_div) { + u64 tmp = rate; + if (hid_div) { - rate *= 2; - rate /= hid_div + 1; + tmp *= 2; + do_div(tmp, hid_div + 1); } if (mode) { - u64 tmp = rate; tmp *= m; do_div(tmp, n); - rate = tmp; } - return rate; + return tmp; } static unsigned long From patchwork Wed Feb 2 17:25:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taniya Das X-Patchwork-Id: 539649 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3724AC433FE for ; Wed, 2 Feb 2022 17:26:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234703AbiBBR0B (ORCPT ); Wed, 2 Feb 2022 12:26:01 -0500 Received: from m43-7.mailgun.net ([69.72.43.7]:49116 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241909AbiBBR0B (ORCPT ); Wed, 2 Feb 2022 12:26:01 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1643822761; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=h8AzjRwOnPFVO4sqiLJhetNSwtXuy8aMD5ZT2EWKw40=; b=QZ5uC1ot2kFcjlgdvKrh7adjyWbypc6RJPOK3ajhPHFnNGPk06Y93e3M389g9phDE1WDbhn+ cbHi0owja2dLDKgQQ0GxyWPrXAh0EkKl4PC3f+6c7SjjJQPEJ/8eUJtTCBr/QQxMWWXHsjL1 kVOE7m41G4nBBve7Kwc4wrQxdx4= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI1MzIzYiIsICJsaW51eC1hcm0tbXNtQHZnZXIua2VybmVsLm9yZyIsICJiZTllNGEiXQ== Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n07.prod.us-west-2.postgun.com with SMTP id 61fabea8d9f69c72766c1ae5 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 02 Feb 2022 17:26:00 GMT Sender: tdas=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 7048DC43617; Wed, 2 Feb 2022 17:26:00 +0000 (UTC) Received: from hu-tdas-hyd.qualcomm.com (unknown [202.46.22.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: tdas) by smtp.codeaurora.org (Postfix) with ESMTPSA id 3AB63C4338F; Wed, 2 Feb 2022 17:25:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 smtp.codeaurora.org 3AB63C4338F Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=codeaurora.org From: Taniya Das To: Stephen Boyd , =?utf-8?q?Michael_Turquette_=C2=A0?= 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 Subject: [PATCH v2 2/2] clk: qcom: clk-rcg2: Update the frac table for pixel clock Date: Wed, 2 Feb 2022 22:55:40 +0530 Message-Id: <20220202172540.2458-2-tdas@codeaurora.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220202172540.2458-1-tdas@codeaurora.org> References: <20220202172540.2458-1-tdas@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Support the new numerator and denominator for pixel clock. Fixes: 99cbd064b059f ("clk: qcom: Support display RCG clocks") Signed-off-by: Taniya Das Reviewed-by: Stephen Boyd --- drivers/clk/qcom/clk-rcg2.c | 1 + 1 file changed, 1 insertion(+) -- Qualcomm INDIA, on behalf of Qualcomm Innovation Center, Inc.is a member of the Code Aurora Forum, hosted by the Linux Foundation. diff --git a/drivers/clk/qcom/clk-rcg2.c b/drivers/clk/qcom/clk-rcg2.c index 34251ec98def..036c8071c07a 100644 --- a/drivers/clk/qcom/clk-rcg2.c +++ b/drivers/clk/qcom/clk-rcg2.c @@ -730,6 +730,7 @@ static const struct frac_entry frac_table_pixel[] = { { 2, 9 }, { 4, 9 }, { 1, 1 }, + { 2, 3 }, { } };