From patchwork Tue Feb 9 08:22:30 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 77957 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 o198TCqC002849 for ; Tue, 9 Feb 2010 08:29:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752256Ab0BII3L (ORCPT ); Tue, 9 Feb 2010 03:29:11 -0500 Received: from mail-gx0-f224.google.com ([209.85.217.224]:33216 "EHLO mail-gx0-f224.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751674Ab0BII3L (ORCPT ); Tue, 9 Feb 2010 03:29:11 -0500 Received: by gxk24 with SMTP id 24so1497280gxk.1 for ; Tue, 09 Feb 2010 00:29:09 -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=/NA8+4q0e0wBH0tTehTqFnYzFsRD44qRPJoZP3VrAlg=; b=o5bW/O1Q7ThasSUlWDPHSSuAEJPPz0ggBZMifvSWXRIQmSlFnzrAJNvBN3lQQyfXtc Ru3hbA9ZW5ZOm1HZ5oXQ+MOQr61U+vir6ABVWlDPQRwBBY5gPjgPVIfjzQI1z7B+gM5c 8sOVVJcIOCkdlGXRcNrzG9LYM4QkZQUUB0aXo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=m2siE1rIcnXtvE6vsoPwSbzVB3itriQ8gVZpgBTZNTtrNqxOi8Nz0oxSulfqnzJovG hbdhtI5hltrix7MS9gUYk372BQU9Lc7Ug27FyTZUNPZerWg/8IdZaYroQs2qNk1MqIh6 hZir2bcg8mDOXQzEjLv7EOhFj72GLoy6d/QJs= Received: by 10.90.8.22 with SMTP id 22mr2065366agh.66.1265704149277; Tue, 09 Feb 2010 00:29:09 -0800 (PST) Received: from rxone.opensource.se (49.14.32.202.bf.2iij.net [202.32.14.49]) by mx.google.com with ESMTPS id 14sm3519411gxk.10.2010.02.09.00.29.07 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 09 Feb 2010 00:29:08 -0800 (PST) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org Date: Tue, 09 Feb 2010 17:22:30 +0900 Message-Id: <20100209082230.16804.92759.sendpatchset@rxone.opensource.se> Subject: [PATCH] sh: break out enable/reparent div4 clocks on sh7723 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]); Tue, 09 Feb 2010 08:29:12 +0000 (UTC) --- 0001/arch/sh/kernel/cpu/sh4a/clock-sh7723.c +++ work/arch/sh/kernel/cpu/sh4a/clock-sh7723.c 2010-02-09 17:14:33.000000000 +0900 @@ -117,8 +117,7 @@ static struct clk_div_mult_table div4_ta .nr_multipliers = ARRAY_SIZE(multipliers), }; -enum { DIV4_I, DIV4_U, DIV4_SH, DIV4_B, DIV4_B3, DIV4_P, - DIV4_SIUA, DIV4_SIUB, DIV4_IRDA, DIV4_NR }; +enum { DIV4_I, DIV4_U, DIV4_SH, DIV4_B, DIV4_B3, DIV4_P, DIV4_NR }; #define DIV4(_str, _reg, _bit, _mask, _flags) \ SH_CLK_DIV4(_str, &pll_clk, _reg, _bit, _mask, _flags) @@ -130,11 +129,20 @@ struct clk div4_clks[DIV4_NR] = { [DIV4_B] = DIV4("bus_clk", FRQCR, 8, 0x0dbf, CLK_ENABLE_ON_INIT), [DIV4_B3] = DIV4("b3_clk", FRQCR, 4, 0x0db4, CLK_ENABLE_ON_INIT), [DIV4_P] = DIV4("peripheral_clk", FRQCR, 0, 0x0dbf, 0), - [DIV4_SIUA] = DIV4("siua_clk", SCLKACR, 0, 0x0dbf, 0), - [DIV4_SIUB] = DIV4("siub_clk", SCLKBCR, 0, 0x0dbf, 0), +}; + +enum { DIV4_IRDA, DIV4_ENABLE_NR }; + +struct clk div4_enable_clks[DIV4_ENABLE_NR] = { [DIV4_IRDA] = DIV4("irda_clk", IRDACLKCR, 0, 0x0dbf, 0), }; +enum { DIV4_SIUA, DIV4_SIUB, DIV4_REPARENT_NR }; + +struct clk div4_reparent_clks[DIV4_REPARENT_NR] = { + [DIV4_SIUA] = DIV4("siua_clk", SCLKACR, 0, 0x0dbf, 0), + [DIV4_SIUB] = DIV4("siub_clk", SCLKBCR, 0, 0x0dbf, 0), +}; struct clk div6_clks[] = { SH_CLK_DIV6("video_clk", &pll_clk, VCLKCR, 0), }; @@ -216,6 +224,14 @@ int __init arch_clk_init(void) ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table); if (!ret) + ret = sh_clk_div4_enable_register(div4_enable_clks, + DIV4_ENABLE_NR, &div4_table); + + if (!ret) + ret = sh_clk_div4_reparent_register(div4_reparent_clks, + DIV4_REPARENT_NR, &div4_table); + + if (!ret) ret = sh_clk_div6_register(div6_clks, ARRAY_SIZE(div6_clks)); if (!ret)