From patchwork Thu Oct 15 06:59:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 7402971 X-Patchwork-Delegate: horms@verge.net.au Return-Path: X-Original-To: patchwork-linux-sh@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 ADFA89F1B9 for ; Thu, 15 Oct 2015 06:59:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5E07420851 for ; Thu, 15 Oct 2015 06:59:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 66E8D20854 for ; Thu, 15 Oct 2015 06:59:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754027AbbJOG7s (ORCPT ); Thu, 15 Oct 2015 02:59:48 -0400 Received: from kirsty.vergenet.net ([202.4.237.240]:36826 "EHLO kirsty.vergenet.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754025AbbJOG7s (ORCPT ); Thu, 15 Oct 2015 02:59:48 -0400 Received: from reginn.isobedori.kobe.vergenet.net (p2250-ipbfp1101kobeminato.hyogo.ocn.ne.jp [122.22.210.250]) by kirsty.vergenet.net (Postfix) with ESMTPA id 9B74D25B7E1; Thu, 15 Oct 2015 17:59:40 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=verge.net.au; s=mail; t=1444892380; bh=qd5NbWizvcIooVANqJSCIqL4PYcNRgUZHYAXbajTx14=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P5IlRJYgXHY7MTWTBM+FZPRj9SIgZNsYfYWlzyL5boorLfKOWLfKCTsC9TYYilXfg N/x/3oeOkFS0hSReaUGiDQuKAOsSvk/TBUEX6tGFOgf4OLT7he0uHdTO50hi9rfuPv +t86ufo7wXxNij9i+d8RXeg3rW0+/QcxdQAEvhUA= Received: by reginn.isobedori.kobe.vergenet.net (Postfix, from userid 7100) id DCCD0942E80; Thu, 15 Oct 2015 15:59:38 +0900 (JST) From: Simon Horman To: Laurent Pinchart Cc: linux-sh@vger.kernel.org, Magnus Damm , Simon Horman Subject: [PATCH/RFC 5/6] clk: shmobile: rcar-gen2: Obtain MD pin value using boot-mode-reg Date: Thu, 15 Oct 2015 15:59:36 +0900 Message-Id: <1444892377-10170-6-git-send-email-horms+renesas@verge.net.au> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1444892377-10170-1-git-send-email-horms+renesas@verge.net.au> References: <1444892377-10170-1-git-send-email-horms+renesas@verge.net.au> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_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 X-Virus-Scanned: ClamAV using ClamSMTP 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/shmobile/clk-rcar-gen2.c | 12 ++++++++++-- include/linux/clk/shmobile.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 3a2bffd4c1cf..81a446bf1702 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_gen2_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_of_init(); } diff --git a/drivers/clk/shmobile/clk-rcar-gen2.c b/drivers/clk/shmobile/clk-rcar-gen2.c index 745496f7ee9c..deb12bb91a07 100644 --- a/drivers/clk/shmobile/clk-rcar-gen2.c +++ b/drivers/clk/shmobile/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/shmobile.h b/include/linux/clk/shmobile.h index cb19cc1865ca..3f93ab6c2ab6 100644 --- a/include/linux/clk/shmobile.h +++ b/include/linux/clk/shmobile.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); #ifdef CONFIG_PM_GENERIC_DOMAINS_OF void cpg_mstp_add_clk_domain(struct device_node *np);