From patchwork Fri Feb 19 09:26:56 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 80564 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 o1J9RUIi017550 for ; Fri, 19 Feb 2010 09:27:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752460Ab0BSJ1U (ORCPT ); Fri, 19 Feb 2010 04:27:20 -0500 Received: from mail-gx0-f227.google.com ([209.85.217.227]:42344 "EHLO mail-gx0-f227.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752413Ab0BSJ1R (ORCPT ); Fri, 19 Feb 2010 04:27:17 -0500 Received: by gxk27 with SMTP id 27so3867426gxk.1 for ; Fri, 19 Feb 2010 01:27:16 -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=/UB3MmIABWg1mx2PUx+IPsFi+XHfgWvb2lti1uEz6R0=; b=nSQEDYIhR0noefGpXdXq3ZVkBivJ3LMpRs6PDSkVNxWWG70gTgizKDOsCHhW3Jz5am NuDu9Gti9CdpZZ4lbzaXYMDAR4SuRUCg3V2FHDCw/LOcuN64yqcwvHaM1U+qvmGrY8XL cPx5+Sms9m23RCIBEEy/3SBntn7HtHXvFlKNg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=s384OUXhMD3ma+gJBHG1vlUtwocd0dY9AkIjvlYZ3jfBJOfTtShZKBT9CEsXdVMMmD tv8ag0zj2MiePoOBBc83QEG2ZysgiOR544dnHrbKrsWlXywBrhsX1HVriPncRd/ZKy2E umm0xMl5iaBu5RdE+a16Wne67Z1Hka6H67klk= Received: by 10.150.118.26 with SMTP id q26mr1240321ybc.303.1266571636633; Fri, 19 Feb 2010 01:27:16 -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 15sm4062450yxh.40.2010.02.19.01.27.15 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 19 Feb 2010 01:27:16 -0800 (PST) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org Date: Fri, 19 Feb 2010 18:26:56 +0900 Message-Id: <20100219092656.638.74788.sendpatchset@t400s> Subject: [PATCH] sh: add sh7724 kick callback to 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:27:30 +0000 (UTC) --- 0003/arch/sh/include/asm/clock.h +++ work/arch/sh/include/asm/clock.h 2010-02-19 16:45:09.000000000 +0900 @@ -148,6 +148,7 @@ int sh_clk_mstp32_register(struct clk *c struct clk_div4_table { struct clk_div_mult_table *div_mult_table; + void (*kick)(struct clk *clk); }; int sh_clk_div4_register(struct clk *clks, int nr, --- 0003/arch/sh/kernel/cpu/clock-cpg.c +++ work/arch/sh/kernel/cpu/clock-cpg.c 2010-02-19 16:46:17.000000000 +0900 @@ -188,6 +188,7 @@ static int sh_clk_div4_set_parent(struct static int sh_clk_div4_set_rate(struct clk *clk, unsigned long rate, int algo_id) { + struct clk_div4_table *d4t = clk->priv; unsigned long value; int idx = clk_rate_table_find(clk, clk->freq_table, rate); if (idx < 0) @@ -198,6 +199,9 @@ static int sh_clk_div4_set_rate(struct c value |= (idx << clk->enable_bit); __raw_writel(value, clk->enable_reg); + if (d4t->kick) + d4t->kick(clk); + return 0; } --- 0003/arch/sh/kernel/cpu/sh4a/clock-sh7724.c +++ work/arch/sh/kernel/cpu/sh4a/clock-sh7724.c 2010-02-19 16:51:22.000000000 +0900 @@ -127,6 +127,16 @@ struct clk *main_clks[] = { &div3_clk, }; +static void div4_kick(struct clk *clk) +{ + unsigned long value; + + /* set KICK bit in FRQCRA to update hardware setting */ + value = __raw_readl(FRQCRA); + value |= (1 << 31); + __raw_writel(value, FRQCRA); +} + static int divisors[] = { 2, 3, 4, 6, 8, 12, 16, 0, 24, 32, 36, 48, 0, 72 }; static struct clk_div_mult_table div4_div_mult_table = { @@ -136,6 +146,7 @@ static struct clk_div_mult_table div4_di static struct clk_div4_table div4_table = { .div_mult_table = &div4_div_mult_table, + .kick = div4_kick, }; enum { DIV4_I, DIV4_SH, DIV4_B, DIV4_P, DIV4_M1, DIV4_NR };