From patchwork Wed May 31 14:59:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 9757443 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 62D5E60390 for ; Wed, 31 May 2017 15:02:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 557A0284A4 for ; Wed, 31 May 2017 15:02:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A6C1284BD; Wed, 31 May 2017 15:02:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C6FA1284A4 for ; Wed, 31 May 2017 15:02:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eUvWZ36W27rdXVKWDV6LKp5PJZuhmp/Pi71EgEDmpGM=; b=cMOOSlYePIBebn 3JIkg3FbQTsOqN4xQ1+KUN6U4r8tly3YTdQCoXFocjpX7FFiaEwoI/oMpw/t+pCkE7sH8nHy2Z/Ny PswCTgL3y3bptBndIrTQqdQ5HWNTi7awEWUcjXGz1CrstR+aTg8hIiVefe4zVKlHHZL9CYYQ2J+LJ gQwb4bM55fIijTc6fWsWcWO1JuZFgdGs7dfBVxfCACLA7CsFbNylai8wiXElonzqRdluUOiNvVSb6 SoMrY/1K3NNURW1LtBFA/yLJQQMF+lEtmkCMGb/yAyD4Grtgw31udLsBMMwPPuSf72lLJkGI8Wd52 VeslN6F6sTkNhit2OnBQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dG59B-0002VX-9f; Wed, 31 May 2017 15:02:53 +0000 Received: from fllnx209.ext.ti.com ([198.47.19.16]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dG57Y-0000ga-4V for linux-arm-kernel@lists.infradead.org; Wed, 31 May 2017 15:01:17 +0000 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id v4VF0NvA022593; Wed, 31 May 2017 10:00:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1496242823; bh=7YantcVuvnoqNvSX8t7wo9u6IRpQ7I/lBSQ9bJbqWV8=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=NpBszDEP7OVLOJ9wZpZ/zTIuVBuRluFhfB4suwKFTvzvbO2x6pQoGy/0HgMV025OS YVmrlrJewE8fwst45t2a8jD8R9RScOxVdg2XhUaZNwolNATrLQll6WD8cMpVAYIYfd 9eYSWxne3ySrXPATICspCvLMOXvZifLRKQMpk6fM= Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id v4VF0Inv015838; Wed, 31 May 2017 10:00:18 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.294.0; Wed, 31 May 2017 10:00:18 -0500 Received: from gomoku.home (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id v4VF0F9Q007908; Wed, 31 May 2017 10:00:17 -0500 From: Tero Kristo To: , Subject: [PATCHv4 1/6] ARM: OMAP2+: timer: add support for fetching fck handle from DT Date: Wed, 31 May 2017 17:59:58 +0300 Message-ID: <1496242803-6101-2-git-send-email-t-kristo@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1496242803-6101-1-git-send-email-t-kristo@ti.com> References: <1496242803-6101-1-git-send-email-t-kristo@ti.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170531_080112_841671_49ED9D38 X-CRM114-Status: UNSURE ( 8.62 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The mux clock handle shall be provided via "fck" DT handle. This avoids the need to lookup the main clock via hwmod core, which will not work with the clkctrl clock support anymore; the main clock is not going to be a mux. Signed-off-by: Tero Kristo Acked-by: Tony Lindgren --- arch/arm/mach-omap2/timer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c index 07dd692..af90f95 100644 --- a/arch/arm/mach-omap2/timer.c +++ b/arch/arm/mach-omap2/timer.c @@ -255,6 +255,8 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer, timer->io_base = of_iomap(np, 0); + timer->fclk = of_clk_get_by_name(np, "fck"); + of_node_put(np); } else { if (omap_dm_timer_reserve_systimer(timer->id)) @@ -292,7 +294,8 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer, omap_hwmod_setup_one(oh_name); /* After the dmtimer is using hwmod these clocks won't be needed */ - timer->fclk = clk_get(NULL, omap_hwmod_get_main_clk(oh)); + if (IS_ERR_OR_NULL(timer->fclk)) + timer->fclk = clk_get(NULL, omap_hwmod_get_main_clk(oh)); if (IS_ERR(timer->fclk)) return PTR_ERR(timer->fclk);