From patchwork Tue Jul 4 12:34:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 9824773 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D49F7603B5 for ; Tue, 4 Jul 2017 12:35:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C4F0822B1F for ; Tue, 4 Jul 2017 12:35:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B73A22823D; Tue, 4 Jul 2017 12:35:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2113E22B1F for ; Tue, 4 Jul 2017 12:35:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750891AbdGDMew (ORCPT ); Tue, 4 Jul 2017 08:34:52 -0400 Received: from mail-wm0-f44.google.com ([74.125.82.44]:37649 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752053AbdGDMeu (ORCPT ); Tue, 4 Jul 2017 08:34:50 -0400 Received: by mail-wm0-f44.google.com with SMTP id i127so137057218wma.0 for ; Tue, 04 Jul 2017 05:34:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=+VLLl7HqOeBN0GWxRTFv4YShtwU8ZtVOboq+nDzCZbY=; b=Am4ZdVDUPEnwe/ZMKZXNIhGeDWDq3E7b+SFllbFQMDc6H1NzYKBpw3JB3agW2FVjVV rYyEq8wC4MF1NuikIKOo/01rv2owWEWFkI65WmfD2XKJqZtl3sF+vJY2UHnzrcG7Fiq9 6HfLNQBAC/KMNsbNU+XwYobpSjQ8czhLX//rI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=+VLLl7HqOeBN0GWxRTFv4YShtwU8ZtVOboq+nDzCZbY=; b=gcn4YoWb144YIcwDxlGnb+VSAVoLkXu5hoFdbWtb9OHtxR94tjfTei9zvEJE3/sSf0 O+iWSeAYWOuMAZTDb1TKYdwn+XGzk9cYB0GxBmmf6OR037TxIxtaVU3ECX3xToZB2kdU O5/+fq5XWEMEKW5JM/mAWQXRefR4Gj+fPRXaiBwBrKtUihL2BryaDI0ISyojQJRl/zXX JCtjQN0ygXa9pYz4Yd9WEgin8Z8WBhTk0XB/bqOubf8RGGUrT0k81coUvERhyI2ln3TW Ubto4pOeFH3NOqzwA4oEr81ZR0mRynZzm+Sk32dAhlZ9p4Vz/WHOOJ9VHj9vU02ukdqv fBRw== X-Gm-Message-State: AIVw111+5oZJiF5tJ/5PWhd7yAzdeJEZlydFvl/heYFUzfcXLV3Otr2j 2yFu3Q27BQoGd2is X-Received: by 10.80.175.198 with SMTP id h64mr6269703edd.131.1499171689335; Tue, 04 Jul 2017 05:34:49 -0700 (PDT) Received: from mms-0441.qualcomm.mm-sol.com ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id e54sm8251607eda.27.2017.07.04.05.34.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Jul 2017 05:34:48 -0700 (PDT) From: Georgi Djakov To: sboyd@codeaurora.org Cc: mturquette@baylibre.com, andy.gross@linaro.org, architt@codeaurora.org, bjorn.andersson@linaro.org, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, georgi.djakov@linaro.org Subject: [PATCH] clk: qcom: clk-smd-rpm: Fix the initial rate of branches Date: Tue, 4 Jul 2017 15:34:47 +0300 Message-Id: <20170704123447.25552-1-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.13.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP As there is no way to actually query the hardware for the current clock rate, now racalc_rate() just returns the last rate that was previously set. But if the rate was not set yet, we return the bogus rate of 1KHz. Knowing what the rate of XO is and that some clocks are just branches of it, we can do better and return that rate instead of a bogus one. Reported-by: Archit Taneja Signed-off-by: Georgi Djakov Reviewed-by: Archit Taneja Tested-by: Hans Verkuil --- drivers/clk/qcom/clk-smd-rpm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c index d990fe44aef3..7350a43b0573 100644 --- a/drivers/clk/qcom/clk-smd-rpm.c +++ b/drivers/clk/qcom/clk-smd-rpm.c @@ -116,12 +116,12 @@ #define DEFINE_CLK_SMD_RPM_XO_BUFFER(_platform, _name, _active, r_id) \ __DEFINE_CLK_SMD_RPM_BRANCH(_platform, _name, _active, \ - QCOM_SMD_RPM_CLK_BUF_A, r_id, 0, 1000, \ + QCOM_SMD_RPM_CLK_BUF_A, r_id, 0, 19200000, \ QCOM_RPM_KEY_SOFTWARE_ENABLE) #define DEFINE_CLK_SMD_RPM_XO_BUFFER_PINCTRL(_platform, _name, _active, r_id) \ __DEFINE_CLK_SMD_RPM_BRANCH(_platform, _name, _active, \ - QCOM_SMD_RPM_CLK_BUF_A, r_id, 0, 1000, \ + QCOM_SMD_RPM_CLK_BUF_A, r_id, 0, 19200000, \ QCOM_RPM_KEY_PIN_CTRL_CLK_BUFFER_ENABLE_KEY) #define to_clk_smd_rpm(_hw) container_of(_hw, struct clk_smd_rpm, hw)