From patchwork Mon Jul 11 11:29:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tarun Kanti DebBarma X-Patchwork-Id: 964312 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6BCmiq3005084 for ; Mon, 11 Jul 2011 12:48:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754801Ab1GKMsp (ORCPT ); Mon, 11 Jul 2011 08:48:45 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:52956 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751344Ab1GKMsp (ORCPT ); Mon, 11 Jul 2011 08:48:45 -0400 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id p6BCmbge014960 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 11 Jul 2011 07:48:39 -0500 Received: from dbde71.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id p6BCmDs7012454; Mon, 11 Jul 2011 18:18:36 +0530 (IST) Received: from dbdp31.itg.ti.com (172.24.170.98) by DBDE71.ent.ti.com (172.24.170.149) with Microsoft SMTP Server id 8.3.106.1; Mon, 11 Jul 2011 16:59:44 +0530 Received: from localhost.localdomain ([172.24.190.106]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id p6BBTJGf020979; Mon, 11 Jul 2011 16:59:41 +0530 (IST) From: Tarun Kanti DebBarma To: CC: khilman@ti.com, santosh.shilimkar@ti.com, tony@atomide.com, linux-arm-kernel@lists.infradead.org, Tarun Kanti DebBarma Subject: [PATCH v14 10/12] OMAP: dmtimer: mark clocksource and clockevent timers reserved Date: Mon, 11 Jul 2011 16:59:17 +0530 Message-ID: <1310383759-19059-11-git-send-email-tarun.kanti@ti.com> X-Mailer: git-send-email 1.6.0.4 In-Reply-To: <1310383759-19059-1-git-send-email-tarun.kanti@ti.com> References: <1310383759-19059-1-git-send-email-tarun.kanti@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Mon, 11 Jul 2011 12:48:46 +0000 (UTC) In driver probe use sys_timer_reserved to identify which all timers have already been used for clocksource and clockevent. Mark all those timers as reserved so that no one else can use them. Signed-off-by: Tarun Kanti DebBarma --- arch/arm/mach-omap1/timer.c | 2 ++ arch/arm/plat-omap/dmtimer.c | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-omap1/timer.c b/arch/arm/mach-omap1/timer.c index 980b23b..0b318c7 100644 --- a/arch/arm/mach-omap1/timer.c +++ b/arch/arm/mach-omap1/timer.c @@ -41,6 +41,8 @@ #define OMAP1_DM_TIMER_COUNT 8 +u32 sys_timer_reserved; + static int omap1_dm_timer_set_src(struct platform_device *pdev, int source) { diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c index e7ceb5b..c0e5bab 100644 --- a/arch/arm/plat-omap/dmtimer.c +++ b/arch/arm/plat-omap/dmtimer.c @@ -520,10 +520,14 @@ static int __devinit omap_dm_timer_probe(struct platform_device *pdev) timer->pdev = pdev; timer->reserved = 0; - /* Skip pm_runtime_enable for OMAP1 */ - if (!pdata->needs_manual_reset) + if (!pdata->needs_manual_reset) { pm_runtime_enable(&pdev->dev); + /* Mark clocksource and clockevent timers as reserved */ + if ((sys_timer_reserved >> (pdev->id - 1)) & 0x1) + timer->reserved = 1; + } + /* add the timer element to the list */ mutex_lock(&dm_timer_mutex); list_add_tail(&timer->node, &omap_timer_list);