From patchwork Fri Oct 3 13:57:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 38318 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DE4732057C for ; Fri, 3 Oct 2014 13:58:01 +0000 (UTC) Received: by mail-wi0-f197.google.com with SMTP id n3sf848908wiv.4 for ; Fri, 03 Oct 2014 06:58:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=5uEQlo79+9oZKu77qAGVLMtuu3JFG0tem4uIjEXeGAg=; b=Iv7iFOBaGPh6kwq90/qvVCVXsYte91TBLMXizSVMQp5vNrQR8et6jWcVSJOdoEYi7/ YmLMvEpjr0ynbs+V9uP8P5rqwYTcU1Q4XDObWAoyacJArMqLH4/i+DwH0ewXL8h0eJyg 7XMWugLxCXqlqJOqEstMNSL6sLl8zg38b+kw7aI77j2LVmLtUsKrLHATTDo/sSepIZsN dfv3o7QPid59SK5KJVE/OIyeuOcVMi6+becCTbo7CcxsSllYxnaYDbxNZ7kT/bt/fSm9 l/afK8b2Uimol7g3x5L4GElgUoV4HsPpFgFkwACONHinXreNrBdqBx+mMWmKSEMQ68Oh YLCg== X-Gm-Message-State: ALoCoQmZaup5OFAT6PM2c3Y2UtagPfa3tQxfkGjh5/SCjMA99D0Y7zSJYXFDvhd3ZcAH6aGx45MK X-Received: by 10.152.26.225 with SMTP id o1mr1019432lag.4.1412344681071; Fri, 03 Oct 2014 06:58:01 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.224.161 with SMTP id rd1ls367084lac.95.gmail; Fri, 03 Oct 2014 06:58:00 -0700 (PDT) X-Received: by 10.112.182.42 with SMTP id eb10mr5902454lbc.7.1412344680932; Fri, 03 Oct 2014 06:58:00 -0700 (PDT) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com [209.85.215.52]) by mx.google.com with ESMTPS id bf9si11320491lab.68.2014.10.03.06.58.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 Oct 2014 06:58:00 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by mail-la0-f52.google.com with SMTP id hz20so1065094lab.39 for ; Fri, 03 Oct 2014 06:58:00 -0700 (PDT) X-Received: by 10.152.5.168 with SMTP id t8mr5932785lat.67.1412344680798; Fri, 03 Oct 2014 06:58:00 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.130.169 with SMTP id of9csp231221lbb; Fri, 3 Oct 2014 06:58:00 -0700 (PDT) X-Received: by 10.67.15.172 with SMTP id fp12mr7566956pad.4.1412344679253; Fri, 03 Oct 2014 06:57:59 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gs8si7375428pac.40.2014.10.03.06.57.58 for ; Fri, 03 Oct 2014 06:57:59 -0700 (PDT) Received-SPF: none (google.com: linux-omap-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752670AbaJCN56 (ORCPT + 5 others); Fri, 3 Oct 2014 09:57:58 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:52952 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752469AbaJCN55 (ORCPT ); Fri, 3 Oct 2014 09:57:57 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id s93DvUv2025411; Fri, 3 Oct 2014 08:57:30 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s93DvUGl019933; Fri, 3 Oct 2014 08:57:30 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.174.1; Fri, 3 Oct 2014 08:57:30 -0500 Received: from sokoban.home (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s93DvJfe007112; Fri, 3 Oct 2014 08:57:28 -0500 From: Tero Kristo To: , , , CC: Subject: [PATCH 4/5] ARM: OMAP3: clock: add support for dpll4_set_rate_and_parent Date: Fri, 3 Oct 2014 16:57:13 +0300 Message-ID: <1412344634-2798-5-git-send-email-t-kristo@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1412344634-2798-1-git-send-email-t-kristo@ti.com> References: <1412344634-2798-1-git-send-email-t-kristo@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: t-kristo@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Expand the support of omap4 per-dpll to provide set_rate_and_parent. This is required for proper behavior of clk_change_rate with determine_rate support. Signed-off-by: Tero Kristo --- arch/arm/mach-omap2/clock3xxx.c | 36 ++++++++++++++++++++++++++++++++++++ include/linux/clk/ti.h | 2 ++ 2 files changed, 38 insertions(+) diff --git a/arch/arm/mach-omap2/clock3xxx.c b/arch/arm/mach-omap2/clock3xxx.c index 9a25601..a9e86db 100644 --- a/arch/arm/mach-omap2/clock3xxx.c +++ b/arch/arm/mach-omap2/clock3xxx.c @@ -38,6 +38,18 @@ /* needed by omap3_core_dpll_m2_set_rate() */ struct clk *sdrc_ick_p, *arm_fck_p; + +/** + * omap3_dpll4_set_rate - set rate for omap3 per-dpll + * @hw: clock to change + * @rate: target rate for clock + * @parent_rate: rate of the parent clock + * + * Check if the current SoC supports the per-dpll reprogram operation + * or not, and then do the rate change if supported. Returns -EINVAL + * if not supported, 0 for success, and potential error codes from the + * clock rate change. + */ int omap3_dpll4_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate) { @@ -54,6 +66,30 @@ int omap3_dpll4_set_rate(struct clk_hw *hw, unsigned long rate, return omap3_noncore_dpll_set_rate(hw, rate, parent_rate); } +/** + * omap3_dpll4_set_rate_and_parent - set rate and parent for omap3 per-dpll + * @hw: clock to change + * @rate: target rate for clock + * @parent_rate: rate of the parent clock + * @index: parent index, 0 - reference clock, 1 - bypass clock + * + * Check if the current SoC support the per-dpll reprogram operation + * or not, and then do the rate + parent change if supported. Returns + * -EINVAL if not supported, 0 for success, and potential error codes + * from the clock rate change. + */ +int omap3_dpll4_set_rate_and_parent(struct clk_hw *hw, unsigned long rate, + unsigned long parent_rate, u8 index) +{ + if (ti_clk_features.flags & TI_CLK_DPLL4_DENY_REPROGRAM) { + pr_err("clock: DPLL4 cannot change rate due to silicon 'Limitation 2.5' on 3430ES1.\n"); + return -EINVAL; + } + + return omap3_noncore_dpll_set_rate_and_parent(hw, rate, parent_rate, + index); +} + void __init omap3_clk_lock_dpll5(void) { struct clk *dpll5_clk; diff --git a/include/linux/clk/ti.h b/include/linux/clk/ti.h index 541dc33..57242ba 100644 --- a/include/linux/clk/ti.h +++ b/include/linux/clk/ti.h @@ -291,6 +291,8 @@ int omap2_clk_disable_autoidle_all(void); void omap2_clk_enable_init_clocks(const char **clk_names, u8 num_clocks); int omap3_dpll4_set_rate(struct clk_hw *clk, unsigned long rate, unsigned long parent_rate); +int omap3_dpll4_set_rate_and_parent(struct clk_hw *hw, unsigned long rate, + unsigned long parent_rate, u8 index); int omap2_dflt_clk_enable(struct clk_hw *hw); void omap2_dflt_clk_disable(struct clk_hw *hw); int omap2_dflt_clk_is_enabled(struct clk_hw *hw);