From patchwork Mon May 9 07:13:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dirk Behme X-Patchwork-Id: 9041641 X-Patchwork-Delegate: horms@verge.net.au Return-Path: X-Original-To: patchwork-linux-renesas-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2CB0B9F6FA for ; Mon, 9 May 2016 07:15:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CBFE32011B for ; Mon, 9 May 2016 07:15:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 053D020148 for ; Mon, 9 May 2016 07:15:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751408AbcEIHPo (ORCPT ); Mon, 9 May 2016 03:15:44 -0400 Received: from smtp6-v.fe.bosch.de ([139.15.237.11]:57387 "EHLO smtp6-v.fe.bosch.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750864AbcEIHPm (ORCPT ); Mon, 9 May 2016 03:15:42 -0400 Received: from vsmta12.fe.internet.bosch.com (unknown [10.4.98.52]) by imta24.fe.bosch.de (Postfix) with ESMTP id 5979ED8022C for ; Mon, 9 May 2016 09:15:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=de.bosch.com; s=2015-01-21; t=1462778141; bh=2w9EbYfLCZvPRRVt4bNYm0yWWjP24TdBGiPC7asR1v0=; l=10; h=From:From:Reply-To:Sender; b=yNmYVrIdY48X5cuoCJFcX1u3kaRBcEXI7U7KkwslNJlAMAEDiFGkMbs91Je6Gc/S3 wxoOBOhfIMk+FjhcvqkJyt4KQJOepvSTjd7XyH6MLp+V8JUyHesSghuLUowBID2nDT sCjQzfjkcF23fBB2pQAcUFX/RBhnowBN0p1E8SZ4= Received: from FE-HUB1000.de.bosch.com (vsgw23.fe.internet.bosch.com [10.4.98.23]) by vsmta12.fe.internet.bosch.com (Postfix) with ESMTP id 047BD1B80440 for ; Mon, 9 May 2016 09:15:41 +0200 (CEST) Received: from hi-z08if.hi.de.bosch.com (10.34.209.31) by FE-HUB1000.de.bosch.com (10.4.103.107) with Microsoft SMTP Server id 14.3.195.1; Mon, 9 May 2016 09:15:40 +0200 Received: from hi-z08if.hi.de.bosch.com (localhost [127.0.0.1]) by hi-z08if.hi.de.bosch.com (Postfix) with ESMTP id 71DAF625E92; Mon, 9 May 2016 09:14:03 +0200 (CEST) From: Dirk Behme To: Geert Uytterhoeven , Simon Horman , Subject: [PATCH 05/10] clk: renesas: rcar-gen2: Obtain MD pin value using boot-mode-reg Date: Mon, 9 May 2016 09:13:56 +0200 Message-ID: <1462778041-19595-6-git-send-email-dirk.behme@de.bosch.com> X-Mailer: git-send-email 2.8.0 In-Reply-To: <1462778041-19595-1-git-send-email-dirk.behme@de.bosch.com> References: <1462778041-19595-1-git-send-email-dirk.behme@de.bosch.com> MIME-Version: 1.0 X-TM-AS-MML: disable X-TM-AS-Product-Ver: IMSS-7.1.0.1679-8.0.0.1202-22308.006 X-TMASE-MatchedRID: LuXndhVtitkyNFM0Xa1tqLMjW/sniEQKwx0jRRxcQfMypRY3gsuRLZGV Q/ySfpwPEgofxQXb9+CtsViygrLz2odPogR2+s0tA9lly13c/gH4uJ1REX4MHUdmDSBYfnJRVKk hiFZhhSjBfR/WU+6YODxEtja9Tw8PFn6miqL6+G1c/msUC5wFQX0tCKdnhB589yM15V5aWpj6C0 ePs7A07Q9dk+6tnSFLgE5Tfu7hpfH6uE0Ed4J1RsOjX2ZdeKvtlrrvIR5fXpw= Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Spam-Status: No, score=-8.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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: Simon Horman Use new boot mode reg infrastructure to obtain the mode pin value for initialising clocks for for R-Car Gen2 SoCs. Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/setup-rcar-gen2.c | 3 +-- drivers/clk/renesas/clk-rcar-gen2.c | 12 ++++++++++-- include/linux/clk/renesas.h | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-shmobile/setup-rcar-gen2.c b/arch/arm/mach-shmobile/setup-rcar-gen2.c index a45b05b..2af84d8 100644 --- a/arch/arm/mach-shmobile/setup-rcar-gen2.c +++ b/arch/arm/mach-shmobile/setup-rcar-gen2.c @@ -138,14 +138,13 @@ void __init rcar_gen2_timer_init_for_arch_timer(void) void __init rcar_gen2_timer_init(void) { int err; - u32 mode = rcar_gen2_read_mode_pins(); err = rcar_init_boot_mode(); if (err) pr_err("Could not initialise boot mode register driver\n"); rcar_gen2_timer_init_for_arch_timer(); - rcar_gen2_clocks_init(mode); + rcar_gen2_clocks_init(); clocksource_probe(); } diff --git a/drivers/clk/renesas/clk-rcar-gen2.c b/drivers/clk/renesas/clk-rcar-gen2.c index 00e6aba..bd3fe93 100644 --- a/drivers/clk/renesas/clk-rcar-gen2.c +++ b/drivers/clk/renesas/clk-rcar-gen2.c @@ -20,6 +20,8 @@ #include #include +#include + struct rcar_gen2_cpg { struct clk_onecell_data data; spinlock_t lock; @@ -421,9 +423,15 @@ static void __init rcar_gen2_cpg_clocks_init(struct device_node *np) CLK_OF_DECLARE(rcar_gen2_cpg_clks, "renesas,rcar-gen2-cpg-clocks", rcar_gen2_cpg_clocks_init); -void __init rcar_gen2_clocks_init(u32 mode) +void __init rcar_gen2_clocks_init(void) { - cpg_mode = mode; + int err; + + err = boot_mode_reg_get(&cpg_mode); + if (err) { + pr_err("%s: failed obtain boot mode\n", __func__); + return; + } of_clk_init(NULL); } diff --git a/include/linux/clk/renesas.h b/include/linux/clk/renesas.h index ba6fa41..d4a1518 100644 --- a/include/linux/clk/renesas.h +++ b/include/linux/clk/renesas.h @@ -22,7 +22,7 @@ struct generic_pm_domain; void r8a7778_clocks_init(u32 mode); void r8a7779_clocks_init(u32 mode); -void rcar_gen2_clocks_init(u32 mode); +void rcar_gen2_clocks_init(void); void cpg_mstp_add_clk_domain(struct device_node *np); #ifdef CONFIG_CLK_RENESAS_CPG_MSTP