From patchwork Tue Mar 4 09:18:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 25661 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f198.google.com (mail-ob0-f198.google.com [209.85.214.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 73FE320540 for ; Tue, 4 Mar 2014 09:19:30 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id wn1sf10420322obc.9 for ; Tue, 04 Mar 2014 01:19:29 -0800 (PST) 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=ZD7ydpIb9Axm5bQLoJ3dFz/vyakETTX8Y7+K6VQOVVM=; b=SFTKTQgiu9nLRXRiDX+5dt6xwsF1IbSKgy8hAvhI0p1Y37znMzdk0Nvq11xki/bgrj XpNSHWoTMWWOUOzLfqDIO4UcIXh564ThIUyjeBveLKSel9fXD4k0O3DxCRlcU0avHMIO XgfrjXEvGxBTHRrUiIJ/hzWMlVHXHnaA/Hhau8x2aODskU8DHtK1Pd6fCcfCRuTVLA+l nu9Y7jN/VX9Th1drBQ25QfSW5KBYlk/GZs4v/gBPjI3riUDB60jrB4p0e1OYk09p/Khw jK3rNRzP/YcOehunUAFg0Mn2KAMmlIvnEn0Zb1DAAQPa8C5UIOZwhkGZA4Y4qUbI4Dva kHTg== X-Gm-Message-State: ALoCoQnnERXq/eKHoUKDEul8Vn17QSASvlL3l+ddMI+s537Nat4yxXuRF9xdS/ApGVkX8yes9f9j X-Received: by 10.183.3.36 with SMTP id bt4mr15897361obd.29.1393924769726; Tue, 04 Mar 2014 01:19:29 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.48.161 with SMTP id o30ls2553891qga.94.gmail; Tue, 04 Mar 2014 01:19:29 -0800 (PST) X-Received: by 10.52.155.66 with SMTP id vu2mr40114vdb.50.1393924769613; Tue, 04 Mar 2014 01:19:29 -0800 (PST) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id ue9si4086327veb.92.2014.03.04.01.19.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Mar 2014 01:19:29 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.171; Received: by mail-ve0-f171.google.com with SMTP id cz12so5456605veb.30 for ; Tue, 04 Mar 2014 01:19:29 -0800 (PST) X-Received: by 10.221.40.10 with SMTP id to10mr21192489vcb.22.1393924769517; Tue, 04 Mar 2014 01:19:29 -0800 (PST) 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.220.130.193 with SMTP id u1csp113749vcs; Tue, 4 Mar 2014 01:19:29 -0800 (PST) X-Received: by 10.68.228.138 with SMTP id si10mr25058752pbc.13.1393924768676; Tue, 04 Mar 2014 01:19:28 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tu7si3609463pac.19.2014.03.04.01.19.27; Tue, 04 Mar 2014 01:19:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756693AbaCDJTX (ORCPT + 5 others); Tue, 4 Mar 2014 04:19:23 -0500 Received: from arroyo.ext.ti.com ([192.94.94.40]:54299 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756688AbaCDJTV (ORCPT ); Tue, 4 Mar 2014 04:19:21 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id s249ItBf002804; Tue, 4 Mar 2014 03:18:55 -0600 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s249ItMw011363; Tue, 4 Mar 2014 03:18:55 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.174.1; Tue, 4 Mar 2014 03:18:55 -0600 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s249Il49024729; Tue, 4 Mar 2014 03:18:53 -0600 From: Tero Kristo To: , , , , CC: , Subject: [PATCHv2 02/14] ARM: OMAP2420: clock: get rid of fixed-div property use Date: Tue, 4 Mar 2014 11:18:08 +0200 Message-ID: <1393924700-6510-3-git-send-email-t-kristo@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1393924700-6510-1-git-send-email-t-kristo@ti.com> References: <1393924700-6510-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=neutral (google.com: 209.85.128.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) 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: , Cleans up the code a bit and is useful for clock data DT conversion. Signed-off-by: Tero Kristo --- arch/arm/mach-omap2/cclock2420_data.c | 15 ++++----------- arch/arm/mach-omap2/clock.c | 21 --------------------- arch/arm/mach-omap2/clock.h | 3 --- 3 files changed, 4 insertions(+), 35 deletions(-) diff --git a/arch/arm/mach-omap2/cclock2420_data.c b/arch/arm/mach-omap2/cclock2420_data.c index 3e46ac1..3b0beea 100644 --- a/arch/arm/mach-omap2/cclock2420_data.c +++ b/arch/arm/mach-omap2/cclock2420_data.c @@ -1025,18 +1025,12 @@ DEFINE_CLK_OMAP_MUX_GATE(iva1_ifck, "iva1_clkdm", dsp_fck_clksel, OMAP2420_EN_IVA_COP_SHIFT, &clkhwops_wait, dsp_fck_parent_names, dsp_fck_ops); +DEFINE_CLK_FIXED_FACTOR(iva1_ifck_div, "iva1_ifck", &iva1_ifck, 0x0, 1, 2); + static struct clk iva1_mpu_int_ifck; static const char *iva1_mpu_int_ifck_parent_names[] = { - "iva1_ifck", -}; - -static const struct clk_ops iva1_mpu_int_ifck_ops = { - .init = &omap2_init_clk_clkdm, - .enable = &omap2_dflt_clk_enable, - .disable = &omap2_dflt_clk_disable, - .is_enabled = &omap2_dflt_clk_is_enabled, - .recalc_rate = &omap_fixed_divisor_recalc, + "iva1_ifck_div", }; static struct clk_hw_omap iva1_mpu_int_ifck_hw = { @@ -1047,11 +1041,10 @@ static struct clk_hw_omap iva1_mpu_int_ifck_hw = { .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN), .enable_bit = OMAP2420_EN_IVA_MPU_SHIFT, .clkdm_name = "iva1_clkdm", - .fixed_div = 2, }; DEFINE_STRUCT_CLK(iva1_mpu_int_ifck, iva1_mpu_int_ifck_parent_names, - iva1_mpu_int_ifck_ops); + aes_ick_ops); static struct clk mailboxes_ick; diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c index 591581a..4ac6e3d 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c @@ -82,27 +82,6 @@ u32 omap2_clk_readl(struct clk_hw_omap *clk, void __iomem *reg) } /* - * Used for clocks that have the same value as the parent clock, - * divided by some factor - */ -unsigned long omap_fixed_divisor_recalc(struct clk_hw *hw, - unsigned long parent_rate) -{ - struct clk_hw_omap *oclk; - - if (!hw) { - pr_warn("%s: hw is NULL\n", __func__); - return -EINVAL; - } - - oclk = to_clk_hw_omap(hw); - - WARN_ON(!oclk->fixed_div); - - return parent_rate / oclk->fixed_div; -} - -/* * OMAP2+ specific clock functions */ diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h index bda767a..3843c9f 100644 --- a/arch/arm/mach-omap2/clock.h +++ b/arch/arm/mach-omap2/clock.h @@ -189,9 +189,6 @@ struct clk_hw_omap_ops { void (*deny_idle)(struct clk_hw_omap *oclk); }; -unsigned long omap_fixed_divisor_recalc(struct clk_hw *hw, - unsigned long parent_rate); - /* CM_CLKSEL2_PLL.CORE_CLK_SRC bits (2XXX) */ #define CORE_CLK_SRC_32K 0x0 #define CORE_CLK_SRC_DPLL 0x1