From patchwork Thu May 18 17:16:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 9734901 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 2C3C9601C8 for ; Thu, 18 May 2017 17:17:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0F119288C3 for ; Thu, 18 May 2017 17:17:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 03EF7288CD; Thu, 18 May 2017 17:17:10 +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 AB696288C3 for ; Thu, 18 May 2017 17:17:09 +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=AeVLh8Y99YprZU S6QIyC/vjI71jiOIjSCrKNmKn8dGV72/Fwui1kT7NSnBiydHqw7V5d8oJzvCF03OHvDpyL7s7ttby vLWQ/TRxlk+jX1Ahc8oRfsSfOy55MuuNBqeK6dBt1UUkCw3EY8Dp4XPgbD7/Crx+xUNv8HmynGrRc mYJ7BFC/gv/d4MHWWBbcvThbJVL6OVRmiPbCjKHgoAXvQc9vwp7iJeuajGH23Uyucl/OIlrcRAXEx O1l1J/EbSbJAoZoZccy3XGPsAx6qInaASSSh+H3SFd9rqL2E0igEPv64ynZw+LCy+N3H7530LV43Q O7E4dAJYwTwl0y+HZxXQ==; 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 1dBP2y-0001aE-43; Thu, 18 May 2017 17:17:08 +0000 Received: from fllnx210.ext.ti.com ([198.47.19.17]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dBP2k-0001Nv-Sw for linux-arm-kernel@lists.infradead.org; Thu, 18 May 2017 17:16:56 +0000 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id v4IHGViP006451; Thu, 18 May 2017 12:16:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1495127791; bh=7YantcVuvnoqNvSX8t7wo9u6IRpQ7I/lBSQ9bJbqWV8=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Jh+hhPzcOG4B6wA8JUFoaPX+l+/q6QBdC9K6d2m77lUTHD/vkutTBt4vGuwLbNObK ntfELnqoTDAfg0Zq/+RraG+6C8Vtj+HlokKnW/hDna4w2d5AMt5b+1DNAorx4bwGVm DGXakHZ905/2QIm9ViikLYvHz4Uu7mMMdlWDinTA= Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id v4IHGVv1013317; Thu, 18 May 2017 12:16:31 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.294.0; Thu, 18 May 2017 12:16:30 -0500 Received: from gomoku.home (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id v4IHGNeb019601; Thu, 18 May 2017 12:16:29 -0500 From: Tero Kristo To: , Subject: [PATCHv3 2/3] ARM: OMAP2+: timer: add support for fetching fck handle from DT Date: Thu, 18 May 2017 20:16:11 +0300 Message-ID: <1495127772-7486-3-git-send-email-t-kristo@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1495127772-7486-1-git-send-email-t-kristo@ti.com> References: <1495127772-7486-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-20170518_101655_032643_00D83A23 X-CRM114-Status: UNSURE ( 8.93 ) 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);