From patchwork Wed Nov 6 23:39:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 3149991 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 965419F47C for ; Wed, 6 Nov 2013 23:39:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A87762061D for ; Wed, 6 Nov 2013 23:39:49 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AF9BB204B0 for ; Wed, 6 Nov 2013 23:39:48 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VeChL-0003fZ-1h; Wed, 06 Nov 2013 23:39:43 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VeChI-0006wz-KB; Wed, 06 Nov 2013 23:39:40 +0000 Received: from mail-pb0-x22d.google.com ([2607:f8b0:400e:c01::22d]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VeChF-0006wc-JE for linux-arm-kernel@lists.infradead.org; Wed, 06 Nov 2013 23:39:38 +0000 Received: by mail-pb0-f45.google.com with SMTP id ma3so218210pbc.32 for ; Wed, 06 Nov 2013 15:39:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:date:message-id:subject; bh=DRtFVC7tiR/pPrSd6N5xT2bqzTn+df7uEgGXUUAg/Iw=; b=LWalEvS0xhZSy1d6b0llLX3pfOHpFV7W25zlWsLJjjh37nZfZqqmX4qeyaoOCJcfER Aet8vwLUDhFee08N6wTuEkU4Xr+ic3BCvPGlyFjI7cja4IIhOYBFz2nzKbHASERKa/QW aGfMU7UvRXeAfqDw4KS6gz59aY7Um4Y8xAVvs8RHlr1t2eun0IY0BWqajTgRHotm5FJu DKpiaZwYvZdT2AUF6wYPMFQeKyBFVtGByZF7bdcUJNRGJDel8HCEefJxrNvdls47wmJs VvpAfgrFq5+Hr3tMNuWvJFviynfgZG4n/JMP7LNzuIEeeGs/1gVqUQD57kUoSp5oj1O0 3dQA== X-Received: by 10.68.209.232 with SMTP id mp8mr5781502pbc.129.1383781155343; Wed, 06 Nov 2013 15:39:15 -0800 (PST) Received: from [127.0.0.1] (ac230065.ppp.asahi-net.or.jp. [183.77.230.65]) by mx.google.com with ESMTPSA id rv9sm605847pbc.4.2013.11.06.15.39.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Nov 2013 15:39:14 -0800 (PST) From: Magnus Damm To: linux-sh@vger.kernel.org Date: Thu, 07 Nov 2013 08:39:52 +0900 Message-Id: <20131106233952.8558.85734.sendpatchset@w520> Subject: [PATCH/RFC] clk: shmobile: DT property SoC <-> CCF interface prototype X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131106_183937_723632_41103444 X-CRM114-Status: GOOD ( 14.00 ) X-Spam-Score: -2.0 (--) Cc: grant.likely@linaro.org, mturquette@linaro.org, Magnus Damm , laurent.pinchart@ideasonboard.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Magnus Damm Prototype patch to use a DT property to pass "CPG mode" (clock device boot time hardware configuration) from SoC code in arch/arm/ to CCF bits in drivers/clk/ Applies on top of the r8a7790 CCF code by Laurent. Mainly written to show how a property can be used instead of introducing a custom symbol dependency. The SoC specific code needs to use of_update_property() to setup this DT property after reading out the boot mode from hardware during boot. Not-Yet-Signed-off-by: Magnus Damm --- drivers/clk/shmobile/clk-r8a7790.c | 15 ++++++--------- include/linux/clk/shmobile.h | 19 ------------------- 2 files changed, 6 insertions(+), 28 deletions(-) --- 0018/drivers/clk/shmobile/clk-r8a7790.c +++ work/drivers/clk/shmobile/clk-r8a7790.c 2013-11-06 17:28:36.000000000 +0900 @@ -12,7 +12,6 @@ #include #include -#include #include #include #include @@ -70,8 +69,6 @@ static const struct clk_div_table cpg_sd { 10, 36 }, { 11, 48 }, { 12, 10 }, { 0, 0 }, }; -static u32 cpg_mode __initdata; - #define CPG_SDCKCR 0x00000074 static void __init r8a7790_cpg_clocks_init(struct device_node *np) @@ -80,6 +77,12 @@ static void __init r8a7790_cpg_clocks_in struct r8a7790_cpg *cpg; struct clk **clks; unsigned int i; + u32 cpg_mode; + + if (of_property_read_u32(np, "cpg-mode", &cpg_mode)) { + pr_err("%s: failed to determine CPG mode\n", __func__); + return; + } cpg = kzalloc(sizeof(*cpg), GFP_KERNEL); clks = kzalloc(CPG_NUM_CLOCKS * sizeof(*clks), GFP_KERNEL); @@ -168,9 +171,3 @@ static void __init r8a7790_cpg_clocks_in CLK_OF_DECLARE(r8a7790_cpg_clks, "renesas,r8a7790-cpg-clocks", r8a7790_cpg_clocks_init); -void __init r8a7790_clocks_init(u32 mode) -{ - cpg_mode = mode; - - of_clk_init(NULL); -} --- 0018/include/linux/clk/shmobile.h +++ /dev/null 2013-06-03 21:41:10.638032047 +0900 @@ -1,19 +0,0 @@ -/* - * Copyright 2013 Ideas On Board SPRL - * - * Contact: Laurent Pinchart - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - */ - -#ifndef __LINUX_CLK_SHMOBILE_H_ -#define __LINUX_CLK_SHMOBILE_H_ - -#include - -void r8a7790_clocks_init(u32 mode); - -#endif