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: 106962 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp951101qge; Tue, 4 Jul 2017 05:35:05 -0700 (PDT) X-Received: by 10.98.212.19 with SMTP id a19mr15362754pfh.131.1499171705729; Tue, 04 Jul 2017 05:35:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499171705; cv=none; d=google.com; s=arc-20160816; b=OW8JCXJXFm6I3b0YJQSBiO138pZceKzbqM8DaJcdIFqB0fXjVNPz17aiDKRC6R/kZH jQeITreBiisfQmcgq3Ho1MSHM9WVwaZAdMwBmuxBDXKyo+LL/UDml5g1Sk5ETDbQKf8F mItddcKqJDiWR5iFgV4zEHnyQEUXr8PRAanfhUi+Hai6PqmBIcLduBZ4i8tfRGCKhN5s FjvOzFX3vn9u75jMKz/5dRYs2KHljPFnEMTDcsNaLXqEI8nM6Cyce3wNBGfkyVzXV71z C3zxtd07NdmOs4XqXn5rgEgnJDwlbnu1DSDRJYZ0/rmcga1fLsmJph5hU4bavReNmaAa AD8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=+VLLl7HqOeBN0GWxRTFv4YShtwU8ZtVOboq+nDzCZbY=; b=p59DwqwlIrrqcJWn2fSLk56vE/K0xUBSV3VKS/cWIquMJKmOOfLfdAHZqbMsj1GEu6 un3yspS12vLwLuPaN4RcJsZTWZTfMKmSMc6pmsAyRkRdYVPOTGAwGyzkRg1tE6I4zBHT EHGTYbSlWI7sTDCa+/M7N1Z7RTIbcMangMqMzcEMLheAuP5dAj1mrE893WDe/o37ujY4 smcjZy8pc9oE4gHZKKFlVsXr6GLzMwuRt1uIR3PKw6iqtLaXW9i6KR7Sbc5dFQHlqW+E acLg9hxHoxFEQCOtKA8D3EdIMviElj1pKMNcbVERqNkCABc045edMFbctHypa63+B00Y oeZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=Am4ZdVDU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s136si4556178pgs.333.2017.07.04.05.35.05; Tue, 04 Jul 2017 05:35:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.b=Am4ZdVDU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752314AbdGDMex (ORCPT + 25 others); Tue, 4 Jul 2017 08:34:53 -0400 Received: from mail-wm0-f43.google.com ([74.125.82.43]:37649 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752052AbdGDMeu (ORCPT ); Tue, 4 Jul 2017 08:34:50 -0400 Received: by mail-wm0-f43.google.com with SMTP id i127so137057217wma.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=Y3q/mNfsZQ96LZHwcrD6gpfBCMQyYZa8dI0td0qdWssALyUB8a4ZnJTK+hcZW/dTsg KZsJMnWE8O2HUGqPLsXNYh40ZsO9MWfipZWFvaRNBqV5XM7/Inu/sMnb0OI9Baz6Q0Zz oEkZl4EVSDOAyruoqzsA5beiGRlDNJ2/AegUQwNEb1IitoRU2EjpNxe4IoGQ+U+9yiae ULOsiYhnPnx5Uz9/khK+MeN28VQ8l96xqZJ5PLufzuklGAuu4NPXnvhvKjIeFBqj5ZgW dHxZWcvNqmrdswZesHjwJPxJoySUEqBUBVuklx9I6iwuwP8EhlDHjkRPTn42/XDnTwq3 NraA== X-Gm-Message-State: AIVw112/Chz8m8mWmmaKIYQUhz5fSYTf6ygHuu1xoUyYCQbAQTzrzNwg NfTdn/R6ycvc2dMb 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/clk/qcom/clk-smd-rpm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)