From patchwork Fri Feb 19 09:22:25 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 80563 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1J9I8qJ012527 for ; Fri, 19 Feb 2010 09:22:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752115Ab0BSJWs (ORCPT ); Fri, 19 Feb 2010 04:22:48 -0500 Received: from mail-yw0-f197.google.com ([209.85.211.197]:37307 "EHLO mail-yw0-f197.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752108Ab0BSJWr (ORCPT ); Fri, 19 Feb 2010 04:22:47 -0500 Received: by ywh35 with SMTP id 35so1870421ywh.4 for ; Fri, 19 Feb 2010 01:22:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :subject; bh=DpcQVh4g2DOiTex4J7DoEwvB6M3SQ26GkZjqhE6rflY=; b=K1mpUuw1kmGDHgNXLwJoa2/Pf+v/bVXF2VdQcpKXpfsQHw2oCSgFT6vDlCsp6dYm/p 3lEoFhshL1opTBeMLv387OjKDpmCMv2TPKu7Z3G2kX+74UOyHzhKZN037zcja6blAeuF 6cH0L7UrEJPsV8lOnGyhTcJTP5LPtkkj/zpsU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=h3BH2RoCE3i/18f1hyMLId7zXIL3R5YLs102RwoxDPmbk8aDih1A/PLBIiWHqBY6iq IiA1Px1pvGKeOFoi8MCXuRHvOxgVwNV88oNNFkW0ifptYMDthNlaepJNpPRePamJvu49 u9yrpNzobcFioY1gKmEz/aLbfVFADTckARBrI= Received: by 10.150.48.23 with SMTP id v23mr1227608ybv.184.1266571366400; Fri, 19 Feb 2010 01:22:46 -0800 (PST) Received: from ?127.0.0.1? (49.14.32.202.bf.2iij.net [202.32.14.49]) by mx.google.com with ESMTPS id 6sm4064428yxg.12.2010.02.19.01.22.44 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 19 Feb 2010 01:22:45 -0800 (PST) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org Date: Fri, 19 Feb 2010 18:22:25 +0900 Message-Id: <20100219092225.479.69458.sendpatchset@t400s> Subject: [PATCH] sh: introduce struct clk_div4_table Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 19 Feb 2010 09:22:50 +0000 (UTC) --- 0001/arch/sh/include/asm/clock.h +++ work/arch/sh/include/asm/clock.h 2010-02-19 16:27:37.000000000 +0900 @@ -146,12 +146,16 @@ int sh_clk_mstp32_register(struct clk *c .flags = _flags, \ } +struct clk_div4_table { + struct clk_div_mult_table *div_mult_table; +}; + int sh_clk_div4_register(struct clk *clks, int nr, - struct clk_div_mult_table *table); + struct clk_div4_table *table); int sh_clk_div4_enable_register(struct clk *clks, int nr, - struct clk_div_mult_table *table); + struct clk_div4_table *table); int sh_clk_div4_reparent_register(struct clk *clks, int nr, - struct clk_div_mult_table *table); + struct clk_div4_table *table); #define SH_CLK_DIV6(_name, _parent, _reg, _flags) \ { \ --- 0002/arch/sh/kernel/cpu/clock-cpg.c +++ work/arch/sh/kernel/cpu/clock-cpg.c 2010-02-19 16:30:45.000000000 +0900 @@ -149,7 +149,8 @@ int __init sh_clk_div6_register(struct c static unsigned long sh_clk_div4_recalc(struct clk *clk) { - struct clk_div_mult_table *table = clk->priv; + struct clk_div4_table *d4t = clk->priv; + struct clk_div_mult_table *table = d4t->div_mult_table; unsigned int idx; clk_rate_table_build(clk, clk->freq_table, table->nr_divisors, @@ -162,7 +163,8 @@ static unsigned long sh_clk_div4_recalc( static int sh_clk_div4_set_parent(struct clk *clk, struct clk *parent) { - struct clk_div_mult_table *table = clk->priv; + struct clk_div4_table *d4t = clk->priv; + struct clk_div_mult_table *table = d4t->div_mult_table; u32 value; int ret; @@ -234,11 +236,11 @@ static struct clk_ops sh_clk_div4_repare }; static int __init sh_clk_div4_register_ops(struct clk *clks, int nr, - struct clk_div_mult_table *table, struct clk_ops *ops) + struct clk_div4_table *table, struct clk_ops *ops) { struct clk *clkp; void *freq_table; - int nr_divs = table->nr_divisors; + int nr_divs = table->div_mult_table->nr_divisors; int freq_table_size = sizeof(struct cpufreq_frequency_table); int ret = 0; int k; @@ -267,20 +269,20 @@ static int __init sh_clk_div4_register_o } int __init sh_clk_div4_register(struct clk *clks, int nr, - struct clk_div_mult_table *table) + struct clk_div4_table *table) { return sh_clk_div4_register_ops(clks, nr, table, &sh_clk_div4_clk_ops); } int __init sh_clk_div4_enable_register(struct clk *clks, int nr, - struct clk_div_mult_table *table) + struct clk_div4_table *table) { return sh_clk_div4_register_ops(clks, nr, table, &sh_clk_div4_enable_clk_ops); } int __init sh_clk_div4_reparent_register(struct clk *clks, int nr, - struct clk_div_mult_table *table) + struct clk_div4_table *table) { return sh_clk_div4_register_ops(clks, nr, table, &sh_clk_div4_reparent_clk_ops); --- 0001/arch/sh/kernel/cpu/sh4a/clock-sh7343.c +++ work/arch/sh/kernel/cpu/sh4a/clock-sh7343.c 2010-02-19 16:39:04.000000000 +0900 @@ -107,13 +107,17 @@ struct clk *main_clks[] = { static int multipliers[] = { 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; static int divisors[] = { 1, 3, 2, 5, 3, 4, 5, 6, 8, 10, 12, 16, 20 }; -static struct clk_div_mult_table div4_table = { +static struct clk_div_mult_table div4_div_mult_table = { .divisors = divisors, .nr_divisors = ARRAY_SIZE(divisors), .multipliers = multipliers, .nr_multipliers = ARRAY_SIZE(multipliers), }; +static struct clk_div4_table div4_table = { + .div_mult_table = &div4_div_mult_table, +}; + enum { DIV4_I, DIV4_U, DIV4_SH, DIV4_B, DIV4_B3, DIV4_P, DIV4_SIUA, DIV4_SIUB, DIV4_NR }; --- 0001/arch/sh/kernel/cpu/sh4a/clock-sh7366.c +++ work/arch/sh/kernel/cpu/sh4a/clock-sh7366.c 2010-02-19 16:38:42.000000000 +0900 @@ -110,13 +110,17 @@ struct clk *main_clks[] = { static int multipliers[] = { 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; static int divisors[] = { 1, 3, 2, 5, 3, 4, 5, 6, 8, 10, 12, 16, 20 }; -static struct clk_div_mult_table div4_table = { +static struct clk_div_mult_table div4_div_mult_table = { .divisors = divisors, .nr_divisors = ARRAY_SIZE(divisors), .multipliers = multipliers, .nr_multipliers = ARRAY_SIZE(multipliers), }; +static struct clk_div4_table div4_table = { + .div_mult_table = &div4_div_mult_table, +}; + enum { DIV4_I, DIV4_U, DIV4_SH, DIV4_B, DIV4_B3, DIV4_P, DIV4_SIUA, DIV4_SIUB, DIV4_NR }; --- 0001/arch/sh/kernel/cpu/sh4a/clock-sh7722.c +++ work/arch/sh/kernel/cpu/sh4a/clock-sh7722.c 2010-02-19 16:38:05.000000000 +0900 @@ -110,13 +110,17 @@ struct clk *main_clks[] = { static int multipliers[] = { 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; static int divisors[] = { 1, 3, 2, 5, 3, 4, 5, 6, 8, 10, 12, 16, 20 }; -static struct clk_div_mult_table div4_table = { +static struct clk_div_mult_table div4_div_mult_table = { .divisors = divisors, .nr_divisors = ARRAY_SIZE(divisors), .multipliers = multipliers, .nr_multipliers = ARRAY_SIZE(multipliers), }; +static struct clk_div4_table div4_table = { + .div_mult_table = &div4_div_mult_table, +}; + #define DIV4(_str, _reg, _bit, _mask, _flags) \ SH_CLK_DIV4(_str, &pll_clk, _reg, _bit, _mask, _flags) --- 0001/arch/sh/kernel/cpu/sh4a/clock-sh7723.c +++ work/arch/sh/kernel/cpu/sh4a/clock-sh7723.c 2010-02-19 16:36:09.000000000 +0900 @@ -110,13 +110,17 @@ struct clk *main_clks[] = { static int multipliers[] = { 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; static int divisors[] = { 1, 3, 2, 5, 3, 4, 5, 6, 8, 10, 12, 16, 20 }; -static struct clk_div_mult_table div4_table = { +static struct clk_div_mult_table div4_div_mult_table = { .divisors = divisors, .nr_divisors = ARRAY_SIZE(divisors), .multipliers = multipliers, .nr_multipliers = ARRAY_SIZE(multipliers), }; +static struct clk_div4_table div4_table = { + .div_mult_table = &div4_div_mult_table, +}; + enum { DIV4_I, DIV4_U, DIV4_SH, DIV4_B, DIV4_B3, DIV4_P, DIV4_NR }; #define DIV4(_str, _reg, _bit, _mask, _flags) \ --- 0001/arch/sh/kernel/cpu/sh4a/clock-sh7724.c +++ work/arch/sh/kernel/cpu/sh4a/clock-sh7724.c 2010-02-19 16:41:16.000000000 +0900 @@ -129,11 +129,15 @@ struct clk *main_clks[] = { static int divisors[] = { 2, 3, 4, 6, 8, 12, 16, 0, 24, 32, 36, 48, 0, 72 }; -static struct clk_div_mult_table div4_table = { +static struct clk_div_mult_table div4_div_mult_table = { .divisors = divisors, .nr_divisors = ARRAY_SIZE(divisors), }; +static struct clk_div4_table div4_table = { + .div_mult_table = &div4_div_mult_table, +}; + enum { DIV4_I, DIV4_SH, DIV4_B, DIV4_P, DIV4_M1, DIV4_NR }; #define DIV4(_str, _reg, _bit, _mask, _flags) \ --- 0001/arch/sh/kernel/cpu/sh4a/clock-sh7785.c +++ work/arch/sh/kernel/cpu/sh4a/clock-sh7785.c 2010-02-19 16:37:45.000000000 +0900 @@ -57,11 +57,15 @@ static struct clk *clks[] = { static unsigned int div2[] = { 1, 2, 4, 6, 8, 12, 16, 18, 24, 32, 36, 48 }; -static struct clk_div_mult_table div4_table = { +static struct clk_div_mult_table div4_div_mult_table = { .divisors = div2, .nr_divisors = ARRAY_SIZE(div2), }; +static struct clk_div4_table div4_table = { + .div_mult_table = &div4_div_mult_table, +}; + enum { DIV4_I, DIV4_U, DIV4_SH, DIV4_B, DIV4_DDR, DIV4_GA, DIV4_DU, DIV4_P, DIV4_NR }; --- 0001/arch/sh/kernel/cpu/sh4a/clock-sh7786.c +++ work/arch/sh/kernel/cpu/sh4a/clock-sh7786.c 2010-02-19 16:37:34.000000000 +0900 @@ -59,11 +59,15 @@ static struct clk *clks[] = { static unsigned int div2[] = { 1, 2, 4, 6, 8, 12, 16, 18, 24, 32, 36, 48 }; -static struct clk_div_mult_table div4_table = { +static struct clk_div_mult_table div4_div_mult_table = { .divisors = div2, .nr_divisors = ARRAY_SIZE(div2), }; +static struct clk_div4_table div4_table = { + .div_mult_table = &div4_div_mult_table, +}; + enum { DIV4_I, DIV4_SH, DIV4_B, DIV4_DDR, DIV4_DU, DIV4_P, DIV4_NR }; #define DIV4(_str, _bit, _mask, _flags) \