From patchwork Wed May 11 05:29:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dirk Behme X-Patchwork-Id: 9065001 X-Patchwork-Delegate: horms@verge.net.au Return-Path: X-Original-To: patchwork-linux-renesas-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8EE9DBF29F for ; Wed, 11 May 2016 05:31:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 63FF920155 for ; Wed, 11 May 2016 05:31:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0FFC0201B9 for ; Wed, 11 May 2016 05:31:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751414AbcEKFb1 (ORCPT ); Wed, 11 May 2016 01:31:27 -0400 Received: from smtp6-v.fe.bosch.de ([139.15.237.11]:12987 "EHLO smtp6-v.fe.bosch.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751338AbcEKFbZ (ORCPT ); Wed, 11 May 2016 01:31:25 -0400 Received: from vsmta14.fe.internet.bosch.com (unknown [10.4.98.54]) by imta23.fe.bosch.de (Postfix) with ESMTP id 97F6D158012E for ; Wed, 11 May 2016 07:31:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=de.bosch.com; s=2015-01-21; t=1462944683; bh=2w9EbYfLCZvPRRVt4bNYm0yWWjP24TdBGiPC7asR1v0=; l=10; h=From:From:Reply-To:Sender; b=xuBPj45wD1e2lYtSCOO0nfUuLA7CBqlnQimxCNk8LdgHAOthElF/5qNJdXAfqjtHw afDVgXSphcuOlhthp3+aoj1O8Mm3ekK5pTXYr+rBpDviFRJBf97NyQZrKkcTq6kLGo LL7A12egQ9dM2TxbSkhTTTDKWMujGm9ey0kH+kfk= Received: from FE-HUB1000.de.bosch.com (vsgw24.fe.internet.bosch.com [10.4.98.24]) by vsmta14.fe.internet.bosch.com (Postfix) with ESMTP id 34860A403F0 for ; Wed, 11 May 2016 07:31:23 +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; Wed, 11 May 2016 07:31:22 +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 2E9D4625E9F; Wed, 11 May 2016 07:29:41 +0200 (CEST) From: Dirk Behme To: Geert Uytterhoeven , Simon Horman , CC: Dirk Behme Subject: [PATCH v2 05/10] clk: renesas: rcar-gen2: Obtain MD pin value using boot-mode-reg Date: Wed, 11 May 2016 07:29:33 +0200 Message-ID: <1462944578-1220-6-git-send-email-dirk.behme@de.bosch.com> X-Mailer: git-send-email 2.8.0 In-Reply-To: <1462944578-1220-1-git-send-email-dirk.behme@de.bosch.com> References: <1462944578-1220-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-22312.006 X-TMASE-MatchedRID: LuXndhVtitkyNFM0Xa1tqLMjW/sniEQKwx0jRRxcQfMypRY3gsuRLZGV Q/ySfpwPEgofxQXb9+CtsViygrLz2odPogR2+s0tA9lly13c/gH4uJ1REX4MHUdmDSBYfnJRVKk hiFZhhSjBfR/WU+6YODxEtja9Tw8PFn6miqL6+G1c/msUC5wFQX0tCKdnhB589yM15V5aWpj6C0 ePs7A07Q9dk+6tnSFLyooWaSxytmQI1gQKrAzNaCNVZsoBHoGhcvvpflzdo30= 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.2 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 initializing clocks for for R-Car Gen2 SoCs. Signed-off-by: Simon Horman Signed-off-by: Dirk Behme --- 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..0109878 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 to 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