From patchwork Fri Feb 28 09:22:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 25514 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f198.google.com (mail-yk0-f198.google.com [209.85.160.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 84AA9203C5 for ; Fri, 28 Feb 2014 09:24:18 +0000 (UTC) Received: by mail-yk0-f198.google.com with SMTP id 131sf2389454ykp.1 for ; Fri, 28 Feb 2014 01:24:18 -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=RsbzANwY3UMWdls1zGs0unh8i+NYexzxTCz9YBeajZE=; b=BdXjxQlBqdkHXS48Ygk3brhcZUEljSUWF6ej3YARh67ZsQti+LDGb4I+xgw0p0EzCK zQD/3WOyx8YWtELIvbqmbLGInL5mGhT0zL++cZ6pfol/6tdiSv0BaoV/aiDVGoNfyG/E x3kExQpLcDZ1jtyzGOFL9iQxNmUV+vKNzqysxDbylDXLD0QSJ30q7YdGQZoPDsoKskPP UsUZ1juqPmm/ssKkWES75NIL2I77G6JDFYi3cL6/X/8dj5858yZtniCXWI8+vLRyZAjJ Zd9SEDaWNMeYOwFRulj5DcXrsWK8eNTVDZ7otCbtEirYRjQ29Q7jbz3DBhCDBk6l7VRD OGtw== X-Gm-Message-State: ALoCoQlLmHJWRg40wSUymAc3A/YVRJEa38ov2bjLuYXfPXMbXo34FUWJS0SxEfxAdClVglDh1dtS X-Received: by 10.52.37.33 with SMTP id v1mr6958217vdj.1.1393579458297; Fri, 28 Feb 2014 01:24:18 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.93.161 with SMTP id d30ls1089357qge.4.gmail; Fri, 28 Feb 2014 01:24:18 -0800 (PST) X-Received: by 10.220.133.80 with SMTP id e16mr1541768vct.13.1393579458217; Fri, 28 Feb 2014 01:24:18 -0800 (PST) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id xs6si91576vec.40.2014.02.28.01.24.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Feb 2014 01:24:18 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.169; Received: by mail-vc0-f169.google.com with SMTP id hq11so450253vcb.14 for ; Fri, 28 Feb 2014 01:24:18 -0800 (PST) X-Received: by 10.58.91.101 with SMTP id cd5mr214176veb.5.1393579458135; Fri, 28 Feb 2014 01:24:18 -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 u1csp40787vcs; Fri, 28 Feb 2014 01:24:17 -0800 (PST) X-Received: by 10.66.221.103 with SMTP id qd7mr2370297pac.44.1393579457260; Fri, 28 Feb 2014 01:24:17 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tg2si1292316pbc.323.2014.02.28.01.24.16; Fri, 28 Feb 2014 01:24:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-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 S1751276AbaB1JYP (ORCPT + 9 others); Fri, 28 Feb 2014 04:24:15 -0500 Received: from comal.ext.ti.com ([198.47.26.152]:40311 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751172AbaB1JYN (ORCPT ); Fri, 28 Feb 2014 04:24:13 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id s1S9NpAb028243; Fri, 28 Feb 2014 03:23:51 -0600 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s1S9Np4Q001960; Fri, 28 Feb 2014 03:23:51 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Fri, 28 Feb 2014 03:23:50 -0600 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s1S9Nhs8015360; Fri, 28 Feb 2014 03:23:49 -0600 From: Tero Kristo To: , , , , CC: , Subject: [PATCH 02/12] ARM: OMAP2420: clock: get rid of fixed-div property use Date: Fri, 28 Feb 2014 11:22:54 +0200 Message-ID: <1393579384-23440-3-git-send-email-t-kristo@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1393579384-23440-1-git-send-email-t-kristo@ti.com> References: <1393579384-23440-1-git-send-email-t-kristo@ti.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@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.220.169 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