From patchwork Fri Nov 10 16:06:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 118590 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp8110297qgn; Fri, 10 Nov 2017 08:07:09 -0800 (PST) X-Google-Smtp-Source: AGs4zMZTm9P7v+VR/4OR86foOj7MPjQ5a/V85UPYGIvKZKyCKS+gna+Kbf3SgZAWtbOEb1xOLSw9 X-Received: by 10.99.108.2 with SMTP id h2mr802247pgc.362.1510330029614; Fri, 10 Nov 2017 08:07:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510330029; cv=none; d=google.com; s=arc-20160816; b=AANrOCdpyZJ6nggCSUVCwbUSx9GVNTDeddyW73HAxKEoIuxxYXl+7TyiyYy7vLp8dT RVPILR9xibhdkh5IkEMwoUu5sH9+17bOX4CdZIehhetekvTyJfKLW+9QyKTcOiYbi/IN T2L3iGPtenAFk9YINYYtiiL8qiQPctO65B4cjarU2YHVisrRoXcHnqe8lkAtkLIi5O9E Tg2sXI8fMSNgwAbIb7UWSogmpJhCUhyIESAFDPZUMu98JRVK3iE78OfL064ReWJrqgeG ybW6kta82KEvx/7zyYZC0AVG9V2iaYTfRnmiY4jm94Wna4zIeCMAMqD0FFcs9TPjph3i MawA== 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 :arc-authentication-results; bh=V3ys9qhhueh4HWVtUBjq2Oc1LhV8D1eipxeOsvTxrUg=; b=aD6yg4pJsQ1WClABFydZ2R7C4kxt6tKhymEHl+/Ru/RNIzXDAb+DLocpj0r0h9h6lk z8xF0JPeT5B3y2fqA2C870S1nK31hMav66g8rhgRUlrhP4FyJ4hEof11bR4auRS733Vt tUXAkRL2Isseie+L3QPIhURtOyCzgmiLJZMD5D/1oaHX5sSe2qzGiv+Seu0Bhj9O2NkK IZ85Un5R1TSbkpxM8S7ExXEpUquvfnoeir0uQeb/Vj44vCg48Rq2VFMZzoC71rtUTjMt Vf9FuobySJvA4vuEC01C/pvDiSEqvRz//dEWn25coWymAtqvW2sgxwaO8PRmDaq70nTP G3zg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f6si9933203pfe.156.2017.11.10.08.07.09; Fri, 10 Nov 2017 08:07:09 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753212AbdKJQHI (ORCPT + 24 others); Fri, 10 Nov 2017 11:07:08 -0500 Received: from foss.arm.com ([217.140.101.70]:60736 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751191AbdKJQHG (ORCPT ); Fri, 10 Nov 2017 11:07:06 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 322321435; Fri, 10 Nov 2017 08:07:06 -0800 (PST) Received: from e107155-lin.cambridge.arm.com (unknown [10.1.210.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id EA2E03F246; Fri, 10 Nov 2017 08:07:04 -0800 (PST) From: Sudeep Holla To: linux-kernel@vger.kernel.org Cc: Liviu Dudau , Sudeep Holla , Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org Subject: [PATCH] clk: versatile: add min/max rate boundaries for vexpress osc clock Date: Fri, 10 Nov 2017 16:06:57 +0000 Message-Id: <1510330017-32200-1-git-send-email-sudeep.holla@arm.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clock framework has a provider API(clk_hw_set_rate_range) to set the min/max rate of a clock. Use the same to set the boundaries for the vexpress osc clock. Cc: Michael Turquette Cc: Stephen Boyd Cc: linux-clk@vger.kernel.org Signed-off-by: Sudeep Holla --- drivers/clk/versatile/clk-vexpress-osc.c | 1 + 1 file changed, 1 insertion(+) Hi Stephen, Just a quick question, does the clk core ensure the round_rate request to the clock provider is within this bounds ? A quick grep suggests it's used after the call to round_rate in clk_calc_new_rates. I can't recall the details from when you introduced clk_hw_set_rate_range. Regards, Sudeep -- 2.7.4 diff --git a/drivers/clk/versatile/clk-vexpress-osc.c b/drivers/clk/versatile/clk-vexpress-osc.c index e7a868b83fe5..d3b5af2a02ab 100644 --- a/drivers/clk/versatile/clk-vexpress-osc.c +++ b/drivers/clk/versatile/clk-vexpress-osc.c @@ -104,6 +104,7 @@ static int vexpress_osc_probe(struct platform_device *pdev) return PTR_ERR(clk); of_clk_add_provider(pdev->dev.of_node, of_clk_src_simple_get, clk); + clk_hw_set_rate_range(&osc->hw, osc->rate_min, osc->rate_max); dev_dbg(&pdev->dev, "Registered clock '%s'\n", init.name);