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: 9824769 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 23CBB603B5 for ; Tue, 4 Jul 2017 12:34:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1476C22B1F for ; Tue, 4 Jul 2017 12:34:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 08C772823D; Tue, 4 Jul 2017 12:34:53 +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 8064422B1F for ; Tue, 4 Jul 2017 12:34:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752135AbdGDMew (ORCPT ); Tue, 4 Jul 2017 08:34:52 -0400 Received: from mail-wm0-f44.google.com ([74.125.82.44]:38361 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750891AbdGDMeu (ORCPT ); Tue, 4 Jul 2017 08:34:50 -0400 Received: by mail-wm0-f44.google.com with SMTP id f67so83297298wmh.1 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=Gs8+Mnm1BpfQVQ+3Hs3/l3hpvQk04vBrJNDXB08KGME3y5bjF5U/O8TRC85VnySX9N TH0bIy+cO2PwSeEzNm1NpxJyX/zTBmanjwFAbOX53F4DrRBUohLSVKJi/850zKzNBs5Y fxWsoEyfQQmW2EmHxpUJJukGCOFxcGViSPnhVYWgJ/WtIauvn08p6oRVQXtfklG99ERM Co1ZozEJpFHLAPIczSYRhvy1iLGu30wI7VnXBED4Ec2tPY7Y4FoMLYp/6ICMCwWh46Xl 5XvQySLb62cfE44MIcPL7WrPlK+fLgFxJXxEZW+YiTBh+UGZYCTkyczyrsamXRvuGN1+ KUnQ== X-Gm-Message-State: AIVw111slmkVU0YpB+QJeGIL8ovtSi0IOEX81rC0VkO9G7OLIZJZtIhg +I4rX/moQ8+Unpbc 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-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@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-clk" 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)