From patchwork Thu Aug 28 06:59:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 4796691 Return-Path: X-Original-To: patchwork-ltsi-dev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B4792C0338 for ; Thu, 28 Aug 2014 08:00:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 99F3320179 for ; Thu, 28 Aug 2014 08:00:30 +0000 (UTC) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 78FE6200DF for ; Thu, 28 Aug 2014 08:00:29 +0000 (UTC) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id C84101198; Thu, 28 Aug 2014 07:29:56 +0000 (UTC) X-Original-To: ltsi-dev@lists.linuxfoundation.org Delivered-To: ltsi-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 35691C3F for ; Thu, 28 Aug 2014 07:29:53 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from kirsty.vergenet.net (kirsty.vergenet.net [202.4.237.240]) by smtp1.linuxfoundation.org (Postfix) with ESMTP id B9FFB1F88A for ; Thu, 28 Aug 2014 07:29:52 +0000 (UTC) Received: from ayumi.isobedori.kobe.vergenet.net (p4222-ipbfp1605kobeminato.hyogo.ocn.ne.jp [114.154.95.222]) by kirsty.vergenet.net (Postfix) with ESMTP id 5895C267300; Thu, 28 Aug 2014 17:08:28 +1000 (EST) Received: by ayumi.isobedori.kobe.vergenet.net (Postfix, from userid 7100) id D4501EDE5ED; Thu, 28 Aug 2014 16:08:26 +0900 (JST) From: Simon Horman To: ltsi-dev@lists.linuxfoundation.org Date: Thu, 28 Aug 2014 15:59:25 +0900 Message-Id: <1409209620-24487-440-git-send-email-horms+renesas@verge.net.au> X-Mailer: git-send-email 2.0.1 In-Reply-To: <1409209620-24487-1-git-send-email-horms+renesas@verge.net.au> References: <1409209620-24487-1-git-send-email-horms+renesas@verge.net.au> X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org Cc: Magnus Damm Subject: [LTSI-dev] [PATCH LTSI-3.14 439/894] ARM: shmobile: koelsch-reference: Refactor clock lookup hack X-BeenThere: ltsi-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: "A list to discuss patches, development, and other things related to the LTSI project" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ltsi-dev-bounces@lists.linuxfoundation.org Errors-To: ltsi-dev-bounces@lists.linuxfoundation.org X-Virus-Scanned: ClamAV using ClamSMTP From: Laurent Pinchart Make the clock lookup hack more generic to ease the addition of more devices. Signed-off-by: Laurent Pinchart Signed-off-by: Simon Horman (cherry picked from commit 189ef3d62df6701e58d216cf81277b88bb4ac7a8) Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/board-koelsch-reference.c | 42 +++++++++++++++--------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/arch/arm/mach-shmobile/board-koelsch-reference.c b/arch/arm/mach-shmobile/board-koelsch-reference.c index feb8d97..42c6eb4 100644 --- a/arch/arm/mach-shmobile/board-koelsch-reference.c +++ b/arch/arm/mach-shmobile/board-koelsch-reference.c @@ -32,30 +32,42 @@ static void __init koelsch_add_standard_devices(void) { #ifdef CONFIG_COMMON_CLK /* - * This is a really crude hack to provide clkdev support to the SCIF - * and CMT devices until they get moved to DT. + * This is a really crude hack to provide clkdev support to the CMT and + * DU devices until they get moved to DT. */ - static const char * const scif_names[] = { - "scifa0", "scifa1", "scifb0", "scifb1", "scifb2", "scifa2", - "scif0", "scif1", "scif2", "scif3", "scif4", "scif5", "scifa3", - "scifa4", "scifa5", + static const struct clk_name { + const char *clk; + const char *con_id; + const char *dev_id; + } clk_names[] = { + { "cmt0", NULL, "sh_cmt.0" }, + { "scifa0", NULL, "sh-sci.0" }, + { "scifa1", NULL, "sh-sci.1" }, + { "scifb0", NULL, "sh-sci.2" }, + { "scifb1", NULL, "sh-sci.3" }, + { "scifb2", NULL, "sh-sci.4" }, + { "scifa2", NULL, "sh-sci.5" }, + { "scif0", NULL, "sh-sci.6" }, + { "scif1", NULL, "sh-sci.7" }, + { "scif2", NULL, "sh-sci.8" }, + { "scif3", NULL, "sh-sci.9" }, + { "scif4", NULL, "sh-sci.10" }, + { "scif5", NULL, "sh-sci.11" }, + { "scifa3", NULL, "sh-sci.12" }, + { "scifa4", NULL, "sh-sci.13" }, + { "scifa5", NULL, "sh-sci.14" }, }; struct clk *clk; unsigned int i; - for (i = 0; i < ARRAY_SIZE(scif_names); ++i) { - clk = clk_get(NULL, scif_names[i]); + for (i = 0; i < ARRAY_SIZE(clk_names); ++i) { + clk = clk_get(NULL, clk_names[i].clk); if (!IS_ERR(clk)) { - clk_register_clkdev(clk, NULL, "sh-sci.%u", i); + clk_register_clkdev(clk, clk_names[i].con_id, + clk_names[i].dev_id); clk_put(clk); } } - - clk = clk_get(NULL, "cmt0"); - if (!IS_ERR(clk)) { - clk_register_clkdev(clk, NULL, "sh_cmt.0"); - clk_put(clk); - } #else r8a7791_clock_init(); #endif