From patchwork Thu Jul 14 23:24:41 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hunter, Jon" X-Patchwork-Id: 976862 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6ENOjPM001940 for ; Thu, 14 Jul 2011 23:24:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932592Ab1GNXYo (ORCPT ); Thu, 14 Jul 2011 19:24:44 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:58803 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932590Ab1GNXYo (ORCPT ); Thu, 14 Jul 2011 19:24:44 -0400 Received: from dlep36.itg.ti.com ([157.170.170.91]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id p6ENOhNp009158 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 14 Jul 2011 18:24:43 -0500 Received: from dlep26.itg.ti.com (smtp-le.itg.ti.com [157.170.170.27]) by dlep36.itg.ti.com (8.13.8/8.13.8) with ESMTP id p6ENOhZ1019777; Thu, 14 Jul 2011 18:24:43 -0500 (CDT) Received: from dlee74.ent.ti.com (localhost [127.0.0.1]) by dlep26.itg.ti.com (8.13.8/8.13.8) with ESMTP id p6ENOhIh015037; Thu, 14 Jul 2011 18:24:43 -0500 (CDT) Received: from dlelxv23.itg.ti.com (172.17.1.198) by dlee74.ent.ti.com (157.170.170.8) with Microsoft SMTP Server id 8.3.106.1; Thu, 14 Jul 2011 18:24:43 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlelxv23.itg.ti.com (8.13.8/8.13.8) with ESMTP id p6ENOhVu016660; Thu, 14 Jul 2011 18:24:43 -0500 Received: from localhost (h1-7.vpn.ti.com [172.24.1.7]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id p6ENOgf08266; Thu, 14 Jul 2011 18:24:42 -0500 (CDT) From: Jon Hunter To: Paul Walmsley CC: linux-omap , Mike Turquette Subject: [PATCH 3/6] OMAP3+: use DPLL's round_rate when setting rate Date: Thu, 14 Jul 2011 18:24:41 -0500 Message-ID: <1310685881-3323-1-git-send-email-jon-hunter@ti.com> X-Mailer: git-send-email 1.7.4.1 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 14 Jul 2011 23:24:45 +0000 (UTC) From: Mike Turquette omap3_noncore_dpll_set_rate uses omap2_dpll_round_rate explicitly. Instead use the struct clk pointer's round_rate function to allow for DPLL's with special needs. Also the rounded rate can differ from target rate, so to better reflect reality set clk->rate equal to the rounded rate when setting DPLL frequency. This avoids issues where the DPLL frequency is slightly different than what debugfs clock tree reports using the old target rate. An example of both of these needs is DPLL_ABE on OMAP4 which can have a 4x multiplier on top of the usual MN dividers depending on register settings. This requires a special round_rate function that might yield a rate different from the initial target. Signed-off-by: Mike Turquette --- arch/arm/mach-omap2/dpll3xxx.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-omap2/dpll3xxx.c b/arch/arm/mach-omap2/dpll3xxx.c index f77022b..73a1595 100644 --- a/arch/arm/mach-omap2/dpll3xxx.c +++ b/arch/arm/mach-omap2/dpll3xxx.c @@ -455,7 +455,7 @@ int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate) new_parent = dd->clk_bypass; } else { if (dd->last_rounded_rate != rate) - omap2_dpll_round_rate(clk, rate); + rate = clk->round_rate(clk, rate); if (dd->last_rounded_rate == 0) return -EINVAL;